Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6370037pxv; Thu, 29 Jul 2021 12:52:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDuQNOBr15o/42jbpZc4aEMnKwwMmBsvbv86JS357ky4XpHyFSYrL+tjzTrTQX/sqmqO6F X-Received: by 2002:a5d:8a17:: with SMTP id w23mr5534793iod.19.1627588374616; Thu, 29 Jul 2021 12:52:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627588374; cv=none; d=google.com; s=arc-20160816; b=JwwqSYwt0NDBZNB9TANGZWVwDNCyASQ9SNUDKzHY1ecs2gw9mtsWgHcAm66T/IU859 /YamKutKcKwz2CmFqA3EJHCHeF6CXQQxDi7QV3SR9je4FPFN1EhPHvr4rf8CgU7Rv5sK ij7FnrfyOtxH5Iajs8SJgMwkfTUSMh9WoHwgKhQruh51OrNtlhnbjskxEapvJVBfOGuD Xx3CEqdj9aPQ4A9YvFKJQQOrLw8wuLG0vQQEGeiKudd4pcWqQUp+U0Cp8IsvAT4Dxz/Y LnpQrWruiuXRi+VDbUa1XwLAG8D73p2wf3L0I+HWXYD0BERVSutdAjh+V5V8alssweXQ Jw8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dmarc-filter:sender:dkim-signature; bh=+jKQCMrkI6SnfJLefy3To/tENpXlXiE65yiHBQB3XR0=; b=Xa3z26c0O7YtmzOty95NR1rFcPch/QeE+A4wQCZHYM4ooFPDhQYWhGszzcFoO5w8pW Liiyfh4gXuXSL2ZfNg2yXT3oLRHhsv12QifVEmPuexym/NTCbazsNALeUYfiGcwk2uw+ B4VFnEj1ifK16WcpDS8WvunozK5Pt3g3A9FPgXF0dg082BSmtL4yenEEb4tL9f86lBjX koVSidlqELH83q/g1iaSbz4dAAUKXgN+61Wwpk5SppMwAYFCGCcPJ4o0B8e2nj9wgUMI OOLWvy2JPmHpnDJiXKEmyaXzn8mVbbLZRMtsFvLyyrnx4YHiB7T0f8rt3nS7hpSgkrrY F7Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=Lv1QORVD; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l7si4957555iow.27.2021.07.29.12.52.41; Thu, 29 Jul 2021 12:52:54 -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=@mg.codeaurora.org header.s=smtp header.b=Lv1QORVD; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229645AbhG2Tv5 (ORCPT + 99 others); Thu, 29 Jul 2021 15:51:57 -0400 Received: from so254-9.mailgun.net ([198.61.254.9]:38105 "EHLO so254-9.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229606AbhG2Tv4 (ORCPT ); Thu, 29 Jul 2021 15:51:56 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1627588313; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=+jKQCMrkI6SnfJLefy3To/tENpXlXiE65yiHBQB3XR0=; b=Lv1QORVDq8HIvYsoH6gKU6j4L4dMYpB9++SAcuPAV0fcM8zZeKrrDKh8vntsBdZWeUcRbdHH CubsnNltvHRuUCXf6QfslrLqX8aheiFtRBMquhLKAvOZCoOmhaQHuTI/cKukLliuQqiCr4nE mDgzyhG8UBy4ZBsOGBq4mKlns0g= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n02.prod.us-west-2.postgun.com with SMTP id 610306cf96a66e66b2d72cea (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 29 Jul 2021 19:51:43 GMT Sender: akhilpo=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id A15EFC4323A; Thu, 29 Jul 2021 19:51:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from hyd-lnxbld559.qualcomm.com (unknown [202.46.22.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: akhilpo) by smtp.codeaurora.org (Postfix) with ESMTPSA id BB6F4C43143; Thu, 29 Jul 2021 19:51:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org BB6F4C43143 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=akhilpo@codeaurora.org From: Akhil P Oommen To: freedreno , dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Rob Clark Cc: Douglas Anderson , Matthias Kaehlcke , Jordan Crouse , Jonathan Marek , Daniel Vetter , David Airlie , Sai Prakash Ranjan , Sean Paul , Sharat Masetty , linux-kernel@vger.kernel.org Subject: [PATCH v4 1/3] drm/msm/a6xx: Fix llcc configuration for a660 gpu Date: Fri, 30 Jul 2021 01:21:23 +0530 Message-Id: <20210730011945.v4.1.I110b87677ef16d97397fb7c81c07a16e1f5d211e@changeid> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1627588286-30520-1-git-send-email-akhilpo@codeaurora.org> References: <1627588286-30520-1-git-send-email-akhilpo@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the missing scache_cntl0 register programing which is required for a660 gpu. Signed-off-by: Akhil P Oommen --- (no changes since v1) drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 46 ++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c index 9c5e461..183b9f9 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -1383,13 +1383,13 @@ static void a6xx_llc_activate(struct a6xx_gpu *a6xx_gpu) { struct adreno_gpu *adreno_gpu = &a6xx_gpu->base; struct msm_gpu *gpu = &adreno_gpu->base; - u32 cntl1_regval = 0; + u32 gpu_scid, cntl1_regval = 0; if (IS_ERR(a6xx_gpu->llc_mmio)) return; if (!llcc_slice_activate(a6xx_gpu->llc_slice)) { - u32 gpu_scid = llcc_get_slice_id(a6xx_gpu->llc_slice); + gpu_scid = llcc_get_slice_id(a6xx_gpu->llc_slice); gpu_scid &= 0x1f; cntl1_regval = (gpu_scid << 0) | (gpu_scid << 5) | (gpu_scid << 10) | @@ -1409,26 +1409,34 @@ static void a6xx_llc_activate(struct a6xx_gpu *a6xx_gpu) } } - if (cntl1_regval) { + if (!cntl1_regval) + return; + + /* + * Program the slice IDs for the various GPU blocks and GPU MMU + * pagetables + */ + if (!a6xx_gpu->have_mmu500) { + a6xx_llc_write(a6xx_gpu, + REG_A6XX_CX_MISC_SYSTEM_CACHE_CNTL_1, cntl1_regval); + /* - * Program the slice IDs for the various GPU blocks and GPU MMU - * pagetables + * Program cacheability overrides to not allocate cache + * lines on a write miss */ - if (a6xx_gpu->have_mmu500) - gpu_rmw(gpu, REG_A6XX_GBIF_SCACHE_CNTL1, GENMASK(24, 0), - cntl1_regval); - else { - a6xx_llc_write(a6xx_gpu, - REG_A6XX_CX_MISC_SYSTEM_CACHE_CNTL_1, cntl1_regval); - - /* - * Program cacheability overrides to not allocate cache - * lines on a write miss - */ - a6xx_llc_rmw(a6xx_gpu, - REG_A6XX_CX_MISC_SYSTEM_CACHE_CNTL_0, 0xF, 0x03); - } + a6xx_llc_rmw(a6xx_gpu, + REG_A6XX_CX_MISC_SYSTEM_CACHE_CNTL_0, 0xF, 0x03); + return; } + + gpu_rmw(gpu, REG_A6XX_GBIF_SCACHE_CNTL1, GENMASK(24, 0), cntl1_regval); + + /* On A660, the SCID programming for UCHE traffic is done in + * A6XX_GBIF_SCACHE_CNTL0[14:10] + */ + if (adreno_is_a660(adreno_gpu)) + gpu_rmw(gpu, REG_A6XX_GBIF_SCACHE_CNTL0, (0x1f << 10) | + (1 << 8), (gpu_scid << 10) | (1 << 8)); } static void a6xx_llc_slices_destroy(struct a6xx_gpu *a6xx_gpu) -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation.