From patchwork Fri May 26 20:21:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Anna X-Patchwork-Id: 9751115 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 D7CC460246 for ; Fri, 26 May 2017 20:22:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C886827F90 for ; Fri, 26 May 2017 20:22:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB13C28347; Fri, 26 May 2017 20:22:35 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 42AC227F90 for ; Fri, 26 May 2017 20:22:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PAr2XIeuITWSQ2i9lEQ9OYx19ZiC6gibAu0PHDzEg+U=; b=OMsS0SiVo1bJD1 hShpCqbEiDLDSzJU4SNLyu5YDmiyo+l+nKhiWfDXZxPK3jApZ2lqv0GX4Wwwo++8iv2ltHSdjhill 535iDPPOLxb71oHY34qmqFt63SJa3aewJ4OdjACLuXWdZ0opgliE8lMguq+eiEqLUAs97rkWtBNhS 4Br26/pLuhFfjERXiT0rCWXRIjxwpAnQY2SCU3ECG5yS6tKS8Nz6y1oMBcJ9j86L5me6rqHhcUVla 2pGHaiRxMCoQkPRQtjPST/1CxfIj2mPdHhMjlLU/7h/MCnJuRlAU7qOCy5A7qg470wZPNmdZ8r09o 1MlW8CyTDb2S31M0cssA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dELko-0003oj-3M; Fri, 26 May 2017 20:22:34 +0000 Received: from fllnx210.ext.ti.com ([198.47.19.17]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dELka-00034N-O2 for linux-arm-kernel@lists.infradead.org; Fri, 26 May 2017 20:22:23 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id v4QKLqA8026120; Fri, 26 May 2017 15:21:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1495830112; bh=ZlCGJI1tFjeuN+nDBs05/OGceR5OxylCKvmlXDrkWHc=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=F6NVaU9q0spX4LULfTpqV2NxcnaE7sJJkSY4SMQbL/fhqXs19y7R+yG3Mzp2olt1i I2yO4BLo0UZx8elqE6Bq4ZPeg7Pw5YT5jIyCNbgfkFTDvmX6Q3sOgSfVkhjF5rcvHV YY7cF1jWHmLRT0kdaCYqAMxPrR8lOJYHRtwut5rY= Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id v4QKLqk7003976; Fri, 26 May 2017 15:21:52 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.294.0; Fri, 26 May 2017 15:21:51 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v4QKLp2n004021; Fri, 26 May 2017 15:21:51 -0500 Received: from localhost (irmo.dhcp.ti.com [128.247.58.167]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id v4QKLp327289; Fri, 26 May 2017 15:21:51 -0500 (CDT) From: Suman Anna To: Bjorn Andersson , Ohad Ben-Cohen , Rob Herring Subject: [PATCH 4/4] remoteproc/davinci: Add device tree support for OMAP-L138 DSP Date: Fri, 26 May 2017 15:21:40 -0500 Message-ID: <20170526202140.10472-5-s-anna@ti.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170526202140.10472-1-s-anna@ti.com> References: <20170526202140.10472-1-s-anna@ti.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170526_132221_114737_5615328D X-CRM114-Status: GOOD ( 12.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Robert Tivy , Sekhar Nori , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The Davinci remoteproc driver currently supports the DSP remoteproc device created in legacy-style on OMAP-L13x SoCs. The driver has been enhanced to support the DSP remoteproc device created through Device Tree now. The current DT support handles the C674x DSP processor subsystem on OMAP-L138 SoCs. Signed-off-by: Suman Anna --- drivers/remoteproc/da8xx_remoteproc.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/drivers/remoteproc/da8xx_remoteproc.c b/drivers/remoteproc/da8xx_remoteproc.c index 5250cc494775..02a4920d1af2 100644 --- a/drivers/remoteproc/da8xx_remoteproc.c +++ b/drivers/remoteproc/da8xx_remoteproc.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -272,10 +273,21 @@ static int da8xx_rproc_probe(struct platform_device *pdev) return PTR_ERR(dsp_clk); } + if (dev->of_node) { + ret = of_reserved_mem_device_init(dev); + if (ret) { + dev_err(dev, "device does not have specific CMA pool: %d\n", + ret); + return ret; + } + } + rproc = rproc_alloc(dev, "dsp", &da8xx_rproc_ops, da8xx_fw_name, sizeof(*drproc)); - if (!rproc) - return -ENOMEM; + if (!rproc) { + ret = -ENOMEM; + goto free_mem; + } drproc = rproc->priv; drproc->rproc = rproc; @@ -313,25 +325,37 @@ static int da8xx_rproc_probe(struct platform_device *pdev) free_rproc: rproc_free(rproc); - +free_mem: + if (dev->of_node) + of_reserved_mem_device_release(dev); return ret; } static int da8xx_rproc_remove(struct platform_device *pdev) { struct rproc *rproc = platform_get_drvdata(pdev); + struct device *dev = &pdev->dev; rproc_del(rproc); rproc_free(rproc); + if (dev->of_node) + of_reserved_mem_device_release(dev); return 0; } +static const struct of_device_id davinci_rproc_of_match[] = { + { .compatible = "ti,da850-dsp", }, + { /* sentinel */ }, +}; +MODULE_DEVICE_TABLE(of, davinci_rproc_of_match); + static struct platform_driver da8xx_rproc_driver = { .probe = da8xx_rproc_probe, .remove = da8xx_rproc_remove, .driver = { .name = "davinci-rproc", + .of_match_table = davinci_rproc_of_match, }, };