drivers/rpmsg_port_uart: support wake up by peer core

Support wakeup by peer core (Linux)

1. Add 3 commands: STAYWAKE/RELAXWAKE/STAYWAKEACK

Local will stay the wakeup source when received the STAYWAKE command
and relax the pm wake soucre when received the RELAXWAKE.
And local should response the STAYWAKEACK to peer to notify local has
been waked up.

Local core must send the RELAXWAKE command to peer when there is nothing
to do (send/receive data) otherwise peer can't enter into sleep mode.
So we wakeup the tx thread to send the RELAXWAKE command at the time
that may blocked in the file_read() in rx thread.

NOTE:
Local core should relax the pm wakelock when received POWEROFF
command to allow enter into sleep mode when peer core SHUTDOWN.

2. Change all the flags to event, use event is more convinent
to reprsent all the flags. But the tx sem must be kept because we need
support notify the tx is ready event the tx thread is running to avoid
miss any tx ready event.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
This commit is contained in:
Bowen Wang
2025-01-10 23:38:07 +08:00
committed by GUIDINGLI
parent af7ff1b52b
commit 3e9003802b
2 changed files with 202 additions and 69 deletions
+1
View File
@@ -85,6 +85,7 @@ endif # RPMSG_PORT_SPI
config RPMSG_PORT_UART
bool "Rpmsg Uart Port Driver Support"
default n
depends on SCHED_EVENTS
select RPMSG_PORT
---help---
Rpmsg Uart Port driver used for cross chip communication.