From patchwork Tue Dec 13 00:24:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 32581 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2547421wrr; Mon, 12 Dec 2022 16:26:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf4hjKPdJ/9Nozx9eTOinlANMxKUBSET5zz30zfWK3nfGPwl6OVKRUhRwD3NA9pE5S4BUjS1 X-Received: by 2002:a05:6a20:9589:b0:9d:efbf:785d with SMTP id iu9-20020a056a20958900b0009defbf785dmr22360396pzb.18.1670891180536; Mon, 12 Dec 2022 16:26:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670891180; cv=none; d=google.com; s=arc-20160816; b=EZVW02hkGCy0NXzaX316LTOY4rJd23Ty49+4VKHExx/CN2OsV0iTkKvpnuspR7oelg db9yV/OZTxyzxjkFhn2LUMM2halrtQ4Vxq0fsnpDvZI9DLSdXc/n2mf+jdin3frcg8oc MwsquiagU69+L16GCUCrabQxL5DN6zKnyEoPkyjUF57qpP6yy2zw7HVotTAo/R7Y2lsO sECYC+ooYpuvwaO1TfloE4iz2+1abtSK+1okCfoQqs6WUhu0e9HdbZSXsVklezhNeNTX OGI8ma5BuGhQTp0gcFb6MOw9qkJbtn1vifegLkiLVgVmQgPMMbogbMRgYv/ASg0jlDZP KL3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SEIVdXDizl5GA8yUFDs8adYCHSjfLGoxScc9uTeNRRM=; b=HVg3/jWQ+7jT87SMVbDU6uxZumX+lJjrkJs16VbY1UZTIvvC535c1CxF2Umi5FZDG0 AryicU8SWe8b2QiIKSTsprd7DKFyxUm9nRbv0M2Gx6++FiazXbfq8+zHI3n4bqQCkPYi mRlifYsJr1sFHXgeLGK/sG987lCqHCka+fV9sicNcxZ2KVJZ+vNQUcQH6x8ktsqjVKUt XxKa3oA6Xpri1qZQEUCeTYZm+eAdOjfWCqzwvMsPC5vdepcwVuUQ7LVuSVZSpE6W1QUV YSyubTA4dwpfFAQ2i+yWMuue4epsF5b42XCcC/2Ge1Gqk0COAAQOu+tyYauA/hAZ+L/T T2Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OWqhQScu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k63-20020a638442000000b004774a0c66e5si11162908pgd.113.2022.12.12.16.26.06; Mon, 12 Dec 2022 16:26:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OWqhQScu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 S233891AbiLMAZL (ORCPT + 99 others); Mon, 12 Dec 2022 19:25:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233785AbiLMAYg (ORCPT ); Mon, 12 Dec 2022 19:24:36 -0500 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD50860F1 for ; Mon, 12 Dec 2022 16:24:35 -0800 (PST) Received: by mail-lf1-x131.google.com with SMTP id p36so2278942lfa.12 for ; Mon, 12 Dec 2022 16:24:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SEIVdXDizl5GA8yUFDs8adYCHSjfLGoxScc9uTeNRRM=; b=OWqhQScustkMzjXFVt1cNe5DYkL14IYi+Rdz8Skrqo+RWKIyba1oepLqNaDTen2AQu cumnEwn/8PwtoHJFJrOUV+y5iRerymeZpB41CK5NsLALYjFRIrnIK3xjBfYvFq4FtPLv nR2+oV4oLbIySyy2BQh88feryeSpcMkQFXWRrJMGh23p+Vxp72TK1gHc1Xn1tSqw+WBZ NX2EhBKeq1NYa212WqZYh4nA+90M1oJXwSn6Wz4TVj3HKID+X/IvcbrXOuzaQIbkYrcs QbBF22P+qHGZISj+cg0cEu9C/iM0NJIQkUu0GuuRRcNff/u18zYZ8gy17M4ZYxZXpzoA xrNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SEIVdXDizl5GA8yUFDs8adYCHSjfLGoxScc9uTeNRRM=; b=FuJZM1dG39kJW/7uHtfWuYSEwCUWaQufPiV7nP9uAA4C50UknTFP7pMZnS393s+5nA kSbkuZmq4wF92A1piixQgXQf5m692J9gBjOe7NVsFBs8afps6vekKualJvAhZNYGZ8el Mymoitpcf/SeSR6+GLCCKnAga5EN4y13xEhRj9Bf988KwbYJb5uvmVkvq/fM8GjFA9YX bF81OHb9sMcCvX7Mndmr/0ihhZ7v+y2/HeQHNEjDw3prRAmTd2IWDZNVohsT01d5NaDP XL/fdFetWYNnWeZJlVMZWCHYIFzkz0Wkcel29FIDhxpbSbTPIS6IiSZj3f6TLOR98kCF kHdA== X-Gm-Message-State: ANoB5plgEwnICubsuHLANi3aBCxSpFA49Gu6ccXfziPBTK9YhXCpu8lw JuWQGnQGhKNmjwtnEl056F7Y0w== X-Received: by 2002:a05:6512:7b:b0:4a4:68b9:66f1 with SMTP id i27-20020a056512007b00b004a468b966f1mr3805731lfo.60.1670891075461; Mon, 12 Dec 2022 16:24:35 -0800 (PST) Received: from localhost.localdomain (abxh44.neoplus.adsl.tpnet.pl. [83.9.1.44]) by smtp.gmail.com with ESMTPSA id m23-20020ac24257000000b004978e51b691sm137352lfl.266.2022.12.12.16.24.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Dec 2022 16:24:35 -0800 (PST) From: Konrad Dybcio To: linux-arm-msm@vger.kernel.org, andersson@kernel.org, agross@kernel.org, krzysztof.kozlowski@linaro.org Cc: marijn.suijten@somainline.org, Konrad Dybcio , Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , David Airlie , Daniel Vetter , Akhil P Oommen , Chia-I Wu , Douglas Anderson , dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/7] drm/msm/a6xx: Add support for A650 speed binning Date: Tue, 13 Dec 2022 01:24:20 +0100 Message-Id: <20221213002423.259039-5-konrad.dybcio@linaro.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221213002423.259039-1-konrad.dybcio@linaro.org> References: <20221213002423.259039-1-konrad.dybcio@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752056390019784597?= X-GMAIL-MSGID: =?utf-8?q?1752056390019784597?= Add support for matching QFPROM fuse values to get the correct speed bin on A650 (SM8250) GPUs. Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c index 2c1630f0c04c..f139ec57c32d 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -1887,6 +1887,20 @@ static u32 a640_get_speed_bin(u32 fuse) return UINT_MAX; } +static u32 a650_get_speed_bin(u32 fuse) +{ + if (fuse == 0) + return 0; + else if (fuse == 1) + return 1; + else if (fuse == 2) + return 2; + else if (fuse == 3) + return 3; + + return UINT_MAX; +} + static u32 adreno_7c3_get_speed_bin(u32 fuse) { if (fuse == 0) @@ -1915,6 +1929,9 @@ static u32 fuse_to_supp_hw(struct device *dev, struct adreno_rev rev, u32 fuse) if (adreno_cmp_rev(ADRENO_REV(6, 4, 0, ANY_ID), rev)) val = a640_get_speed_bin(fuse); + if (adreno_cmp_rev(ADRENO_REV(6, 5, 0, ANY_ID), rev)) + val = a650_get_speed_bin(fuse); + if (val == UINT_MAX) { DRM_DEV_ERROR(dev, "missing support for speed-bin: %u. Some OPPs may not be supported by hardware\n",