Skip to content

Commit 9aba6b7

Browse files
committed
patches: ncs/zephyr: add patches for nrf91-slm driver
1 parent eeba5c3 commit 9aba6b7

4 files changed

Lines changed: 149 additions & 0 deletions

zephyr/patches.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
11
patches:
2+
- path: ncs/zephyr/0001-modem-uart_isr-support-mdm-dtr-gpios.patch
3+
sha256sum: 53b5acb22a3471b04bb38d297ef4bd5e3a2ed0464ab74b588f30408599307785
4+
module: zephyr
5+
author: Marcin Niestroj
6+
email: m.niestroj@emb.dev
7+
date: 2026-02-11
8+
apply-command: >-
9+
bash -c 'if [ $(west config manifest.file) = "west-ncs.yml" ]; then git am $@; fi' --
10+
- path: ncs/zephyr/0002-dts-bindings-modem-add-common-autostarts-property.patch
11+
sha256sum: abbdd4193332e4160dd5c0a29eaa1d0e5fde39b2de510fa215694fcdbdc5785a
12+
module: zephyr
13+
author: Marcin Niestroj
14+
email: m.niestroj@emb.dev
15+
date: 2026-02-12
16+
apply-command: >-
17+
bash -c 'if [ $(west config manifest.file) = "west-ncs.yml" ]; then git am $@; fi' --
18+
- path: ncs/zephyr/0003-drivers-modem_cellular-add-Ready-signal-handling.patch
19+
sha256sum: a2e3946a3794f3f19c94cd401755458c48c62a306cd39c924658daa5ca769dbc
20+
module: zephyr
21+
author: Marcin Niestroj
22+
email: m.niestroj@emb.dev
23+
date: 2026-02-12
24+
apply-command: >-
25+
bash -c 'if [ $(west config manifest.file) = "west-ncs.yml" ]; then git am $@; fi' --
26+
227
- path: zephyr/zephyr/0001-drivers-net-nsos-support-nrf_bsim.patch
328
sha256sum: 76ee96ad695aba17be8a96d8fe908eec937238fbd9e21be09b8ad9a524b8b90b
429
module: zephyr
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
From 741febe08c6cac19648a6c345b5c7486240a9c73 Mon Sep 17 00:00:00 2001
2+
From: Marcin Niestroj <m.niestroj@emb.dev>
3+
Date: Wed, 11 Feb 2026 22:31:46 +0100
4+
Subject: [PATCH] modem: uart_isr: support mdm-dtr-gpios
5+
6+
---
7+
subsys/modem/backends/modem_backend_uart_isr.c | 7 +++++++
8+
1 file changed, 7 insertions(+)
9+
10+
diff --git a/subsys/modem/backends/modem_backend_uart_isr.c b/subsys/modem/backends/modem_backend_uart_isr.c
11+
index 6c6c27c2db2..07112cb1e31 100644
12+
--- a/subsys/modem/backends/modem_backend_uart_isr.c
13+
+++ b/subsys/modem/backends/modem_backend_uart_isr.c
14+
@@ -11,6 +11,7 @@
15+
LOG_MODULE_REGISTER(modem_backend_uart_isr, CONFIG_MODEM_MODULES_LOG_LEVEL);
16+
17+
#include <string.h>
18+
+#include <zephyr/drivers/gpio.h>
19+
20+
static void modem_backend_uart_isr_flush(struct modem_backend_uart *backend)
21+
{
22+
@@ -113,6 +114,9 @@ static int modem_backend_uart_isr_open(void *data)
23+
ring_buf_reset(&backend->isr.transmit_rb);
24+
atomic_set(&backend->isr.transmit_buf_len, 0);
25+
modem_backend_uart_isr_flush(backend);
26+
+ if (backend->dtr_gpio) {
27+
+ gpio_pin_set_dt(backend->dtr_gpio, 1);
28+
+ }
29+
uart_irq_rx_enable(backend->uart);
30+
uart_irq_tx_enable(backend->uart);
31+
modem_pipe_notify_opened(&backend->pipe);
32+
@@ -228,6 +232,9 @@ static int modem_backend_uart_isr_close(void *data)
33+
{
34+
struct modem_backend_uart *backend = (struct modem_backend_uart *)data;
35+
36+
+ if (backend->dtr_gpio) {
37+
+ gpio_pin_set_dt(backend->dtr_gpio, 0);
38+
+ }
39+
uart_irq_rx_disable(backend->uart);
40+
uart_irq_tx_disable(backend->uart);
41+
modem_pipe_notify_closed(&backend->pipe);
42+
--
43+
2.53.0
44+
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
From 00bad68c943c8cea837fd5a862c55dd06289d641 Mon Sep 17 00:00:00 2001
2+
From: Marcin Niestroj <m.niestroj@emb.dev>
3+
Date: Thu, 12 Feb 2026 09:44:44 +0100
4+
Subject: [PATCH] dts: bindings: modem: add common 'autostarts' property
5+
6+
This property can be used by various modems. Used it successfully with
7+
nRF91-SLM when waiting for "Ready" signal after automatic power-on.
8+
9+
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
10+
---
11+
dts/bindings/modem/quectel,bg95.yaml | 8 --------
12+
dts/bindings/modem/zephyr,cellular-modem-device.yaml | 7 +++++++
13+
2 files changed, 7 insertions(+), 8 deletions(-)
14+
15+
diff --git a/dts/bindings/modem/quectel,bg95.yaml b/dts/bindings/modem/quectel,bg95.yaml
16+
index 940cd41ea27..8011dd05fbf 100644
17+
--- a/dts/bindings/modem/quectel,bg95.yaml
18+
+++ b/dts/bindings/modem/quectel,bg95.yaml
19+
@@ -10,11 +10,3 @@ include: zephyr,cellular-modem-device.yaml
20+
properties:
21+
mdm-power-gpios:
22+
type: phandle-array
23+
-
24+
- autostarts:
25+
- type: boolean
26+
- description: |
27+
- Set for modem variants or carrier boards that start the module
28+
- automatically when supply voltage is applied—that is, the modem
29+
- asserts PWRKEY internally and does not require an external PWRKEY
30+
- pulse.
31+
diff --git a/dts/bindings/modem/zephyr,cellular-modem-device.yaml b/dts/bindings/modem/zephyr,cellular-modem-device.yaml
32+
index d2ab0056841..205c0d3e0fb 100644
33+
--- a/dts/bindings/modem/zephyr,cellular-modem-device.yaml
34+
+++ b/dts/bindings/modem/zephyr,cellular-modem-device.yaml
35+
@@ -44,6 +44,13 @@ properties:
36+
When runtime power management is enabled, this closes the UART.
37+
This requires modem to support waking up the UART using RING signal.
38+
39+
+ autostarts:
40+
+ type: boolean
41+
+ description: |
42+
+ Set when the modem starts automatically at power-on without requiring
43+
+ an external power or reset pulse. When set, the host waits for a ready
44+
+ indication from the modem before sending AT commands.
45+
+
46+
cmux-idle-timeout-ms:
47+
type: int
48+
description: Time in milliseconds after which CMUX will enter power save mode.
49+
--
50+
2.53.0
51+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
From f39324378c5ecfd4c37153ad0a5793dcf38a115b Mon Sep 17 00:00:00 2001
2+
From: Marcin Niestroj <m.niestroj@emb.dev>
3+
Date: Thu, 12 Feb 2026 09:46:16 +0100
4+
Subject: [PATCH] drivers: modem_cellular: add "Ready" signal handling
5+
6+
This is the same as "APP RDY", but for other modems, such as nRF-SLM.
7+
8+
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
9+
---
10+
drivers/modem/modem_cellular.c | 3 ++-
11+
1 file changed, 2 insertions(+), 1 deletion(-)
12+
13+
diff --git a/drivers/modem/modem_cellular.c b/drivers/modem/modem_cellular.c
14+
index 412ced1dfa8..be075c11070 100644
15+
--- a/drivers/modem/modem_cellular.c
16+
+++ b/drivers/modem/modem_cellular.c
17+
@@ -622,7 +622,8 @@ MODEM_CHAT_MATCHES_DEFINE(unsol_matches,
18+
MODEM_CHAT_MATCH("+CREG: ", ",", modem_cellular_chat_on_cxreg),
19+
MODEM_CHAT_MATCH("+CEREG: ", ",", modem_cellular_chat_on_cxreg),
20+
MODEM_CHAT_MATCH("+CGREG: ", ",", modem_cellular_chat_on_cxreg),
21+
- MODEM_CHAT_MATCH("APP RDY", "", modem_cellular_chat_on_modem_ready));
22+
+ MODEM_CHAT_MATCH("APP RDY", "", modem_cellular_chat_on_modem_ready),
23+
+ MODEM_CHAT_MATCH("Ready", "", modem_cellular_chat_on_modem_ready));
24+
25+
MODEM_CHAT_MATCHES_DEFINE(abort_matches, MODEM_CHAT_MATCH("ERROR", "", NULL));
26+
27+
--
28+
2.53.0
29+

0 commit comments

Comments
 (0)