From patchwork Wed Aug 31 20:50:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic PALLARDY X-Patchwork-Id: 9307849 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 8E85460487 for ; Wed, 31 Aug 2016 20:55:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8094928F58 for ; Wed, 31 Aug 2016 20:55:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 73FA629036; Wed, 31 Aug 2016 20:55:08 +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 EB32928F58 for ; Wed, 31 Aug 2016 20:55:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760016AbcHaUyy (ORCPT ); Wed, 31 Aug 2016 16:54:54 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:59527 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933351AbcHaUvS (ORCPT ); Wed, 31 Aug 2016 16:51:18 -0400 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u7VKnJ7j015771; Wed, 31 Aug 2016 22:51:15 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-.pphosted.com with ESMTP id 255btkb8ew-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 31 Aug 2016 22:51:15 +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 695BC31; Wed, 31 Aug 2016 20:51:14 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas23.st.com [10.75.90.46]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 4DE8C50E2; Wed, 31 Aug 2016 20:51:14 +0000 (GMT) Received: from localhost (10.129.5.21) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.279.2; Wed, 31 Aug 2016 22:51:13 +0200 From: Loic Pallardy To: , , CC: , , , Subject: [PATCH v2 07/19] remoteproc: Add new resource type for resource table spare bytes Date: Wed, 31 Aug 2016 22:50:10 +0200 Message-ID: <1472676622-32533-8-git-send-email-loic.pallardy@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1472676622-32533-1-git-send-email-loic.pallardy@st.com> References: <1472676622-32533-1-git-send-email-loic.pallardy@st.com> MIME-Version: 1.0 X-Originating-IP: [10.129.5.21] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-08-31_04:, , 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 To allow resource appending to an existing resource table, remoteproc framework should get information about resource table spare area. With current resource table construction, remoteproc is not able to identify by itself any free location. This patch introduces a new resource type named RSC_SPARE which allows firmware to define room for resource table extension. Defined spare area will be used by remtoreproc to extend resource table. Signed-off-by: Loic Pallardy --- include/linux/remoteproc.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index d0c0793..4e2f822 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -100,6 +100,7 @@ struct fw_rsc_hdr { * the remote processor will be writing logs. * @RSC_VDEV: declare support for a virtio device, and serve as its * virtio header. + * @RSC_SPARE: spare area in resource table for resource appending * @RSC_LAST: just keep this one at the end * * For more details regarding a specific resource type, please see its @@ -115,7 +116,8 @@ enum fw_resource_type { RSC_DEVMEM = 1, RSC_TRACE = 2, RSC_VDEV = 3, - RSC_LAST = 4, + RSC_SPARE = 4, + RSC_LAST = 5, }; #define FW_RSC_ADDR_ANY (0xFFFFFFFFFFFFFFFF) @@ -306,6 +308,15 @@ struct fw_rsc_vdev { } __packed; /** + * struct fw_rsc_spare - resource table spare area definition + * @len: length of spare area in byte + */ +struct fw_rsc_spare { + u32 len; + u8 spare_bytes[0]; +} __packed; + +/** * struct rproc_mem_entry - memory entry descriptor * @va: virtual address * @dma: dma address