Files
Bowen Wang 3e9003802b 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>
2026-01-28 19:23:41 +08:00

237 lines
5.7 KiB
Plaintext

#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
config RPMSG
bool
default n
select OPENAMP
if RPMSG
config RPMSG_LOCAL_CPUNAME
string "Rpmsg Local Cpuname"
default LIBC_HOSTNAME
config RPMSG_PING
bool "rpmsg ping support"
default n
---help---
This is for debugging & profiling, create ping rpmsg
channel, user can use it to get send/recv speed & latency.
config RPMSG_TEST
bool "rpmsg test support"
default n
endif # RPMSG
config RPMSG_ROUTER
bool "rpmsg router support"
default n
---help---
Rpmsg router driver for enabling communication
without physical channels.
config RPMSG_PORT
bool
default n
select RPMSG
---help---
Rpmsg port transport layer used for cross chip communication.
config RPMSG_PORT_SPI
bool "Rpmsg SPI Port Driver Support"
default n
depends on SPI
select RPMSG_PORT
---help---
Rpmsg SPI Port driver used for cross chip communication.
config RPMSG_PORT_SPI_SLAVE
bool "Rpmsg SPI Slave Port Driver Support"
default n
select RPMSG_PORT
---help---
Rpmsg SPI Slave Port driver used for cross chip communication.
if RPMSG_PORT_SPI || RPMSG_PORT_SPI_SLAVE
config RPMSG_PORT_SPI_THREAD_PRIORITY
int "Rpmsg SPI Port Thread Priority"
default 224
config RPMSG_PORT_SPI_THREAD_STACKSIZE
int "Rpmsg SPI Port Stack Size"
default 4096
config RPMSG_PORT_SPI_CRC
bool "Rpmsg SPI Port Use CRC Check"
default n
config RPMSG_PORT_SPI_RX_THRESHOLD
int "Rpmsg SPI Port Rx Buffer Threshold"
default 50
range 0 100
config RPMSG_PORT_SPI_PM_TIMEOUT
int "Rpmsg SPI Port PM Stay Timeout in Milliseconds"
default 1
depends on PM
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.
if RPMSG_PORT_UART
config RPMSG_PORT_UART_RX_THREAD_PRIORITY
int "Rpmsg UART Port RX Thread Priority"
default 224
config RPMSG_PORT_UART_RX_THREAD_STACKSIZE
int "Rpmsg UART Port RX Stack Size"
default DEFAULT_TASK_STACKSIZE
config RPMSG_PORT_UART_TX_THREAD_PRIORITY
int "Rpmsg UART Port TX Thread Priority"
default 224
config RPMSG_PORT_UART_TX_THREAD_STACKSIZE
int "Rpmsg UART Port TX Stack Size"
default DEFAULT_TASK_STACKSIZE
config RPMSG_PORT_UART_CRC
bool "Rpmsg UART Port CRC Enable"
default n
config RPMSG_PORT_UART_DEBUG
bool "Rpmsg UART DEBUG Enable"
default n
endif # RPMSG_PORT_UART
config RPMSG_VIRTIO
bool
default n
select RPMSG
---help---
The Rpmsg VirtIO Lite, VirtIO-Rpmsg and VHost-Rpmsg common
part.
if RPMSG_VIRTIO
config RPMSG_VIRTIO_PRIORITY
int "rpmsg virtio priority"
default 224
config RPMSG_VIRTIO_STACKSIZE
int "rpmsg virtio stack size"
default DEFAULT_TASK_STACKSIZE
config RPMSG_VIRTIO_PM
bool "RPMsg VirtIO power management"
depends on PM
default n
---help---
If TX/RX buffer is supplied and powered by each CPU.
And when one CPU in DEEP sleep, then it's buffer will
goto RAM-retention mode, can't access from another CPU.
So, we provide this method to resolve this.
config RPMSG_VIRTIO_PM_AUTORELAX
bool "RPMsg VirtIO pm autorelax"
depends on RPMSG_VIRTIO_PM
default y
---help---
Enable automatic power management wakelock relaxation using watchdog timer.
When enabled, this option uses a watchdog timer to periodically check if
there are any tx buffers is not returned by remote core. If the tx buffers
are returned by remote core, the power management wakelock is automatically
released, allowing the system to enter low-power states. If the tx buffers
are still not returned by remote core, the wakelock is maintained and the
timer is restarted.
Autorelax feature can improve power efficiency in multi-core systems because
it prevents unnecessary power consumption by reducing the times that system
enter and leave low-power states.
endif # RPMSG_VIRTIO
config RPMSG_VIRTIO_LITE
bool "rpmsg virtio transport support"
default n
select RPMSG
if RPMSG_VIRTIO_LITE
config RPMSG_VIRTIO_LITE_PRIORITY
int "rpmsg virtio lite rx thread priority"
default 224
config RPMSG_VIRTIO_LITE_STACKSIZE
int "rpmsg virtio lite rx thread stack size"
default DEFAULT_TASK_STACKSIZE
config RPMSG_VIRTIO_IVSHMEM
bool "rpmsg virtio lite ivshmem support"
default n
depends on PCI_IVSHMEM
---help---
This is rpmsg virtio driver based on pci ivshmem.
config RPMSG_VIRTIO_LITE_PM
bool "rpmsg virtio lite power management"
depends on PM
default n
---help---
If TX/RX buffer is supplied and powered by each CPU.
And when one CPU in DEEP sleep, then it's buffer will
goto RAM-retention mode, can't access from another CPU.
So, we provide this method to resolve this.
config RPMSG_VIRTIO_LITE_PM_AUTORELAX
bool "rpmsg virtio lite pm autorelax"
depends on RPMSG_VIRTIO_LITE_PM
default y
---help---
use wd_timer to auto relax pm
if RPMSG_VIRTIO_IVSHMEM
config RPMSG_VIRTIO_IVSHMEM_NAME
string "rpmsg virtio lite ivshmem name"
---help---
Using this config to custom the rpmsg virtio ivshmem id, cpuname and role,
using ";" to split the names.
For example, if RPMSG_VIRTIO_IVSHMEM_CPUNAME = "0:cpu1:m;1:cpu2:s" and pass
two ivshmem devices to the qemu, we will get two rpmsg virtio ivshmem drivers
with remote cpu ids: "0","1", names: "cpu1", "cpu2", and roles: "master", "slave"
config RPMSG_VIRTIO_IVSHMEM_BUFFSIZE
int "rpmsg virtio lite ivshmem rpmsg buffer size"
default 2048
---help---
The rpmsg buffer size in share memory, the RX and TX buffer size
are same for now.
config RPMSG_VIRTIO_IVSHMEM_BUFFNUM
int "rpmsg virtio lite ivshmem rpmsg buffer number"
default 8
---help---
The rpmsg virtio buffer number in share memory, the RX and TX buffer number
are same for now.
endif
endif