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: 9729735 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 D052360386 for ; Tue, 16 May 2017 22:14:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C155A28769 for ; Tue, 16 May 2017 22:14:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B2BF228A01; Tue, 16 May 2017 22:14:29 +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 66D1328769 for ; Tue, 16 May 2017 22:14:29 +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=UkGQHLeOO4Tj4/yn1YkoZN7YEJ4FE5OGxGs0FEDPf/0=; b=bNvERYhmlyiFsg ALv+ibnJjyYnpI6NynUPWh0c8CDdCyVqGEHfr0//OXPjDLmD5REfvSS0utHXUwg1ipy4qxPV2o7l0 UXg2MwzcS2PZO6SYaSZhZdrPdXbxdOjmmcPMQ/c5PImAGOObCsJB5CqpPzl6yYkKJqTcNY4LPhMZm YDxk7rXqmKgPEk/AW+oIR8YzGX0F+QPW5krz4MwFmA3NeejNW0Gh0a9p26VuDHV5smRD+mJDDU32B GLGNTg4fXBcZ3R6I85BGphLoQ/xw23dS3MKqMwdKR4c2vEiGZ453bjz98zB/AxfxsjDp0moXh2Can gTnpdNCes1QUbgJGoH2g==; 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 1dAkjc-0006Ha-SR; Tue, 16 May 2017 22:14:28 +0000 Received: from lelnx194.ext.ti.com ([198.47.27.80]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dAkjQ-000625-FD for linux-arm-kernel@lists.infradead.org; Tue, 16 May 2017 22:14:18 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170516_151416_664410_FC28719D X-CRM114-Status: UNSURE ( 9.75 ) X-CRM114-Notice: Please train this message. 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: 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 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(+) 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);