* [PATCH v2 0/2] serial: 8250: omap: Add wakeup support
@ 2025-09-10 21:23 Kendall Willis
2025-09-10 21:23 ` [PATCH v2 1/2] dt-bindings: serial: 8250_omap: Add wakeup pinctrl state Kendall Willis
2025-09-10 21:23 ` [PATCH v2 2/2] serial: 8250: omap: Support wakeup pinctrl state on suspend Kendall Willis
0 siblings, 2 replies; 6+ messages in thread
From: Kendall Willis @ 2025-09-10 21:23 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Vignesh Raghavendra
Cc: linux-kernel, linux-serial, devicetree, d-gole, vishalm,
sebin.francis, msp, khilman, a-kaur, andriy.shevchenko,
yujiaoliang, b-liu, u.kleine-koenig, Kendall Willis
This series adds wakeup support for the serial 8250_omap driver. On the
TI K3 AM62 family of devices, the UARTs are able to wakeup the system
from various low power modes by using I/O daisy-chaining.
The wakeup functionality is implemented by adding the pinctrl state
'wakeup' in which specific flags are set on the pins to enable wakeup
via I/O daisy-chain. If the 'wakeup' pinctrl state exists for the serial
device, the 'wakeup' pinctrl state is selected on suspend. Upon resume,
the pinctrl 'default' state is selected.
The commits "dt-bindings: serial: 8250_omap: Add wakeup pinctrl state"
and "serial: 8250: omap: Support wakeup pinctrl state on suspend" were
picked from this series [1]. The commit "dt-bindings: serial: 8250_omap:
Add wakeup pinctrl state" was updated to follow the structure of a
similar patch [2] by Markus for the m_can driver. The commit "serial:
8250: omap: Support wakeup pinctrl state on suspend" was updated to only
include s2ram functionality instead of a poweroff state.
Implementation
--------------
This series is intended to be implemented along with the following
series. This patch has no dependencies on any of the other series:
1. "pmdomain: ti_sci: Handle wakeup constraint if device has pinctrl
wakeup state" [3]: Patch which skips setting constraints for wakeup
sources that use pinctrl state 'wakeup'.
2. "serial: 8250: omap: Add wakeup support" (this series): Implements
wakeup from the UARTs for TI K3 SoCs
3. "arm64: dts: ti: k3-am62: Support Main UART wakeup" [4]: Implements
the functionality to wakeup the system from the Main UART
Testing
-------
Tested on a AM62P SK EVM board with all series and dependencies
implemented. Suspend/resume verified with the Main UART wakeup source
by entering a keypress on the console.
This github branch [5] has all the necessary patches to test the series
using linux-next.
Links
-----
[1] https://lore.kernel.org/all/20240523075819.1285554-1-msp@baylibre.com/
[2] https://lore.kernel.org/all/20250820-topic-mcan-wakeup-source-v6-12-v9-1-0ac13f2ddd67@baylibre.com/
[3] https://github.com/kwillis01/linux/tree/b4/uart-daisy-chain-pmdomain
[4] https://github.com/kwillis01/linux/tree/b4/uart-daisy-chain-dts
[5] https://github.com/kwillis01/linux/tree/uart-daisy-chain
Previous Versions
-----------------
v1: https://lore.kernel.org/all/20250904212455.3729029-1-k-willis@ti.com/
Changes from v1 to v2:
- Drop patch for updated wakeup-source binding
- Update dt binding for pinctrl to only use either default or sleep
states and change commit message to reflect the change
base-commit: 4ac65880ebca1b68495bd8704263b26c050ac010
---
Markus Schneider-Pargmann (2):
dt-bindings: serial: 8250_omap: Add wakeup pinctrl state
serial: 8250: omap: Support wakeup pinctrl state on suspend
.../devicetree/bindings/serial/8250_omap.yaml | 16 ++++++++++
drivers/tty/serial/8250/8250_omap.c | 36 ++++++++++++++++++++++
2 files changed, 52 insertions(+)
---
base-commit: 5f540c4aade9f1d58fb7b9490b4b7d5214ec9746
change-id: 20250910-uart-daisy-chain-8250-omap-3649ec6a7155
Best regards,
--
Kendall Willis <k-willis@ti.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/2] dt-bindings: serial: 8250_omap: Add wakeup pinctrl state
2025-09-10 21:23 [PATCH v2 0/2] serial: 8250: omap: Add wakeup support Kendall Willis
@ 2025-09-10 21:23 ` Kendall Willis
2025-09-15 0:26 ` Rob Herring (Arm)
2025-09-15 5:21 ` Dhruva Gole
2025-09-10 21:23 ` [PATCH v2 2/2] serial: 8250: omap: Support wakeup pinctrl state on suspend Kendall Willis
1 sibling, 2 replies; 6+ messages in thread
From: Kendall Willis @ 2025-09-10 21:23 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Vignesh Raghavendra
Cc: linux-kernel, linux-serial, devicetree, d-gole, vishalm,
sebin.francis, msp, khilman, a-kaur, andriy.shevchenko,
yujiaoliang, b-liu, u.kleine-koenig, Kendall Willis
From: Markus Schneider-Pargmann <msp@baylibre.com>
Pins associated with the 8250 omap unit can be the source of a wakeup in
deep sleep states. To be able to wakeup, these pins have to be
configured in a special way. To support this configuration add the
default and wakeup pinctrl states.
Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
Signed-off-by: Kendall Willis <k-willis@ti.com>
---
Documentation/devicetree/bindings/serial/8250_omap.yaml | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/Documentation/devicetree/bindings/serial/8250_omap.yaml b/Documentation/devicetree/bindings/serial/8250_omap.yaml
index 1859f71297ff297141e5cd455574fa9ccd9dd11c..aabacca2b2fa6a7740173e6c415656360b5df4e4 100644
--- a/Documentation/devicetree/bindings/serial/8250_omap.yaml
+++ b/Documentation/devicetree/bindings/serial/8250_omap.yaml
@@ -71,6 +71,22 @@ properties:
overrun-throttle-ms: true
wakeup-source: true
+ pinctrl-0:
+ description: Default pinctrl state
+
+ pinctrl-1:
+ description: Wakeup pinctrl state
+
+ pinctrl-names:
+ description:
+ When present should contain at least "default" describing the default pin
+ states. The second state called "wakeup" describes the pins in their
+ wakeup configuration required to exit sleep states.
+ minItems: 1
+ items:
+ - const: default
+ - const: wakeup
+
required:
- compatible
- reg
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/2] serial: 8250: omap: Support wakeup pinctrl state on suspend
2025-09-10 21:23 [PATCH v2 0/2] serial: 8250: omap: Add wakeup support Kendall Willis
2025-09-10 21:23 ` [PATCH v2 1/2] dt-bindings: serial: 8250_omap: Add wakeup pinctrl state Kendall Willis
@ 2025-09-10 21:23 ` Kendall Willis
2025-09-15 5:33 ` Dhruva Gole
1 sibling, 1 reply; 6+ messages in thread
From: Kendall Willis @ 2025-09-10 21:23 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Vignesh Raghavendra
Cc: linux-kernel, linux-serial, devicetree, d-gole, vishalm,
sebin.francis, msp, khilman, a-kaur, andriy.shevchenko,
yujiaoliang, b-liu, u.kleine-koenig, Kendall Willis
From: Markus Schneider-Pargmann <msp@baylibre.com>
UART can be used as a wakeup source for am62 from suspend to ram states.
To enable wakeup from UART am62 requires a wakeup flag being set in the
pinctrl.
If the device is marked as wakeup enabled, select the 'wakeup' pinctrl
state on suspend and restore the default pinctrl state on resume.
Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
Signed-off-by: Kendall Willis <k-willis@ti.com>
---
drivers/tty/serial/8250/8250_omap.c | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
index bb23afdd63f29353351aa21fccf6c8de99011a65..9e49ef48b851bf6cd3b04a77a4d0d7b4e064dc5f 100644
--- a/drivers/tty/serial/8250/8250_omap.c
+++ b/drivers/tty/serial/8250/8250_omap.c
@@ -27,6 +27,8 @@
#include <linux/pm_wakeirq.h>
#include <linux/dma-mapping.h>
#include <linux/sys_soc.h>
+#include <linux/reboot.h>
+#include <linux/pinctrl/consumer.h>
#include "8250.h"
@@ -145,6 +147,9 @@ struct omap8250_priv {
spinlock_t rx_dma_lock;
bool rx_dma_broken;
bool throttled;
+
+ struct pinctrl *pinctrl;
+ struct pinctrl_state *pinctrl_wakeup;
};
struct omap8250_dma_params {
@@ -1349,6 +1354,18 @@ static int omap8250_no_handle_irq(struct uart_port *port)
return 0;
}
+static int omap8250_select_wakeup_pinctrl(struct device *dev,
+ struct omap8250_priv *priv)
+{
+ if (IS_ERR_OR_NULL(priv->pinctrl_wakeup))
+ return 0;
+
+ if (!device_may_wakeup(dev))
+ return 0;
+
+ return pinctrl_select_state(priv->pinctrl, priv->pinctrl_wakeup);
+}
+
static struct omap8250_dma_params am654_dma = {
.rx_size = SZ_2K,
.rx_trigger = 1,
@@ -1573,6 +1590,11 @@ static int omap8250_probe(struct platform_device *pdev)
priv->line = ret;
pm_runtime_mark_last_busy(&pdev->dev);
pm_runtime_put_autosuspend(&pdev->dev);
+
+ priv->pinctrl = devm_pinctrl_get(&pdev->dev);
+ if (!IS_ERR_OR_NULL(priv->pinctrl))
+ priv->pinctrl_wakeup = pinctrl_lookup_state(priv->pinctrl, "wakeup");
+
return 0;
err:
pm_runtime_dont_use_autosuspend(&pdev->dev);
@@ -1630,6 +1652,13 @@ static int omap8250_suspend(struct device *dev)
struct uart_8250_port *up = serial8250_get_port(priv->line);
int err = 0;
+ err = omap8250_select_wakeup_pinctrl(dev, priv);
+ if (err) {
+ dev_err(dev, "Failed to select wakeup pinctrl, aborting suspend %pe\n",
+ ERR_PTR(err));
+ return err;
+ }
+
serial8250_suspend_port(priv->line);
err = pm_runtime_resume_and_get(dev);
@@ -1651,6 +1680,13 @@ static int omap8250_resume(struct device *dev)
struct uart_8250_port *up = serial8250_get_port(priv->line);
int err;
+ err = pinctrl_select_default_state(dev);
+ if (err) {
+ dev_err(dev, "Failed to select default pinctrl state on resume: %pe\n",
+ ERR_PTR(err));
+ return err;
+ }
+
if (uart_console(&up->port) && console_suspend_enabled) {
err = pm_runtime_force_resume(dev);
if (err)
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: serial: 8250_omap: Add wakeup pinctrl state
2025-09-10 21:23 ` [PATCH v2 1/2] dt-bindings: serial: 8250_omap: Add wakeup pinctrl state Kendall Willis
@ 2025-09-15 0:26 ` Rob Herring (Arm)
2025-09-15 5:21 ` Dhruva Gole
1 sibling, 0 replies; 6+ messages in thread
From: Rob Herring (Arm) @ 2025-09-15 0:26 UTC (permalink / raw)
To: Kendall Willis
Cc: Vignesh Raghavendra, khilman, andriy.shevchenko, u.kleine-koenig,
Greg Kroah-Hartman, yujiaoliang, Conor Dooley, d-gole, msp,
Krzysztof Kozlowski, a-kaur, linux-kernel, vishalm, b-liu,
linux-serial, Jiri Slaby, sebin.francis, devicetree
On Wed, 10 Sep 2025 16:23:31 -0500, Kendall Willis wrote:
> From: Markus Schneider-Pargmann <msp@baylibre.com>
>
> Pins associated with the 8250 omap unit can be the source of a wakeup in
> deep sleep states. To be able to wakeup, these pins have to be
> configured in a special way. To support this configuration add the
> default and wakeup pinctrl states.
>
> Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
> Signed-off-by: Kendall Willis <k-willis@ti.com>
> ---
> Documentation/devicetree/bindings/serial/8250_omap.yaml | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: serial: 8250_omap: Add wakeup pinctrl state
2025-09-10 21:23 ` [PATCH v2 1/2] dt-bindings: serial: 8250_omap: Add wakeup pinctrl state Kendall Willis
2025-09-15 0:26 ` Rob Herring (Arm)
@ 2025-09-15 5:21 ` Dhruva Gole
1 sibling, 0 replies; 6+ messages in thread
From: Dhruva Gole @ 2025-09-15 5:21 UTC (permalink / raw)
To: Kendall Willis
Cc: Greg Kroah-Hartman, Jiri Slaby, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Vignesh Raghavendra, linux-kernel, linux-serial,
devicetree, vishalm, sebin.francis, msp, khilman, a-kaur,
andriy.shevchenko, yujiaoliang, b-liu, u.kleine-koenig
On Sep 10, 2025 at 16:23:31 -0500, Kendall Willis wrote:
> From: Markus Schneider-Pargmann <msp@baylibre.com>
>
> Pins associated with the 8250 omap unit can be the source of a wakeup in
> deep sleep states. To be able to wakeup, these pins have to be
> configured in a special way. To support this configuration add the
> default and wakeup pinctrl states.
>
> Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
> Signed-off-by: Kendall Willis <k-willis@ti.com>
> ---
> Documentation/devicetree/bindings/serial/8250_omap.yaml | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
--
Best regards,
Dhruva Gole
Texas Instruments Incorporated
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/2] serial: 8250: omap: Support wakeup pinctrl state on suspend
2025-09-10 21:23 ` [PATCH v2 2/2] serial: 8250: omap: Support wakeup pinctrl state on suspend Kendall Willis
@ 2025-09-15 5:33 ` Dhruva Gole
0 siblings, 0 replies; 6+ messages in thread
From: Dhruva Gole @ 2025-09-15 5:33 UTC (permalink / raw)
To: Kendall Willis
Cc: Greg Kroah-Hartman, Jiri Slaby, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Vignesh Raghavendra, linux-kernel, linux-serial,
devicetree, vishalm, sebin.francis, msp, khilman, a-kaur,
andriy.shevchenko, yujiaoliang, b-liu, u.kleine-koenig
On Sep 10, 2025 at 16:23:32 -0500, Kendall Willis wrote:
> From: Markus Schneider-Pargmann <msp@baylibre.com>
>
> UART can be used as a wakeup source for am62 from suspend to ram states.
> To enable wakeup from UART am62 requires a wakeup flag being set in the
My preference would be to call it TI K3 AM62 family of SoCs.
am62 can mean very different things to different people.
> pinctrl.
>
> If the device is marked as wakeup enabled, select the 'wakeup' pinctrl
> state on suspend and restore the default pinctrl state on resume.
>
> Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
> Signed-off-by: Kendall Willis <k-willis@ti.com>
> ---
If you do end up respinning, include:
Reviewed-by: Dhruva Gole <d-gole@ti.com>
--
Best regards,
Dhruva Gole
Texas Instruments Incorporated
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-09-15 5:33 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-10 21:23 [PATCH v2 0/2] serial: 8250: omap: Add wakeup support Kendall Willis
2025-09-10 21:23 ` [PATCH v2 1/2] dt-bindings: serial: 8250_omap: Add wakeup pinctrl state Kendall Willis
2025-09-15 0:26 ` Rob Herring (Arm)
2025-09-15 5:21 ` Dhruva Gole
2025-09-10 21:23 ` [PATCH v2 2/2] serial: 8250: omap: Support wakeup pinctrl state on suspend Kendall Willis
2025-09-15 5:33 ` Dhruva Gole
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox