From patchwork Thu Dec 19 22:36:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13915909 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4AA3386337; Thu, 19 Dec 2024 22:37:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734647837; cv=none; b=HwkXYIvMK6xX/N6PclxJ97q+fy00P+I6yhAFfDfntOQ15GulccGCksX6iqRcdK93ksKN17yl0y1CwpIQpwm3hOh1F6zNhJGs512d2kWS1PlkYxH2ebd5cfiJbj4xwTIbOs7JBsh9a5yIW0uke8cjfW0kZU29DU1EmTy5ai+VhRk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734647837; c=relaxed/simple; bh=5JceoXzU5Yg3ouAA1PCndCQY5/QheWRZBh69JeWleiE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aDL3uBy+EDgzE/yo77FtDkFgVy3onmBidxFFsFZjM5fk1/1NZ4hI2hr6kcLrtLzN1pB3jHPnckal93WmMO4lY70lvETWjuDAiw4JVVmGFN/30dl/jNJ5RKtmvAw7TQAuTa2CnK387U7SNxd1xZhb3NFLRJL8y1qEV8XXjfTzvAw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gme6LWei; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gme6LWei" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C8E9C4CED0; Thu, 19 Dec 2024 22:37:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734647836; bh=5JceoXzU5Yg3ouAA1PCndCQY5/QheWRZBh69JeWleiE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=gme6LWeigl6oKT1DbN5uIBwUrSPRg+JQRfygKX30wVuFp2ZxgrUdVyHfQAzmXi9NI oZj96dkAoJQ0JQYAxsecJ4ZT+OmbBqdo/xxAIZ/oIthOts91EsOc0CqQ9NfwtbNN7W DXy53N99DAtPzljliM0p2EDaWtN+UiDeTUC9i+IRdI3cNKsh3SBDW4+lFuYc2igQNF M0TvXkSkekAaJwuVO6rKA4VxDrG1UYwxtrkVnQc5cItgoejDZbGp/ZZJcJ+NLh/SKT vvytchuba6fUK91+OpJ7H0pI69hXxzs8Qu71juf2rjXolDsw3m1YUIyj+/ZnuOffaK Uo13WuDXVKBMg== From: Konrad Dybcio Date: Thu, 19 Dec 2024 23:36:55 +0100 Subject: [PATCH 1/2] drm/msm: registers: Add GMU FW version register Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241219-topic-gmu_fw_ver-v1-1-d403a70052d8@oss.qualcomm.com> References: <20241219-topic-gmu_fw_ver-v1-0-d403a70052d8@oss.qualcomm.com> In-Reply-To: <20241219-topic-gmu_fw_ver-v1-0-d403a70052d8@oss.qualcomm.com> To: Rob Clark , Sean Paul , Konrad Dybcio , Abhinav Kumar , Dmitry Baryshkov , David Airlie , Simona Vetter Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Akhil P Oommen , Konrad Dybcio X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734647828; l=1317; i=konrad.dybcio@oss.qualcomm.com; s=20230215; h=from:subject:message-id; bh=l8e6hgJJ3wHD0AXLfem9C5MHVdg/XyBRaZCNsfY8mx0=; b=9otI/+RG58QIZQbBtuTG0HG3syXLlaXSrcCpwvglXgvY2gy8+JAcKWIyIXowYNskOkPkqGfZy nZ45p1a6bFrCe6mUHvMRRHqfks7CGWxH1mUBBBU0T18NpqSxwsbJxB8 X-Developer-Key: i=konrad.dybcio@oss.qualcomm.com; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= From: Konrad Dybcio Add a register that contains the GMU core firmware version on non- legacy (non-sdm845-family) SoCs. The name is guesstimated based on what it does downstream, but it'll do. Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/registers/adreno/a6xx_gmu.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/msm/registers/adreno/a6xx_gmu.xml b/drivers/gpu/drm/msm/registers/adreno/a6xx_gmu.xml index 6531749d30f4e4e57ca4f7b43a28b7829504a9f3..3d2cc339b8f19c8d24b2c9144569b2364afc5ebc 100644 --- a/drivers/gpu/drm/msm/registers/adreno/a6xx_gmu.xml +++ b/drivers/gpu/drm/msm/registers/adreno/a6xx_gmu.xml @@ -52,6 +52,11 @@ xsi:schemaLocation="https://gitlab.freedesktop.org/freedreno/ rules-fd.xsd"> + + + + + From patchwork Thu Dec 19 22:36:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 13915910 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EBE2486337; Thu, 19 Dec 2024 22:37:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734647842; cv=none; b=UN/IBeBEzQAGZJYWxYQT1n/DZbZ+c370OG0y/0TzsSgh+Mhi0CtE4flX0uyKvyDEVFD0AoYKoa4rGUA0E/OMYveCBY809El0lrIQcGgOYVu7UMJyKZL9QcRkATD6QQONDRF9huaR1b47HLdKXs9gO/0G2riJPwFJqyfrXiRGHq8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734647842; c=relaxed/simple; bh=BXmHxRjbMYvi05HUYGxRCT9+m9iRMoBeThzeq5sctFE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OIsxNQPNb4Ua48m4UZuQoXjr6qRqwxWsIjYRwb3QFObruY9W5dsgw0EqiIhYeZiPTwrkx69C7Ewlo39Tv0n2ea0baxx+tHbp2+8zY+BFuvwiJS1hmXxr+funjPejsIIxj65L/Tf9uiJmjld1YN8WFKF65D7LrAf9erfVWUnrKCI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=m/H3M8G7; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="m/H3M8G7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F771C4CECE; Thu, 19 Dec 2024 22:37:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734647841; bh=BXmHxRjbMYvi05HUYGxRCT9+m9iRMoBeThzeq5sctFE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=m/H3M8G7uKq8FVmrLoCZEfswMbp/AkILH6cBoiKIqIWt7bgNow85aVpm7UNEz/IBw cb7fudpjjYH0Ctm6L/54DczaE8JVJagscWlylKJslsBUzGjV3F5wrHBYEQxyJrB6yp LmqKdB3F9fN7PHIpc/kxgFnzca4HMtYqUOMqCdatBJhCWkTw39rSVczP4xyAmwcbY0 LIKqbFrhYtw+C+RAAT6SGOBCLseyBW22q+WjXXxD/hDbfhrn3QfR1gi07gbbCIl6lB AzD/CNRitqq1+NHCkL8s2625YTo4S9XfwGia3wvhN4+j3gxPcTaWzNf8odwciGkKXN khGfWamIekf7A== From: Konrad Dybcio Date: Thu, 19 Dec 2024 23:36:56 +0100 Subject: [PATCH 2/2] drm/msm/a6xx: Print GMU core firmware version at boot Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241219-topic-gmu_fw_ver-v1-2-d403a70052d8@oss.qualcomm.com> References: <20241219-topic-gmu_fw_ver-v1-0-d403a70052d8@oss.qualcomm.com> In-Reply-To: <20241219-topic-gmu_fw_ver-v1-0-d403a70052d8@oss.qualcomm.com> To: Rob Clark , Sean Paul , Konrad Dybcio , Abhinav Kumar , Dmitry Baryshkov , David Airlie , Simona Vetter Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Akhil P Oommen , Konrad Dybcio X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734647828; l=1525; i=konrad.dybcio@oss.qualcomm.com; s=20230215; h=from:subject:message-id; bh=aoD1omnv30HwSwtIB66YPTfZG+VP+p+pQKMUtkvGd7g=; b=0Hgm0N3l/9kovPlli67XIRYIo4KRtswUlxP7o0iG2kfBS50vDyNnxRhq45igMzj29bd7yvg6y IaJ+ikGL17aC8yjrMHUD48pUy5P+l+/B0QMqwLroSNnobikvUhKOUQD X-Developer-Key: i=konrad.dybcio@oss.qualcomm.com; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= From: Konrad Dybcio Log the version for informational purposes, such as for keeping track of possible GMU fw-related failures in crash / CI logs. Intentionally not implemented on the if (gmu->legacy) codepath, as these registers seem not to be used on there. Downstream additionally warns if the firmware version is too old for a given GPU, but we already pair the binary to a given GPU, so let's not go there at the moment. Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c index 14db7376c712d19446b38152e480bd5a1e0a5198..a7ea2b2af1dc3816906236df929df36e37d8f606 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c @@ -729,6 +729,7 @@ static int a6xx_gmu_fw_load(struct a6xx_gmu *gmu) const struct firmware *fw_image = adreno_gpu->fw[ADRENO_FW_GMU]; const struct block_header *blk; u32 reg_offset; + u32 ver; u32 itcm_base = 0x00000000; u32 dtcm_base = 0x00040000; @@ -775,6 +776,12 @@ static int a6xx_gmu_fw_load(struct a6xx_gmu *gmu) } } + ver = gmu_read(gmu, REG_A6XX_GMU_CORE_FW_VERSION); + DRM_INFO("Loaded GMU firmware v%u.%u.%u\n", + FIELD_GET(A6XX_GMU_CORE_FW_VERSION_MAJOR__MASK, ver), + FIELD_GET(A6XX_GMU_CORE_FW_VERSION_MINOR__MASK, ver), + FIELD_GET(A6XX_GMU_CORE_FW_VERSION_STEP__MASK, ver)); + return 0; }