Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1059238pxk; Mon, 31 Aug 2020 08:43:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiwwUpmyPJap3nDkkfrLlNPrCZvAnwaVEv1lQZ6AOtN2kkuCTqK52NjjUGR3VDVQuI4vm5 X-Received: by 2002:a50:a693:: with SMTP id e19mr1701272edc.205.1598888594821; Mon, 31 Aug 2020 08:43:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598888594; cv=none; d=google.com; s=arc-20160816; b=a0tTeUHA5bf2qcf2tsN9OnKxQuNNi0QiAVVx5vLT4XDxew2GrGKyif666IcdQGdFev NU2siC2CxHwSwWzjRdHTWBfP1wWZjopbo/VCyPxckHEPHbQwyu7b/z7vRZQ0sAIZZbC+ pLwaTgIGSImIO4Nm2RT0NaL7zmC8ROXuewoc4QvKefkLoTxthxlLb+dfZYY1tIQuLR5J 1fFfK/wb+oQfyIJqGKe6DWj1o1mo8Dof7oRzE3n1RN8YUNKYWuVUVYwLnyy9H6km9Hny fEENNoTDDkU14XjlsrgvCYuz3vJrlOkG58ToMlzifJz4qag/iWbJXp1velSZg0PLy5M4 HDQQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=H1Z4ygHoMbQp3sfW9liXKqbHAuEHVagOC1DZRpxvWIM=; b=FbcgHuxIFucZPQvTOYMp1jFPphY0ddgIfIGOEfDp1fW2MGhAcnJpWR1azLo77N0E1M t9kL2VS3SEk6qXy5iX8A4bOVH/LudwpR80O0RZuduS4s3Ldgrj2rQ37cAtZ0qm+nOooQ sXUfCCs21yPZO9C1nKRvVaeLpAuxoyuFFr/Dj70cu2ghPb0xzADLUF8Ibxz5NIsZqV7A lamDg8NaNbCAJ9uEQmtQm7y7mtj3Huzmv9a/CAdHkINPnUQdMr2fadeFvdiYlX9drLM/ FU9VtOrP6hZj6cryrIoOrwzxmaDwRsbEzCnOJYTCLFeQAHeqqLsgl/Q5+kNgNaeUY/qD g5+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SBdQvUHf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v9si5798678ejy.486.2020.08.31.08.42.52; Mon, 31 Aug 2020 08:43:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@kernel.org header.s=default header.b=SBdQvUHf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729390AbgHaPjf (ORCPT + 99 others); Mon, 31 Aug 2020 11:39:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:39300 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728498AbgHaPaH (ORCPT ); Mon, 31 Aug 2020 11:30:07 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4F760214DB; Mon, 31 Aug 2020 15:30:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598887806; bh=E0S5fTo0mX+8r5130quZXaxIlSmWMKiZqSWg4n8H/MU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SBdQvUHfyHBTyHOaW2nFffb4wFfwYa71b+Y8/Jq3gSLZ4B5OXmcTW0nEar37ry+6Z E/jUKETzywemRvIW/SY78HU4fWd2kE0hadAeBtBFYs/dPCFaPDqVTZWZgpxUP8lXhc rpFKkaBJklgI/fKfLEURQRurdMtszdP2+JXJjCOY= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dmitry Baryshkov , Rob Clark , Sasha Levin , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.8 21/42] drm/msm/a6xx: fix gmu start on newer firmware Date: Mon, 31 Aug 2020 11:29:13 -0400 Message-Id: <20200831152934.1023912-21-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200831152934.1023912-1-sashal@kernel.org> References: <20200831152934.1023912-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dmitry Baryshkov [ Upstream commit f5749d6181fa7df5ae741788e5d96f593d3a60b6 ] New Qualcomm firmware has changed a way it reports back the 'started' event. Support new register values. Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c index 1d330204c465c..2dd1cf1ffbe25 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c @@ -207,6 +207,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); @@ -218,7 +228,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"); -- 2.25.1