From patchwork Wed Apr 12 21:15:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jordan Crouse X-Patchwork-Id: 9678417 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 78A3E60383 for ; Wed, 12 Apr 2017 21:15:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 69E822864C for ; Wed, 12 Apr 2017 21:15:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5EC522864D; Wed, 12 Apr 2017 21:15:46 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0419B28649 for ; Wed, 12 Apr 2017 21:15:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 855C76E797; Wed, 12 Apr 2017 21:15:35 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp.codeaurora.org (smtp.codeaurora.org [198.145.29.96]) by gabe.freedesktop.org (Postfix) with ESMTPS id 808EA6E76F; Wed, 12 Apr 2017 21:15:28 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 6555160D3A; Wed, 12 Apr 2017 21:15:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1492031728; bh=zBt7xgN+8tpuEVps3xacX8UYSqm/VVOlMNICjRqUa4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AbrnHdObRuddrAfX3s6KfvumIyLi03+jUzlRLFt/CQl00tlFAuCtTSlcbEtM6LnEX eNPcej2yMemjvEFPsl385t/qoMRIgr/FUp1mIlPEYeAmZk9PF/h1B8qvZIJv+mAdZI 0kB9/b+zxwdW7lgD/xRFpQyI7v6aUkKuBUYdw2Ig= Received: from jcrouse-lnx.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jcrouse@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 6CB22607E6; Wed, 12 Apr 2017 21:15:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1492031727; bh=zBt7xgN+8tpuEVps3xacX8UYSqm/VVOlMNICjRqUa4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IZiFlVjq1XKXoKp5w2TFpOFSItWBAHs8iO0aR/fXSkcwihuB32vXGWRtcj0ZiyUjm E6OwWEMqcRdKYJouTI+32juif6icxF3i8FVcTt2D/LwEmjGNOcDia3462VvVs4bJE0 K2Gr1ObwMLAce/WUDGMvJrGGRMlVwbMwVC1+6YDQ= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 6CB22607E6 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=jcrouse@codeaurora.org From: Jordan Crouse To: freedreno@lists.freedesktop.org, dri-devel@lists.freedesktop.org, bjorn.andersson@linaro.org Subject: [PATCH 5/6] drm/msm: Move zap shader firmware name to the device table Date: Wed, 12 Apr 2017 15:15:17 -0600 Message-Id: <1492031718-28477-6-git-send-email-jcrouse@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1492031718-28477-1-git-send-email-jcrouse@codeaurora.org> References: <1492031718-28477-1-git-send-email-jcrouse@codeaurora.org> Cc: linux-arm-msm@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The zap shader firmware name is not platform specific. Move it to the device table instead. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 24 ++++++++++++------------ drivers/gpu/drm/msm/adreno/adreno_device.c | 1 + drivers/gpu/drm/msm/adreno/adreno_gpu.h | 1 + 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c index 8678bce..fc9a81a 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c @@ -82,10 +82,9 @@ static int zap_load_segments(struct device *dev, return ret; } -static int zap_load_mdt(struct device *dev) +static int zap_load_mdt(struct device *dev, const char *fwname) { char filename[64]; - const char *fwname; const struct elf32_hdr *ehdr; const struct elf32_phdr *phdrs; const struct firmware *mdt; @@ -101,13 +100,6 @@ static int zap_load_mdt(struct device *dev) return ret; } - /* Get the firmware and PAS id from the device node */ - if (of_property_read_string(dev->of_node, "qcom,firmware", - &fwname)) { - DRM_DEV_ERROR(dev, "Could not read a firmware name\n"); - return -EINVAL; - } - snprintf(filename, sizeof(filename), "%s.mdt", fwname); /* Request the MDT file for the firmware */ @@ -491,16 +483,24 @@ static int a5xx_zap_shader_init(struct msm_gpu *gpu) if (loaded) return a5xx_zap_shader_resume(gpu); + /* We need SCM to be able to load the firmware */ if (!qcom_scm_is_available()) { DRM_DEV_ERROR(&pdev->dev, "SCM is not available\n"); return -EPROBE_DEFER; } + /* Each GPU has a target specific zap shader firmware name to use */ + if (!adreno_gpu->info->zapfw) { + DRM_DEV_ERROR(&pdev->dev, + "Zap shader firmware file not specified for this target\n"); + return -ENODEV; + } + /* Find the sub-node for the zap shader */ node = of_get_child_by_name(pdev->dev.of_node, "zap-shader"); if (!node) { - DRM_ERROR("%s: zap-shader not found in device tree\n", - gpu->name); + DRM_DEV_ERROR(&pdev->dev, + "zap-shader not found in device tree\n"); return -ENODEV; } @@ -520,7 +520,7 @@ static int a5xx_zap_shader_init(struct msm_gpu *gpu) } } - ret = zap_load_mdt(&a5xx_gpu->zap_dev); + ret = zap_load_mdt(&a5xx_gpu->zap_dev, adreno_gpu->info->zapfw); loaded = !ret; diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c b/drivers/gpu/drm/msm/adreno/adreno_device.c index c0fa5d1..6118b10 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_device.c +++ b/drivers/gpu/drm/msm/adreno/adreno_device.c @@ -86,6 +86,7 @@ ADRENO_QUIRK_FAULT_DETECT_MASK, .init = a5xx_gpu_init, .gpmufw = "a530v3_gpmu.fw2", + .zapfw = "a530_zap", }, }; diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h b/drivers/gpu/drm/msm/adreno/adreno_gpu.h index fb4831f..12b1483 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h @@ -77,6 +77,7 @@ struct adreno_info { uint32_t gmem; enum adreno_quirks quirks; struct msm_gpu *(*init)(struct drm_device *dev); + const char *zapfw; }; const struct adreno_info *adreno_info(struct adreno_rev rev);