From patchwork Tue Jan 31 12:51:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Pallardy X-Patchwork-Id: 92975 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1910285qgi; Tue, 31 Jan 2017 04:57:20 -0800 (PST) X-Received: by 10.99.177.6 with SMTP id r6mr30012042pgf.61.1485867440605; Tue, 31 Jan 2017 04:57:20 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 9si15816876pfp.297.2017.01.31.04.57.20; Tue, 31 Jan 2017 04:57:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752117AbdAaM5H (ORCPT + 25 others); Tue, 31 Jan 2017 07:57:07 -0500 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:47389 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751922AbdAaM4f (ORCPT ); Tue, 31 Jan 2017 07:56:35 -0500 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id v0VCtpX8008590; Tue, 31 Jan 2017 13:55:51 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-.pphosted.com with ESMTP id 288ha8ybht-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 31 Jan 2017 13:55:51 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 7B0503A; Tue, 31 Jan 2017 12:55:49 +0000 (GMT) Received: from Webmail-eu.st.com (safex1hubcas4.st.com [10.75.90.69]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 5CB002AFB; Tue, 31 Jan 2017 12:55:49 +0000 (GMT) Received: from localhost (10.201.23.23) by webmail-eu.st.com (10.75.90.13) with Microsoft SMTP Server (TLS) id 8.3.444.0; Tue, 31 Jan 2017 13:55:48 +0100 From: Loic Pallardy To: , , CC: , , , , , , Subject: [PATCH v2 3/6] include: virtio_rpmsg: add virtio rpmsg configuration structure Date: Tue, 31 Jan 2017 13:51:34 +0100 Message-ID: <1485867097-6960-4-git-send-email-loic.pallardy@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1485867097-6960-1-git-send-email-loic.pallardy@st.com> References: <1485867097-6960-1-git-send-email-loic.pallardy@st.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-01-31_05:, , signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rpmsg channel configuration should be identical on host and coprocessor side. This patch proposes a new structure named struct virtio_rpmsg_cfg to gather all configuration information to characterize the communication link and. This structure will be exchanged with coprocessor via the resource table, expanding struct fw_rsc_vdev. It will guarantee that host and coprocessor will share the same information. virtio_rpmsg will access it thanks to virtio get and set features. Presence of struct virtio_rpmsg_cfg is optional. Signed-off-by: Loic Pallardy --- No change since V1 --- include/linux/rpmsg/virtio_rpmsg.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 include/linux/rpmsg/virtio_rpmsg.h -- 1.9.1 diff --git a/include/linux/rpmsg/virtio_rpmsg.h b/include/linux/rpmsg/virtio_rpmsg.h new file mode 100644 index 0000000..5f3f0d0 --- /dev/null +++ b/include/linux/rpmsg/virtio_rpmsg.h @@ -0,0 +1,32 @@ + +#ifndef _LINUX_VIRTIO_RPMSG_H +#define _LINUX_VIRTIO_RPMSG_H + +/* Offset in struct fw_rsc_vdev */ +#define RPMSG_CONFIG_OFFSET 0 + +/** + * struct virtio_rpmsg_cfg - optional configuration field for virtio rpmsg + * provided at probe time by virtio (get/set) + * @id: virtio cfg id (as in virtio_ids.h) + * @version: virtio_rpmsg_cfg structure version number + * @va: virtual address (used when buffer allocated by low level driver) + * @da: device address + * @pa: physical address + * @len: length (in bytes) + * @buf_size: size of rpmsg buffer size (defined by firmware else default value + * used) + * @reserved: reserved (must be zero) + */ +struct virtio_rpmsg_cfg { + u32 id; + u32 version; + u64 va; + u32 da; + u32 pa; + u32 len; + u32 buf_size; + u32 reserved; +} __packed; + +#endif