From patchwork Wed Dec 7 20:35:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic PALLARDY X-Patchwork-Id: 9465207 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5CC3560512 for ; Wed, 7 Dec 2016 20:36:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F80528427 for ; Wed, 7 Dec 2016 20:36:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5426B2855E; Wed, 7 Dec 2016 20:36:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D4A4B28427 for ; Wed, 7 Dec 2016 20:36:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932673AbcLGUgs (ORCPT ); Wed, 7 Dec 2016 15:36:48 -0500 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:6167 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932561AbcLGUgs (ORCPT ); Wed, 7 Dec 2016 15:36:48 -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 uB7KZsb8017603; Wed, 7 Dec 2016 21:36:45 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-.pphosted.com with ESMTP id 276fdduet1-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 07 Dec 2016 21:36:45 +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 700C031; Wed, 7 Dec 2016 20:36:44 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas21.st.com [10.75.90.44]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 5CB0A4EB5; Wed, 7 Dec 2016 20:36:44 +0000 (GMT) Received: from localhost (10.129.5.76) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.294.0; Wed, 7 Dec 2016 21:36:43 +0100 From: Loic Pallardy To: , , , CC: , , Subject: [PATCH v1 3/6] include: virtio_rpmsg: add virtio rpmsg configuration structure Date: Wed, 7 Dec 2016 21:35:38 +0100 Message-ID: <1481142941-15616-4-git-send-email-loic.pallardy@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1481142941-15616-1-git-send-email-loic.pallardy@st.com> References: <1481142941-15616-1-git-send-email-loic.pallardy@st.com> MIME-Version: 1.0 X-Originating-IP: [10.129.5.76] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-12-07_06:, , signatures=0 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- include/linux/rpmsg/virtio_rpmsg.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 include/linux/rpmsg/virtio_rpmsg.h 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