From patchwork Thu Mar 1 16:23:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Pallardy X-Patchwork-Id: 130332 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp3007236edc; Thu, 1 Mar 2018 08:27:09 -0800 (PST) X-Google-Smtp-Source: AG47ELtr6Bpdh3YlSrTa3OBPB5CDpp8zWXPFuzoosVDhq4E1gpTMvAgDZWyPc3UIIq6rfXEzl7a8 X-Received: by 10.99.99.2 with SMTP id x2mr2012817pgb.406.1519921629767; Thu, 01 Mar 2018 08:27:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519921629; cv=none; d=google.com; s=arc-20160816; b=ONYHnPMNGIul2eXqqZfYgSx1o017Fh4UqSNJFH9gUxa27fmEGSYSl8bb7uwNDWb4kY V2NPgSEAe/DrXZGkvuPuzCKesH/E+3kuPR6Ncdlw3kV0/vm9Xz+yQntMjTRiYk9MKmjp tpv+RF8BXF8uNpPwt3E7GyEIPj5wesvO3/5EB7AGK7iA7P3De3SB6S6cfl3zxdGZxWE2 UeuklQnc0AolYGS7n489OeqEdEVr+IY8EAeD8k/RpKSORUxbT5U7U9oFl59LqBWFMKUZ Xah8ZHPGjNC3XPq20xtTXTggnG/91qXytyEe23UilUnwLgKhq1ZaUQpCSII70FrEzpTP VwOg== 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=lh47TjiOe3oFNa5M+BasTuWi//cPNhXuYMNec9gJZGY=; b=E8k9CoBAUDh7MjImM2P/sLYrz1zX7x2ObFpidKZc2iQDM/l5EpWUrc8DqSQptgkfj+ 58nKGIcetBNr01WhBIeoXAKVvsFD79DMFWpq/1QcIqyBd2FPrFBKY6SCjb0A3vLyzvvh OtCvpXJJE9Rn9IRjJ66avb+3qwNqfVsmKLgxottg9STazTiI0HLECiD7MXkSSgbi5Ad1 cGs07lFGhu9/8WtppjBgLAcha/+twaCQe53QE53VdItSftxh11K4o3Dnm78pFwRp4GSU 8vPhfl2fu2QXK9apswi2nTCMn5gdCkMCtasv1TLkrHPFQwcbLe2mp3I59mkMeSRdLCDv KUFg== 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 o6-v6si879364pls.583.2018.03.01.08.27.09; Thu, 01 Mar 2018 08:27:09 -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 S1033074AbeCAQ1H (ORCPT + 28 others); Thu, 1 Mar 2018 11:27:07 -0500 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:31503 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032975AbeCAQYR (ORCPT ); Thu, 1 Mar 2018 11:24:17 -0500 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w21GJQYY025446; Thu, 1 Mar 2018 17:24:15 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2gax28ujkh-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 01 Mar 2018 17:24:15 +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 E2FA438; Thu, 1 Mar 2018 16:24:14 +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 BF5F45200; Thu, 1 Mar 2018 16:24:14 +0000 (GMT) Received: from localhost (10.75.127.44) by SFHDAG7NODE2.st.com (10.75.127.20) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Thu, 1 Mar 2018 17:24:14 +0100 From: Loic Pallardy To: , CC: , , , , Loic Pallardy Subject: [PATCH v3 06/13] remoteproc: introduce rproc_add_carveout function Date: Thu, 1 Mar 2018 17:23:53 +0100 Message-ID: <1519921440-21356-7-git-send-email-loic.pallardy@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1519921440-21356-1-git-send-email-loic.pallardy@st.com> References: <1519921440-21356-1-git-send-email-loic.pallardy@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.44] X-ClientProxiedBy: SFHDAG1NODE3.st.com (10.75.127.3) To SFHDAG7NODE2.st.com (10.75.127.20) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-01_08:, , 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 --- drivers/remoteproc/remoteproc_core.c | 14 ++++++++++++++ include/linux/remoteproc.h | 2 ++ 2 files changed, 16 insertions(+) -- 1.9.1 Acked-by: Bjorn Andersson diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 4c92b7d..91aa22b 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -758,6 +758,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 59b60f1..4aa30bd 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -536,6 +536,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, int (*release)(struct rproc *, struct rproc_mem_entry *),