From patchwork Tue Mar 28 11:49:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Pallardy X-Patchwork-Id: 96147 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp1671243qgd; Tue, 28 Mar 2017 04:52:50 -0700 (PDT) X-Received: by 10.84.225.146 with SMTP id u18mr11359610plj.86.1490701969974; Tue, 28 Mar 2017 04:52:49 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c9si3987886pge.334.2017.03.28.04.52.49; Tue, 28 Mar 2017 04:52:49 -0700 (PDT) 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 S1751969AbdC1LwJ (ORCPT + 18 others); Tue, 28 Mar 2017 07:52:09 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:1294 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751553AbdC1LwH (ORCPT ); Tue, 28 Mar 2017 07:52:07 -0400 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by m0046037.ppops.net (8.16.0.11/8.16.0.11) with SMTP id v2SBnisv015466; Tue, 28 Mar 2017 13:50:00 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-.pphosted.com with ESMTP id 29dm9kg27b-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 28 Mar 2017 13:50:00 +0200 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 7173A34; Tue, 28 Mar 2017 11:49:59 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag7node2.st.com [10.75.127.20]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 5CFD72945; Tue, 28 Mar 2017 11:49:59 +0000 (GMT) Received: from localhost (10.75.127.48) by SFHDAG7NODE2.st.com (10.75.127.20) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Tue, 28 Mar 2017 13:49:58 +0200 From: Loic Pallardy To: , , CC: , , , , , Subject: [PATCH v4 3/5] include: virtio_rpmsg: add virtio rpmsg configuration structure Date: Tue, 28 Mar 2017 13:49:45 +0200 Message-ID: <1490701787-15205-4-git-send-email-loic.pallardy@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1490701787-15205-1-git-send-email-loic.pallardy@st.com> References: <1490701787-15205-1-git-send-email-loic.pallardy@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.48] X-ClientProxiedBy: SFHDAG8NODE3.st.com (10.75.127.24) To SFHDAG7NODE2.st.com (10.75.127.20) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-03-28_10:, , 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 --- Changes since V3: - remove va field from struct virtio_rpmsg_cfg --- include/linux/rpmsg/virtio_rpmsg.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 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..2d31636 --- /dev/null +++ b/include/linux/rpmsg/virtio_rpmsg.h @@ -0,0 +1,30 @@ + +#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 + * @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; + u32 da; + u32 pa; + u32 len; + u32 buf_size; + u32 reserved; +} __packed; + +#endif