From patchwork Tue May 16 22:13:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Anna X-Patchwork-Id: 99894 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp2232403qge; Tue, 16 May 2017 15:14:31 -0700 (PDT) X-Received: by 10.84.224.77 with SMTP id a13mr297695plt.132.1494972871750; Tue, 16 May 2017 15:14:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494972871; cv=none; d=google.com; s=arc-20160816; b=auw5whY8JcjjUfr4KqYbvRg8bz3jdhGDz2/s0YEqQiedur/JnwwaYxJugqgUDb4RPt y59wO8AlB66rNnQMR0RqgAdRs9kp3rLNtzwvZOadHVNv3FelKsWaPaeVwoWsn9EnXw5W NhboR8Qw1X3tb5H89kXyot425KehywtopPPzUEXIHmDFWXAqDtsL7mmlmNNDVnCgRDMK zDDecvw0OBN1gjsPMVpu6kpm7xUFHTdKOlAYajPPBvarF0x8M0lTd4FWSZGWyTuCPgxC lm9khpSG9OBSCpqhAWwTiNivAHiVXB92D3TQTeYB5rFnBHgtAcQVD/zbYQd0CUBNC4qh m1LQ== 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:dkim-signature :arc-authentication-results; bh=Yb14hDHl1hArJS7qi76VF1+gCqwngyymBK9CzM8A78Q=; b=Wo1Dq4oUxY7e8vlWmwC4Xl2ppHBTHZDN6LvruJxoYiVDBF78xW7WC1zLmNEbD1S6SW AowbQEw4P4SetJXHK9NmO8wNgbBCy9F3jnmnte0w6l1DKgX/aSAeOEExQSEwxiR0lnCU BBmXmLAivlIzZFmwgPyrXeZQUQAhouOsC0EmhluRRuQ4nWYW4IBptY+OI/z6RZtY13Tx taRL6Ix7D7GE4YgHzIPX5OzjqPfvxoi3+8V0+zIN7BsJJV2uGbpMJvlgBtmyghIeHBWx g3zWIDYt94paVrjIDPilnex0a+VRkQzozpYPQnQepyXwMRAQLBFzXrxlp3p/u2OKCJhV GA7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u72si131103pfk.60.2017.05.16.15.14.31; Tue, 16 May 2017 15:14:31 -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; dkim=pass header.i=@ti.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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753566AbdEPWOZ (ORCPT + 25 others); Tue, 16 May 2017 18:14:25 -0400 Received: from lelnx194.ext.ti.com ([198.47.27.80]:63056 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753095AbdEPWOT (ORCPT ); Tue, 16 May 2017 18:14:19 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id v4GMDsqp021573; Tue, 16 May 2017 17:13:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1494972834; bh=/4WY0v9eNlDnQR3TTSx8rhPEMTzjSEevYtoBSmKc7ts=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=AFsVtjlzMART7Ztrp9KIUyZemRfpqPki55XbeXUsxwqlXtONpjplSktvY0bLI4DJ9 z3MeiTbcYmPfo21mui9l+YRNSWfUugZAibRYPgOmw4yRNg5r5dBI5Lp0vQ3mKMB8hg gopATInwTE8ZZCmx0FZvUWJXE+VuTkvDoD9ZcwSk= Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v4GMDrFT021721; Tue, 16 May 2017 17:13:54 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.294.0; Tue, 16 May 2017 17:13:53 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id v4GMDrjf021496; Tue, 16 May 2017 17:13:53 -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 v4GMDr323272; Tue, 16 May 2017 17:13:53 -0500 (CDT) From: Suman Anna To: Sekhar Nori , Kevin Hilman CC: , , Suman Anna Subject: [PATCH 1/3] ARM: davinci: da8xx: Create DSP device only when assigned memory Date: Tue, 16 May 2017 17:13:45 -0500 Message-ID: <20170516221347.37990-2-s-anna@ti.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170516221347.37990-1-s-anna@ti.com> References: <20170516221347.37990-1-s-anna@ti.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The DSP device on Davinci platforms does not have an MMU and requires specific DDR memory to boot. This memory is reserved using the rproc_mem kernel boot parameter and is assigned to the device on non-DT boots. The remoteproc core uses the DMA API and so will fall back to assigning random memory if this memory is not assigned to the device, but the DSP remote processor boot will not be successful in such cases. So, check that memory has been reserved and assigned to the device specifically before even creating the DSP device. Signed-off-by: Suman Anna --- arch/arm/mach-davinci/devices-da8xx.c | 10 ++++++++++ 1 file changed, 10 insertions(+) -- 2.12.0 diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c index 7cf529ffbe5a..1ccf52e49886 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c @@ -814,6 +814,8 @@ static struct platform_device da8xx_dsp = { .resource = da8xx_rproc_resources, }; +static bool rproc_mem_inited __initdata; + #if IS_ENABLED(CONFIG_DA8XX_REMOTEPROC) static phys_addr_t rproc_base __initdata; @@ -852,6 +854,8 @@ void __init da8xx_rproc_reserve_cma(void) ret = dma_declare_contiguous(&da8xx_dsp.dev, rproc_size, rproc_base, 0); if (ret) pr_err("%s: dma_declare_contiguous failed %d\n", __func__, ret); + else + rproc_mem_inited = true; } #else @@ -866,6 +870,12 @@ int __init da8xx_register_rproc(void) { int ret; + if (!rproc_mem_inited) { + pr_warn("%s: memory not reserved for DSP, not registering DSP device\n", + __func__); + return -ENOMEM; + } + ret = platform_device_register(&da8xx_dsp); if (ret) pr_err("%s: can't register DSP device: %d\n", __func__, ret);