From nobody Tue Dec 2 02:52:38 2025 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 A2E75329E66 for ; Tue, 18 Nov 2025 08:53:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763456016; cv=none; b=qOPBZ+7rRN6RCZwOP3oe6j39GtqFV/dr4h+slNbsikyW3H1rPTeRosqNxgwYDZWdtp4PT9LJhhqSsCGaWnmxFEWQHJD856XJGgNzkqjw4ADZ6EbH7kggqxUMBqzgq1vKX0aGBMxDjUIs5U3gjsTsd2yk0LRr5mV7BCmzBYGGMv0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763456016; c=relaxed/simple; bh=h1Lp619d7jYhqHAcWpvd1UDDc2lrhjlOV9smlZulYLk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LP7Sw0lkIqpt2JZKe4OiJg6r3cF7q00QdNfx12gleUHfJM0FjhaJjR/dsXF2TCQhqYfnHsutxgwXVm/MQSxp7QP54N49b3eyGsQkegD5+ZyQz1dJ64/JnLXuBWzVChgHtYe3OhvLdTBMI9qDbSAnvw4BV1WtaIp5+rNMtDOWLIM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=U1900Cpn; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=X/U3gj8E; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="U1900Cpn"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="X/U3gj8E" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5AI3BPO9375679 for ; Tue, 18 Nov 2025 08:53:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= zmLvkUJXliHeumILkiajqzMsfEq5vICTPsOl2BmOn9U=; b=U1900CpnwPDwOFtg Kgfpw45iKZUrqbwf8kx+RNs+I+wNzE41ofvV0FL2pRdBGnqyuq/WPtgxQo627ONG 0+D724LYWo0A29pDkYJ4pu4/82rdOkp6SpiHVhTIUPg828l7JHwA0x+RALH6rE+Q kVaYidd28LPFIXwJB0FRfKTOYSQj906mEZQAl5FMBfuAKEgqGxrWp4hxGwgBSZr/ Wvdz96ZxKDI7PpGHZ5r23EuszdniUsMFUVn+jafK9+kDhnh59k1I65dQ5R03VSNH QUqjPgEun5B7tHFCOWIOpQnna1nvZW0nVLAtEye+FEcCThkHQ0Th0JiaVE4452kF ClOELw== Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ag76njfxk-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 18 Nov 2025 08:53:31 +0000 (GMT) Received: by mail-pg1-f197.google.com with SMTP id 41be03b00d2f7-bcecfea0e8aso2233660a12.0 for ; Tue, 18 Nov 2025 00:53:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1763456010; x=1764060810; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=zmLvkUJXliHeumILkiajqzMsfEq5vICTPsOl2BmOn9U=; b=X/U3gj8EhAI2FNNBU+u0CM1Zr5pa140NHe84OTfptvr1l9sADxgGFleO9TBhw9Gqtq pWShXwmqe4Qig6rZ+VMKWLNvhQkkCJq4+bCGnao0YE4vxbcBeNmffsDIj3UzG+IsYohG djfzddyda2W0If0pKZZeizjrZ4+NmjP3DtJBAwpsi03KT/FGN5HcHbRzQdmx0EFa1588 cogZdywXKTSjaIs5lcLnj5a35sza4icN9x5H+gPfQFQpTKxAjScmMFdahT4Veai8IBg5 Jhqkjmr363ppiclP7ZfjbePLLjiRP+RsNSjFWYjFffMaDQELiusXyo1lBNgvux1Fn+sk iBwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763456010; x=1764060810; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=zmLvkUJXliHeumILkiajqzMsfEq5vICTPsOl2BmOn9U=; b=SRaTmgE5YbUo6YIlRudm5l1zdPs81Mf26Z9DdRMvQe1okSLO4FvLPkpfOTW8r9/YDi aZ2uEtM+sO/QokyxKmszvXP6EWBjXFaBC5naO48ch4/5gVmgq0MEM0/IzUlvKx7pgKky A6Teh5C91n1D372hSvvc/x3pYW6+5x6EP1haBieoVrE6RErRXlhmjBApWYjSnvuAhil5 OMwEQzJaIveKx3u4C8eXq0Cvha5oeRsL/8v3bfg3bPYv314X7MwdpC36RH56Xb3cAonv towvIeZLHoPIbbvgAz9Sd7OhBmvlKVBV1rNkHEsXCBR+UsP+okR+Tzsb1vOBNfhx5tT8 HYFA== X-Forwarded-Encrypted: i=1; AJvYcCV9/8YrX/gEUVOijdddrEXHP7Pk9Hjj0ZB2AAhk1nmiCX9fT/J0UCzKGy2hRR5IvwLD/v0geoOBGnIfWdI=@vger.kernel.org X-Gm-Message-State: AOJu0Yyl0f1mB8yXNM7Mx9TuecwOZrw1A2IyENZM0Lt8H4eZddilg/XG /4f4Dysu7CyvvFXdhPKnLF17emlORqE+y0Um8YZYJ2ir47/jTuByXSsZIiFN5CDLeiPeNZVqGYy gjrD4ulTZnJ5FsthzYPSpsY2m+CdIQiDxWot+9I73+G2OPFDMm0fup0EKdO13qamxaDE= X-Gm-Gg: ASbGncuFdV6J5S/AG9jmMyM8pkFCiX5Ju7NORiYdZ49vBSH5F2dhNkIVde4MuHyKpx1 /RvMJ53bsCvB9InIVeM/YuUduznfXxclHvviDzenlJKdY2BfOxeTTuR26MdbvmmXf+RZTMCHJhd 0s8DXQCsaVUCJKci/j16j+vkMpBp0zSlpW2hIfuWTA6NrbBNq0fEbwcuIh7BHvL2CSywpo7EZG8 QYJeIZs/zCKLrMx5RNsLLevxq7GmFf1wKkP609zKbq1kOzIiweKKcAmEnENsroOWnvpBvzJRef/ ADqYQQmQg6ifv04LfAd2yp/11o58PB1CS3nDu5EsmLaPOJUPUidWPWBHl11aqV/CKf+cPAohmV3 ELXmeHU4vv0gTW8WC1mulSJM= X-Received: by 2002:a17:903:40cf:b0:266:3f63:3500 with SMTP id d9443c01a7336-299f55269d8mr29953535ad.12.1763456009972; Tue, 18 Nov 2025 00:53:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IFmBHDdkClqMd+Gcz2v9j9rAbZtFuN9/a70zu8YSvIHuY052TxPvYA/z3DMqYWeJmLLJcxqpg== X-Received: by 2002:a17:903:40cf:b0:266:3f63:3500 with SMTP id d9443c01a7336-299f55269d8mr29953195ad.12.1763456009398; Tue, 18 Nov 2025 00:53:29 -0800 (PST) Received: from hu-akhilpo-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2985c2568c1sm162910695ad.47.2025.11.18.00.53.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Nov 2025 00:53:29 -0800 (PST) From: Akhil P Oommen Date: Tue, 18 Nov 2025 14:20:44 +0530 Subject: [PATCH v4 17/22] drm/msm/adreno: Do CX GBIF config before GMU start Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251118-kaana-gpu-support-v4-17-86eeb8e93fb6@oss.qualcomm.com> References: <20251118-kaana-gpu-support-v4-0-86eeb8e93fb6@oss.qualcomm.com> In-Reply-To: <20251118-kaana-gpu-support-v4-0-86eeb8e93fb6@oss.qualcomm.com> To: Rob Clark , Bjorn Andersson , Konrad Dybcio , Sean Paul , Dmitry Baryshkov , Abhinav Kumar , Jessica Zhang , Marijn Suijten , David Airlie , Simona Vetter , Jonathan Marek , Jordan Crouse , Will Deacon , Robin Murphy , Joerg Roedel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Connor Abbott Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, Akhil P Oommen X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1763455868; l=10309; i=akhilpo@oss.qualcomm.com; s=20240726; h=from:subject:message-id; bh=h1Lp619d7jYhqHAcWpvd1UDDc2lrhjlOV9smlZulYLk=; b=i58vssrUKU1gbNMxrtDkq77zKNRGwq/p/6rNQ4VigbitQy8fsJMXAkJ7c8lMfRhPbnD/82Wg5 8P5MUrKb3gGDEsDAS7lkYOi2o1TOOj0Jq/+yXY4EJpOBCL7jRKSoOhU X-Developer-Key: i=akhilpo@oss.qualcomm.com; a=ed25519; pk=lmVtttSHmAUYFnJsQHX80IIRmYmXA4+CzpGcWOOsfKA= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTE4MDA2OSBTYWx0ZWRfX6KjPVrsFdo4k fcALOxs48UXfarWsC/tIKTK4PChsZXoxWQCsbkwYGTKwSW3PKqV7uqlzh4woG7aJdh5acpO848q 1+qME5oxUr2jNUO7S+DlMHaXKe+aeV0dDZhZ5riNZPLgf+ZKke0XnQb4U+JSNf9usloJFEpaT5Z aTZvJpfZCAUweLhNAFWC4hF1uxyrHF17v6r43elDYN3l30cwUmYLqVe3at0wpcderbmHPlqCJa9 stpLrYcvtumxjsBTtY0dRSvUPgR8FrF7XGywoW1k4AH4vcdKxlJVkKGDhPYgyELpHGaBRMkWx07 VM6izwJdmcNRDEVoWfTcuwNcVXksJI1eoLh2Vh1HFPIFiDQkKYJ5kyH3K4bFUwdUJMHTbt3u8O8 g9SQWOUH/HQBaRCP57KtDZoxIHE1pQ== X-Proofpoint-GUID: yBThKkdnoQXX3zB6ca0aB5d2dnPYQ3kF X-Proofpoint-ORIG-GUID: yBThKkdnoQXX3zB6ca0aB5d2dnPYQ3kF X-Authority-Analysis: v=2.4 cv=a4I9NESF c=1 sm=1 tr=0 ts=691c340b cx=c_pps a=rz3CxIlbcmazkYymdCej/Q==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=6UeiqGixMTsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=n9xrOOQmU7Ya-mewsesA:9 a=QEXdDO2ut3YA:10 a=bFCP_H2QrGi7Okbo017w:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-17_04,2025-11-13_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 spamscore=0 clxscore=1015 bulkscore=0 adultscore=0 malwarescore=0 priorityscore=1501 impostorscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2511180069 GMU lies on the CX domain and accesses CX GBIF. So do CX GBIF configurations before GMU wakes up. This was not a problem so far, but A840 GPU is very sensitive to this requirement. Also, move these registers to the catalog. Signed-off-by: Akhil P Oommen --- drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 32 +++++++++++++++++++++++++++= ++++ drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 11 +++++++++++ drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 17 +++++++++------- drivers/gpu/drm/msm/adreno/a6xx_gpu.h | 1 + drivers/gpu/drm/msm/adreno/a8xx_gpu.c | 7 ------- 5 files changed, 54 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c b/drivers/gpu/drm/ms= m/adreno/a6xx_catalog.c index 94ac792fb796..e0bb2c334301 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_catalog.c @@ -672,6 +672,14 @@ static const u32 a690_protect_regs[] =3D { }; DECLARE_ADRENO_PROTECT(a690_protect, 48); =20 +static const struct adreno_reglist a640_gbif[] =3D { + { REG_A6XX_GBIF_QSB_SIDE0, 0x00071620 }, + { REG_A6XX_GBIF_QSB_SIDE1, 0x00071620 }, + { REG_A6XX_GBIF_QSB_SIDE2, 0x00071620 }, + { REG_A6XX_GBIF_QSB_SIDE3, 0x00071620 }, + { }, +}; + static const struct adreno_info a6xx_gpus[] =3D { { .chip_ids =3D ADRENO_CHIP_IDS(0x06010000), @@ -688,6 +696,7 @@ static const struct adreno_info a6xx_gpus[] =3D { .a6xx =3D &(const struct a6xx_info) { .hwcg =3D a612_hwcg, .protect =3D &a630_protect, + .gbif_cx =3D a640_gbif, .gmu_cgc_mode =3D 0x00020202, .prim_fifo_threshold =3D 0x00080000, }, @@ -894,6 +903,7 @@ static const struct adreno_info a6xx_gpus[] =3D { .a6xx =3D &(const struct a6xx_info) { .hwcg =3D a620_hwcg, .protect =3D &a650_protect, + .gbif_cx =3D a640_gbif, .gmu_cgc_mode =3D 0x00020200, .prim_fifo_threshold =3D 0x00010000, }, @@ -916,6 +926,7 @@ static const struct adreno_info a6xx_gpus[] =3D { .a6xx =3D &(const struct a6xx_info) { .hwcg =3D a690_hwcg, .protect =3D &a650_protect, + .gbif_cx =3D a640_gbif, .gmu_cgc_mode =3D 0x00020200, .prim_fifo_threshold =3D 0x00010000, .bcms =3D (const struct a6xx_bcm[]) { @@ -998,6 +1009,7 @@ static const struct adreno_info a6xx_gpus[] =3D { .a6xx =3D &(const struct a6xx_info) { .hwcg =3D a650_hwcg, .protect =3D &a650_protect, + .gbif_cx =3D a640_gbif, .gmu_cgc_mode =3D 0x00020202, .prim_fifo_threshold =3D 0x00300200, }, @@ -1024,6 +1036,7 @@ static const struct adreno_info a6xx_gpus[] =3D { .a6xx =3D &(const struct a6xx_info) { .hwcg =3D a660_hwcg, .protect =3D &a660_protect, + .gbif_cx =3D a640_gbif, .gmu_cgc_mode =3D 0x00020000, .prim_fifo_threshold =3D 0x00300200, }, @@ -1042,6 +1055,7 @@ static const struct adreno_info a6xx_gpus[] =3D { .a6xx =3D &(const struct a6xx_info) { .hwcg =3D a690_hwcg, .protect =3D &a660_protect, + .gbif_cx =3D a640_gbif, .gmu_cgc_mode =3D 0x00020200, .prim_fifo_threshold =3D 0x00300200, }, @@ -1066,6 +1080,7 @@ static const struct adreno_info a6xx_gpus[] =3D { .a6xx =3D &(const struct a6xx_info) { .hwcg =3D a660_hwcg, .protect =3D &a660_protect, + .gbif_cx =3D a640_gbif, .gmu_cgc_mode =3D 0x00020202, .prim_fifo_threshold =3D 0x00200200, }, @@ -1112,6 +1127,7 @@ static const struct adreno_info a6xx_gpus[] =3D { .a6xx =3D &(const struct a6xx_info) { .hwcg =3D a690_hwcg, .protect =3D &a690_protect, + .gbif_cx =3D a640_gbif, .gmu_cgc_mode =3D 0x00020200, .prim_fifo_threshold =3D 0x00800200, }, @@ -1447,6 +1463,7 @@ static const struct adreno_info a7xx_gpus[] =3D { .a6xx =3D &(const struct a6xx_info) { .hwcg =3D a702_hwcg, .protect =3D &a650_protect, + .gbif_cx =3D a640_gbif, .gmu_cgc_mode =3D 0x00020202, .prim_fifo_threshold =3D 0x0000c000, }, @@ -1474,6 +1491,7 @@ static const struct adreno_info a7xx_gpus[] =3D { .hwcg =3D a730_hwcg, .protect =3D &a730_protect, .pwrup_reglist =3D &a7xx_pwrup_reglist, + .gbif_cx =3D a640_gbif, .gmu_cgc_mode =3D 0x00020000, }, .preempt_record_size =3D 2860 * SZ_1K, @@ -1495,6 +1513,7 @@ static const struct adreno_info a7xx_gpus[] =3D { .hwcg =3D a740_hwcg, .protect =3D &a730_protect, .pwrup_reglist =3D &a7xx_pwrup_reglist, + .gbif_cx =3D a640_gbif, .gmu_chipid =3D 0x7020100, .gmu_cgc_mode =3D 0x00020202, .bcms =3D (const struct a6xx_bcm[]) { @@ -1529,6 +1548,7 @@ static const struct adreno_info a7xx_gpus[] =3D { .protect =3D &a730_protect, .pwrup_reglist =3D &a7xx_pwrup_reglist, .ifpc_reglist =3D &a750_ifpc_reglist, + .gbif_cx =3D a640_gbif, .gmu_chipid =3D 0x7050001, .gmu_cgc_mode =3D 0x00020202, .bcms =3D (const struct a6xx_bcm[]) { @@ -1570,6 +1590,7 @@ static const struct adreno_info a7xx_gpus[] =3D { .protect =3D &a730_protect, .pwrup_reglist =3D &a7xx_pwrup_reglist, .ifpc_reglist =3D &a750_ifpc_reglist, + .gbif_cx =3D a640_gbif, .gmu_chipid =3D 0x7090100, .gmu_cgc_mode =3D 0x00020202, .bcms =3D (const struct a6xx_bcm[]) { @@ -1602,6 +1623,7 @@ static const struct adreno_info a7xx_gpus[] =3D { .hwcg =3D a740_hwcg, .protect =3D &a730_protect, .pwrup_reglist =3D &a7xx_pwrup_reglist, + .gbif_cx =3D a640_gbif, .gmu_chipid =3D 0x70f0000, .gmu_cgc_mode =3D 0x00020222, .bcms =3D (const struct a6xx_bcm[]) { @@ -1749,6 +1771,15 @@ static const u32 a840_protect_regs[] =3D { }; DECLARE_ADRENO_PROTECT(a840_protect, 15); =20 +static const struct adreno_reglist a840_gbif[] =3D { + { REG_A6XX_GBIF_QSB_SIDE0, 0x00071e20 }, + { REG_A6XX_GBIF_QSB_SIDE1, 0x00071e20 }, + { REG_A6XX_GBIF_QSB_SIDE2, 0x00071e20 }, + { REG_A6XX_GBIF_QSB_SIDE3, 0x00071e20 }, + { REG_A8XX_GBIF_CX_CONFIG, 0x20023000 }, + { }, +}; + static const struct adreno_info a8xx_gpus[] =3D { { .chip_ids =3D ADRENO_CHIP_IDS(0x44050a01), @@ -1766,6 +1797,7 @@ static const struct adreno_info a8xx_gpus[] =3D { .a6xx =3D &(const struct a6xx_info) { .protect =3D &a840_protect, .nonctxt_reglist =3D a840_nonctxt_regs, + .gbif_cx =3D a840_gbif, .max_slices =3D 3, .gmu_chipid =3D 0x8020100, .bcms =3D (const struct a6xx_bcm[]) { diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/ad= reno/a6xx_gmu.c index d5e000676258..5903cd891b49 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c @@ -894,7 +894,9 @@ static int a6xx_gmu_fw_start(struct a6xx_gmu *gmu, unsi= gned int state) { struct a6xx_gpu *a6xx_gpu =3D container_of(gmu, struct a6xx_gpu, gmu); struct adreno_gpu *adreno_gpu =3D &a6xx_gpu->base; + struct msm_gpu *gpu =3D &adreno_gpu->base; const struct a6xx_info *a6xx_info =3D adreno_gpu->info->a6xx; + const struct adreno_reglist *gbif_cx =3D a6xx_info->gbif_cx; u32 fence_range_lower, fence_range_upper; u32 chipid =3D 0; int ret; @@ -990,6 +992,15 @@ static int a6xx_gmu_fw_start(struct a6xx_gmu *gmu, uns= igned int state) gmu->log.iova | (gmu->log.size / SZ_4K - 1)); } =20 + /* For A7x and newer, do the CX GBIF configurations before GMU wake up */ + for (int i =3D 0; (gbif_cx && gbif_cx[i].offset); i++) + gpu_write(gpu, gbif_cx[i].offset, gbif_cx[i].value); + + if (adreno_is_a8xx(adreno_gpu)) { + gpu_write(gpu, REG_A8XX_GBIF_CX_CONFIG, 0x20023000); + gmu_write(gmu, REG_A6XX_GMU_MRC_GBIF_QOS_CTRL, 0x33); + } + /* Set up the lowest idle level on the GMU */ a6xx_gmu_power_config(gmu); =20 diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/ad= reno/a6xx_gpu.c index 9a643bcccdcf..4d6f47666ff6 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -1279,17 +1279,20 @@ static int hw_init(struct msm_gpu *gpu) /* enable hardware clockgating */ a6xx_set_hwcg(gpu, true); =20 - /* VBIF/GBIF start*/ - if (adreno_is_a610_family(adreno_gpu) || - adreno_is_a640_family(adreno_gpu) || - adreno_is_a650_family(adreno_gpu) || - adreno_is_a7xx(adreno_gpu)) { + /* For gmuwrapper implementations, do the VBIF/GBIF CX configuration here= */ + if (adreno_is_a610_family(adreno_gpu)) { gpu_write(gpu, REG_A6XX_GBIF_QSB_SIDE0, 0x00071620); gpu_write(gpu, REG_A6XX_GBIF_QSB_SIDE1, 0x00071620); gpu_write(gpu, REG_A6XX_GBIF_QSB_SIDE2, 0x00071620); gpu_write(gpu, REG_A6XX_GBIF_QSB_SIDE3, 0x00071620); - gpu_write(gpu, REG_A6XX_RBBM_GBIF_CLIENT_QOS_CNTL, - adreno_is_a7xx(adreno_gpu) ? 0x2120212 : 0x3); + } + + if (adreno_is_a610_family(adreno_gpu) || + adreno_is_a640_family(adreno_gpu) || + adreno_is_a650_family(adreno_gpu)) { + gpu_write(gpu, REG_A6XX_RBBM_GBIF_CLIENT_QOS_CNTL, 0x3); + } else if (adreno_is_a7xx(adreno_gpu)) { + gpu_write(gpu, REG_A6XX_RBBM_GBIF_CLIENT_QOS_CNTL, 0x2120212); } else { gpu_write(gpu, REG_A6XX_RBBM_VBIF_CLIENT_QOS_CNTL, 0x3); } diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.h b/drivers/gpu/drm/msm/ad= reno/a6xx_gpu.h index 0ec265d4b91a..6820216ec5fc 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.h +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.h @@ -46,6 +46,7 @@ struct a6xx_info { const struct adreno_protect *protect; const struct adreno_reglist_list *pwrup_reglist; const struct adreno_reglist_list *ifpc_reglist; + const struct adreno_reglist *gbif_cx; const struct adreno_reglist_pipe *nonctxt_reglist; u32 max_slices; u32 gmu_chipid; diff --git a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c b/drivers/gpu/drm/msm/ad= reno/a8xx_gpu.c index e011e80ceb50..43b886ff576d 100644 --- a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c @@ -519,13 +519,6 @@ static int hw_init(struct msm_gpu *gpu) gpu_write64(gpu, REG_A6XX_RBBM_SECVID_TSB_TRUSTED_BASE, 0x00000000); gpu_write(gpu, REG_A6XX_RBBM_SECVID_TSB_TRUSTED_SIZE, 0x00000000); =20 - gpu_write(gpu, REG_A6XX_GBIF_QSB_SIDE0, 0x00071620); - gpu_write(gpu, REG_A6XX_GBIF_QSB_SIDE1, 0x00071620); - gpu_write(gpu, REG_A6XX_GBIF_QSB_SIDE2, 0x00071620); - gpu_write(gpu, REG_A6XX_GBIF_QSB_SIDE3, 0x00071620); - gpu_write(gpu, REG_A8XX_GBIF_CX_CONFIG, 0x20023000); - gmu_write(gmu, REG_A6XX_GMU_MRC_GBIF_QOS_CTRL, 0x33); - /* Make all blocks contribute to the GPU BUSY perf counter */ gpu_write(gpu, REG_A8XX_RBBM_PERFCTR_GPU_BUSY_MASKED, 0xffffffff); =20 --=20 2.51.0