| 
 | 1 | +# Copyright (c) 2020-2021 Nordic Semiconductor (ASA)  | 
 | 2 | +# SPDX-License-Identifier: Apache-2.0  | 
 | 3 | + | 
 | 4 | +# Workaround for not being able to have commas in macro arguments  | 
 | 5 | +DT_CHOSEN_Z_IPC_SHM := zephyr,ipc_shm  | 
 | 6 | +DT_CHOSEN_Z_IPC := zephyr,ipc  | 
 | 7 | +DT_CHOSEN_Z_IPC_TX := zephyr,ipc_tx  | 
 | 8 | +DT_CHOSEN_Z_IPC_RX := zephyr,ipc_rx  | 
 | 9 | + | 
 | 10 | +config RPMSG_SERVICE_SINGLE_IPM_SUPPORT  | 
 | 11 | +	bool  | 
 | 12 | +	default $(dt_chosen_enabled,$(DT_CHOSEN_Z_IPC))  | 
 | 13 | +	help  | 
 | 14 | +	  This option must be selected when single IPM is used for  | 
 | 15 | +	  both TX and RX communication  | 
 | 16 | + | 
 | 17 | +config RPMSG_SERVICE_DUAL_IPM_SUPPORT  | 
 | 18 | +	bool  | 
 | 19 | +	default $(dt_chosen_enabled,$(DT_CHOSEN_Z_IPC_TX)) && \  | 
 | 20 | +		$(dt_chosen_enabled,$(DT_CHOSEN_Z_IPC_RX))  | 
 | 21 | +	help  | 
 | 22 | +	  This option must be selected when separate IPMs are used for  | 
 | 23 | +	  TX and RX communication  | 
 | 24 | + | 
 | 25 | +menuconfig RPMSG_SERVICE  | 
 | 26 | +	bool "RPMsg service for multiple users"  | 
 | 27 | +	select IPM  | 
 | 28 | +	select OPENAMP  | 
 | 29 | +	help  | 
 | 30 | +	  Enables support for a service that can be shared by multiple  | 
 | 31 | +	  users to establish RPMsg endpoints for given channel.  | 
 | 32 | + | 
 | 33 | +if RPMSG_SERVICE  | 
 | 34 | + | 
 | 35 | +config RPMSG_SERVICE_SHM_BASE_ADDRESS  | 
 | 36 | +	hex  | 
 | 37 | +	default "$(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_IPC_SHM))"  | 
 | 38 | +	help  | 
 | 39 | +	  This option specifies base address of the memory region to  | 
 | 40 | +	  be used for the OpenAMP IPC shared memory  | 
 | 41 | + | 
 | 42 | +config RPMSG_SERVICE_SHM_SIZE  | 
 | 43 | +	hex  | 
 | 44 | +	default "$(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_IPC_SHM))"  | 
 | 45 | +	help  | 
 | 46 | +	  This option specifies size of the memory region to be used  | 
 | 47 | +	  for the OpenAMP IPC shared memory  | 
 | 48 | + | 
 | 49 | +if RPMSG_SERVICE_SINGLE_IPM_SUPPORT  | 
 | 50 | + | 
 | 51 | +config RPMSG_SERVICE_IPM_NAME  | 
 | 52 | +	string  | 
 | 53 | +	default "$(dt_chosen_label,$(DT_CHOSEN_Z_IPC))"  | 
 | 54 | +	help  | 
 | 55 | +	  This option specifies the IPM device name to be used  | 
 | 56 | + | 
 | 57 | +endif # RPMSG_SERVICE_SINGLE_IPM_SUPPORT  | 
 | 58 | + | 
 | 59 | +if RPMSG_SERVICE_DUAL_IPM_SUPPORT  | 
 | 60 | + | 
 | 61 | +config RPMSG_SERVICE_IPM_TX_NAME  | 
 | 62 | +	string  | 
 | 63 | +	default "$(dt_chosen_label,$(DT_CHOSEN_Z_IPC_TX))"  | 
 | 64 | +	help  | 
 | 65 | +	  This option specifies the IPM device name to be used for  | 
 | 66 | +	  TX communication  | 
 | 67 | + | 
 | 68 | +config RPMSG_SERVICE_IPM_RX_NAME  | 
 | 69 | +	string  | 
 | 70 | +	default "$(dt_chosen_label,$(DT_CHOSEN_Z_IPC_RX))"  | 
 | 71 | +	help  | 
 | 72 | +	  This option specifies the IPM device name to be used for  | 
 | 73 | +	  RX communication  | 
 | 74 | + | 
 | 75 | +endif # RPMSG_SERVICE_DUAL_IPM_SUPPORT  | 
 | 76 | + | 
 | 77 | +choice RPMSG_SERVICE_MODE  | 
 | 78 | +	prompt "RPMsg Service mode"  | 
 | 79 | + | 
 | 80 | +config RPMSG_SERVICE_MODE_MASTER  | 
 | 81 | +	bool "RPMsg master"  | 
 | 82 | +	select OPENAMP_MASTER  | 
 | 83 | + | 
 | 84 | +config RPMSG_SERVICE_MODE_REMOTE  | 
 | 85 | +	bool "RPMsg remote"  | 
 | 86 | +	select OPENAMP_SLAVE  | 
 | 87 | + | 
 | 88 | +endchoice  | 
 | 89 | + | 
 | 90 | +config RPMSG_SERVICE_NUM_ENDPOINTS  | 
 | 91 | +	int "Max number of registered endpoints"  | 
 | 92 | +	default 2  | 
 | 93 | +	help  | 
 | 94 | +	  Maximal number of endpoints that can be registered for given  | 
 | 95 | +	  RPMsg service.  | 
 | 96 | + | 
 | 97 | +config RPMSG_SERVICE_WORK_QUEUE_STACK_SIZE  | 
 | 98 | +	int "Size of RX work queue stack"  | 
 | 99 | +	default 2048  | 
 | 100 | +	help  | 
 | 101 | +	  Size of stack used by work queue RX thread. This work queue is  | 
 | 102 | +	  created in the RPMsg Service backend module to prevent notifying  | 
 | 103 | +	  service users about received data from the system work queue.  | 
 | 104 | + | 
 | 105 | +config RPMSG_SERVICE_INIT_PRIORITY  | 
 | 106 | +	int "Initialization priority of RPMsg service"  | 
 | 107 | +	default 48  | 
 | 108 | +	help  | 
 | 109 | +	  The order of RPMsg Service initialization and endpoints registration  | 
 | 110 | +	  is important to avoid race conditions in RPMsg endpoints handshake.  | 
 | 111 | + | 
 | 112 | +	  If in doubt, do not modify this value.  | 
 | 113 | + | 
 | 114 | +config RPMSG_SERVICE_EP_REG_PRIORITY  | 
 | 115 | +	int "Initialization priority of modules registering RPMsg endpoints"  | 
 | 116 | +	default 47  | 
 | 117 | +	help  | 
 | 118 | +	  The endpoints must be registered before RPMsg Service is initialized.  | 
 | 119 | + | 
 | 120 | +	  If in doubt, do not modify this value.  | 
 | 121 | + | 
 | 122 | +endif # RPMSG_SERVICE  | 
0 commit comments