From patchwork Fri Jul 27 13:14:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Pallardy X-Patchwork-Id: 143052 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp806833ljj; Fri, 27 Jul 2018 06:15:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdBQXe7kUYj9Y6yetJqykUELDDksRW0qg8IjKSwW4gx1wGn4w4EM5UGhcBe2zjeYh+SuYBS X-Received: by 2002:a62:930c:: with SMTP id b12-v6mr6587299pfe.193.1532697334837; Fri, 27 Jul 2018 06:15:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532697334; cv=none; d=google.com; s=arc-20160816; b=DYgRn4PZXzb2g692Mqff6i+H8MMohU86D9R1QXF19g3GVIBidlld+ijeDCe+yCzF3i R8Avq3fXKzPaGnFB5jQdEiNvrhA8ZtAcACVgp5e4fG0KgEQxor5fkhaKjWJ1sh8Yp3bz /X/HnoVIeSubs51HsrFzkGlR9zqgUJyYTEQJv5j+0UvaggUTfnuqxeEHnCm59HDwnbcq O/Qhm0JQ9c1OwFLIbJIMY8AMH0uVhD4p5a2XJUi39flyVwZjN8JeEKty83hUUbRKsR0D ONRyX2HIdgQI+E+kQLId9aJfh95gs5KRdKVkh1BNNyn+7gzwUKupyze9S+bgG76LwqVR S4WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=SU6oL5C41eMdM75R/9RdopIvVstMgU/EmV4oKroYMGk=; b=j/NtywSaXHcGNaMc4ytok9N02DxzSGh4kQbEAZrD2lqgy2bpHaX50oHLvvlUhFUu/F IOorawBk24QkJz66p6b2NqNS1KqaQpqgTyywOGfKCfF/pxCJFehjkF3bcPWOqRX1Ohq2 UMm1UvvVllIRBrSc+ASuWBCElFxxLm2yBgRU8L0CRrjwD2ntfNkjs0ULTyds0l4DNtHH BG3wdn7S/ogJR8SpTVDB35SG/yYQfFLVh6ILikMHe2fXRLf1fOvGcI+5oEZ57RnLu26c z7hZ4m3FQKVoqPA7k3X9W6XsiJbWBnxs6J+TsM8CR4U5iUrsgI9d0RD8+PPLwJC9vH5p On1g== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m76-v6si3980007pfg.323.2018.07.27.06.15.34; Fri, 27 Jul 2018 06:15:34 -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 S2388651AbeG0OhZ (ORCPT + 31 others); Fri, 27 Jul 2018 10:37:25 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:11802 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388298AbeG0OhY (ORCPT ); Fri, 27 Jul 2018 10:37:24 -0400 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w6RDEjsr025001; Fri, 27 Jul 2018 15:15:24 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2kg1up0ns8-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 27 Jul 2018 15:15:24 +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 2DA6631; Fri, 27 Jul 2018 13:15:24 +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 156EB577A; Fri, 27 Jul 2018 13:15:24 +0000 (GMT) Received: from localhost (10.75.127.50) by SFHDAG7NODE2.st.com (10.75.127.20) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 27 Jul 2018 15:15:23 +0200 From: Loic Pallardy To: , CC: , , , , , Loic Pallardy Subject: [PATCH v4 06/17] remoteproc: introduce rproc_add_carveout function Date: Fri, 27 Jul 2018 15:14:41 +0200 Message-ID: <1532697292-14272-7-git-send-email-loic.pallardy@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1532697292-14272-1-git-send-email-loic.pallardy@st.com> References: <1532697292-14272-1-git-send-email-loic.pallardy@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.50] 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.10434:, , definitions=2018-07-27_06:, , signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch introduces a new API to allow platform driver to register platform specific carveout regions. Signed-off-by: Loic Pallardy Acked-by: Bjorn Andersson --- drivers/remoteproc/remoteproc_core.c | 16 +++++++++++++++- include/linux/remoteproc.h | 2 ++ 2 files changed, 17 insertions(+), 1 deletion(-) -- 1.9.1 diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index b76760e..fe6c4e4 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -747,7 +747,7 @@ static int rproc_handle_carveout(struct rproc *rproc, if (!carveout) goto free_carv; - list_add_tail(&carveout->node, &rproc->carveouts); + rproc_add_carveout(rproc, carveout); return 0; @@ -761,6 +761,20 @@ static int rproc_handle_carveout(struct rproc *rproc, } /** + * rproc_add_carveout() - register an allocated carveout region + * @rproc: rproc handle + * @mem: memory entry to register + * + * This function registers specified memory entry in @rproc carveouts list. + * Specified carveout should have been allocated before registering. + */ +void rproc_add_carveout(struct rproc *rproc, struct rproc_mem_entry *mem) +{ + list_add_tail(&mem->node, &rproc->carveouts); +} +EXPORT_SYMBOL(rproc_add_carveout); + +/** * rproc_mem_entry_init() - allocate and initialize rproc_mem_entry struct * @dev: pointer on device struct * @va: virtual address diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index 4bc961f..55f30fc 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -558,6 +558,8 @@ struct rproc *rproc_alloc(struct device *dev, const char *name, int rproc_del(struct rproc *rproc); void rproc_free(struct rproc *rproc); +void rproc_add_carveout(struct rproc *rproc, struct rproc_mem_entry *mem); + struct rproc_mem_entry * rproc_mem_entry_init(struct device *dev, void *va, dma_addr_t dma, int len, u32 da,