From patchwork Thu Aug 20 09:36:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 248037 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp1351315ils; Thu, 20 Aug 2020 06:14:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1h5YsvfkCIkvWL8XGQJ0e8VQBTJEVRF915IjvSJmPMirKsOqlMxCoNwGSss7YbjijgZXo X-Received: by 2002:a17:906:ccda:: with SMTP id ot26mr3241615ejb.389.1597929254942; Thu, 20 Aug 2020 06:14:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597929254; cv=none; d=google.com; s=arc-20160816; b=pLs2bujASRcoD+k+9Z0ynKf0tU8fVVpb/qU6z5CRnJRM0LGNbEFTmSzHAjVaXHvDLW ZK9SuucMT1+bvARAF6kw+tElgnj4U9PDqxjka7yip4017nSYqRZYffVTDxs+GZRVjtR7 ZYBVCn/DI+OXQjsTkfbHFskrDdi3MrW+s45nkOUgs79znBXqK2BRUAT145hMACpG2H/W +QVNNSqmYuLzj+vNjCx4IRyo85N1RRqY5cUs3ItpzFf9N6KzZWYP4TG7YeeIX42xiqAX 7C21NrGn5fILnel2woZgUjEve2ArYiWdTAAAjjwTPK+TmEZyWVgofiq+7ubUUyV4G4No zIsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=iyIFHI/GagIm4is2IjKR4dFCd2u6tmF485sTbdWxVbM=; b=ucKAM+kkKunMe7HTq5zGRy+WjfMUMQK8SfSBbm0vtTMXVOWLDPpKJmGmY5ZKLrzCfj bXqLVRRPUSihQQq2IhDyn+mx4X6emGO+KtHJSKN8ujhQwnLbC1ePYa0ofUQ2HtczS7cd 2CadsSpIjg9Ifi91B2MpumAnTO8YnoltKMvdlJlXXZu4dOVlO8QJuTOC7JRi1QmS3QCM qhk8qgHOFtdQSA/m9HuGEXGVjlMZb0wdRaImBD+A45aO+k1uA+fLKdYJX9iVscfdlDcw 01x9aHQ1rBF5ClO6qygyBd2ehKjZjecF4dbxOdg4PReLulh8Hr2f1Cqz5y6PC77M9/07 +SLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MLkiiqpT; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fx20si1184143ejb.581.2020.08.20.06.14.14; Thu, 20 Aug 2020 06:14:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MLkiiqpT; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729007AbgHTNOM (ORCPT + 15 others); Thu, 20 Aug 2020 09:14:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728417AbgHTJg0 (ORCPT ); Thu, 20 Aug 2020 05:36:26 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EDF6C061757 for ; Thu, 20 Aug 2020 02:36:26 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id w14so1348178ljj.4 for ; Thu, 20 Aug 2020 02:36:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=iyIFHI/GagIm4is2IjKR4dFCd2u6tmF485sTbdWxVbM=; b=MLkiiqpTIK0T8bIG8a7cw3MlTUto09mHqhVzUWPfnkk4OxAgoe4yk5RS+KzyPkc0rV fSzxXaaHo2Ohq+lyWw4WVH93TRgv0UhPZUicHg09AtCULq+HW79090fk/I68wSIlGQG2 2YPoUJB+09rDM1BounEJ/4DbnRsg71ly86n0zyynHqByO23KsJ1MgRQ/VchwqV4iuXtR EPP+1nsst3H0kTK7jgtwccEi40dav3czNwj4Djj7S330dhKMPaA5ZW7WUY6bzUnGclve uVQdReKKsIlH6FcLOEOc27TBBv89loXlhqZcWAYQOMFu+5mX+RGolF/sT/kU6WzuEh1Z mtCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=iyIFHI/GagIm4is2IjKR4dFCd2u6tmF485sTbdWxVbM=; b=szyYNUq67pK4qNjG5NVhCYk8y+TCuCSNG6TLJ8NDhfLHJjnAeHlnQbzuCY9h7b0Huo mVxTPefQSUVbD9XokfxvjkBZVjerViLk0vDy5psLGxF7J8FnmhFaRJmg44qpnKRfAdcw PdDufDt0d5DgEiOe7PhGtShCG25RpiNknXvuWcD6s6NE8XwBtuECTrNyZ+yutyKgUOhx o1pgYOYgSQu99o51dMUFileBnkeosnUJ9u51JKNThlbtzuJC0LZOGcTaG/+txuB8PhFF yi0xPBKRzz6dP/PTGs8A7n+qe/sx27MSrXzrBfET8fdduJXuUu4W7uZOJkz50qfpLDEP iPrQ== X-Gm-Message-State: AOAM532765YTaJ3/Xc6yjcWJvhMd1j/iEsWekHa7kDLa0e31uMSgWyvx gSyyZCt/0VRvgUeEoCZOcJd4cdgbgaNelg== X-Received: by 2002:a2e:71a:: with SMTP id 26mr1262048ljh.198.1597916184580; Thu, 20 Aug 2020 02:36:24 -0700 (PDT) Received: from eriador.lan ([188.162.65.245]) by smtp.gmail.com with ESMTPSA id o1sm341811ljc.3.2020.08.20.02.36.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Aug 2020 02:36:23 -0700 (PDT) From: Dmitry Baryshkov To: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Cc: Rob Clark , Sean Paul Subject: [PATCH] drm/msm/a6xx: fix gmu start on newer firmware Date: Thu, 20 Aug 2020 12:36:22 +0300 Message-Id: <20200820093622.3801751-1-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org New Qualcomm firmware has changed a way it reports back the 'started' event. Support new register values. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) -- 2.28.0 diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c index b67b38c8fadf..0df56292e227 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c @@ -204,6 +204,16 @@ static int a6xx_gmu_start(struct a6xx_gmu *gmu) { int ret; u32 val; + u32 mask, reset_val; + + val = gmu_read(gmu, REG_A6XX_GMU_CM3_DTCM_START + 0xff8); + if (val <= 0x20010004) { + mask = 0xffffffff; + reset_val = 0xbabeface; + } else { + mask = 0x1ff; + reset_val = 0x100; + } gmu_write(gmu, REG_A6XX_GMU_CM3_SYSRESET, 1); @@ -215,7 +225,7 @@ static int a6xx_gmu_start(struct a6xx_gmu *gmu) gmu_write(gmu, REG_A6XX_GMU_CM3_SYSRESET, 0); ret = gmu_poll_timeout(gmu, REG_A6XX_GMU_CM3_FW_INIT_RESULT, val, - val == 0xbabeface, 100, 10000); + (val & mask) == reset_val, 100, 10000); if (ret) DRM_DEV_ERROR(gmu->dev, "GMU firmware initialization timed out\n");