Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3501872rdb; Wed, 27 Dec 2023 09:18:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IEOsC5oQufe9ZGf48h0MkXqbhm503n7oZ2s1XkF+TpopRobR/+ztJq6EDRTbzoIBZ2DbypA X-Received: by 2002:a05:6808:614e:b0:3bb:b700:e2e6 with SMTP id dl14-20020a056808614e00b003bbb700e2e6mr2520298oib.114.1703697487328; Wed, 27 Dec 2023 09:18:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703697487; cv=none; d=google.com; s=arc-20160816; b=eBSRhKzyEz0vX5U4U16a+yHQAaaK+xrcTlK1FDY0ZVWz1Lc1ZftlSSUlMzDFsOzMPd mnC8bN1QdAY+FGEUhzI3U8ZM20nsBRvvlYgUFxkNlAau8wiOG6hGo3zKMeThUotklOnA vOKkZdoN7xNTBCxdJJ4WPa5jjLJiTq8Vw16wirDoCnxGWFceEwY6L0l03BVOzgIecFZr L87agvNLeYZ4+WNSa4vSdz//aVk8v9SlV7yMOQ/HVLnkTVD0S862aKgoKLYfTIlqcI2S 8yJjQTK7NEWoQuy0IUWE6Mm6FWekYrfrw4acYolLMrEMAObp9cuXY3Hruo0nRoO3ceJw k2RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=0wztSQTuANUOIZ6PIjFw0Bt0E03NzpmusoXMwBZyh7U=; fh=c0wzofCQuOqcJi0+oOYRRmHmwHaw5NBfbGEHxhAc32M=; b=t5nLExstI0gg1CkOfUQqz2xfX6ud9HiKlsdhUYuUJ9wm87+cCHcGJGgGIVh7pMXa0J kxOEcQ7byir7xDOlmea3Q2HGcVAWfk6K1tMWJtwlzovhAxz16hnTHjYM6cqsA/PSOLWo MuYugOXbpla23HNqX0cg+R0Z72lkmwQMIWYybT1X191XuZ6kdXHTOAcF4fGm7iOg1aSf //m8w9Lsjehz+kJegY+EPCvKPi72n1V9/rHWrzLVnkT0vLc3Kd5yh270rc7qX6q0k7Au ctJcaWhdf5e+Xz1Ba+w1YKDocdJIhQYQoDiRHBL0L+c9zcfI3+xuhg1QqOCGgfoadxMk WIlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@z3ntu.xyz header.s=s1 header.b=ntejb9aF; spf=pass (google.com: domain of linux-kernel+bounces-12165-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12165-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=z3ntu.xyz Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id vq22-20020a05620a559600b0077f04dc5d27si14669168qkn.112.2023.12.27.09.18.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 09:18:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12165-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@z3ntu.xyz header.s=s1 header.b=ntejb9aF; spf=pass (google.com: domain of linux-kernel+bounces-12165-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12165-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=z3ntu.xyz Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 016411C22443 for ; Wed, 27 Dec 2023 17:18:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 24C0746457; Wed, 27 Dec 2023 17:18:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=z3ntu.xyz header.i=@z3ntu.xyz header.b="ntejb9aF" X-Original-To: linux-kernel@vger.kernel.org Received: from ahti.lucaweiss.eu (ahti.lucaweiss.eu [128.199.32.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8BBE846B81; Wed, 27 Dec 2023 17:17:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=z3ntu.xyz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=z3ntu.xyz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=z3ntu.xyz; s=s1; t=1703697016; bh=EzO2Os7VBSDtEWCulDHnrYefncJjDEnsfBW7sIfrJgM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ntejb9aFOsla7Wbzu3LBmdgowdkG2XjS3H4uZiDm0ZAv5bAuKExQ3Oo5YL/wLjGHt LQDd6GiV4fNyK+zQb4ZkcFBC+ZsK7/sSCc0LtNzv5bT41/cwsX7aPkitfMzAc1vgiU BsLufPnd9g16HjnIiahMMLSIt79Ig9nBohB+D7Lk= From: Luca Weiss To: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Gross , Bjorn Andersson , Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] drm/msm/adreno: Add A305B support Date: Mon, 25 Dec 2023 22:12:56 +0100 Message-ID: <2709745.mvXUDI8C0e@z3ntu.xyz> In-Reply-To: <20231130-msm8226-gpu-v1-2-6bb2f1b29e49@z3ntu.xyz> References: <20231130-msm8226-gpu-v1-0-6bb2f1b29e49@z3ntu.xyz> <20231130-msm8226-gpu-v1-2-6bb2f1b29e49@z3ntu.xyz> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" On Donnerstag, 30. November 2023 21:35:19 CET Luca Weiss wrote: > Add support for the Adreno 305B GPU that is found in MSM8226(v2) SoC. > Previously this was mistakenly claimed to be supported but using wrong > a configuration. > > In MSM8226v1 there's also a A305B but with chipid 0x03000510 which > should work with the same configuration but due to lack of hardware for > testing this is not added. > > Signed-off-by: Luca Weiss Hi all, Any chance this can be picked up for v6.8? The dts patch has already been picked up :) Regards Luca > --- > drivers/gpu/drm/msm/adreno/a3xx_gpu.c | 15 ++++++++++++--- > drivers/gpu/drm/msm/adreno/adreno_device.c | 15 +++++++++++---- > drivers/gpu/drm/msm/adreno/adreno_gpu.h | 5 +++++ > 3 files changed, 28 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/msm/adreno/a3xx_gpu.c > b/drivers/gpu/drm/msm/adreno/a3xx_gpu.c index c86b377f6f0d..5fc29801c4c7 > 100644 > --- a/drivers/gpu/drm/msm/adreno/a3xx_gpu.c > +++ b/drivers/gpu/drm/msm/adreno/a3xx_gpu.c > @@ -134,6 +134,13 @@ static int a3xx_hw_init(struct msm_gpu *gpu) > /* Set up AOOO: */ > gpu_write(gpu, REG_A3XX_VBIF_OUT_AXI_AOOO_EN, 0x0000003c); > gpu_write(gpu, REG_A3XX_VBIF_OUT_AXI_AOOO, 0x003c003c); > + } else if (adreno_is_a305b(adreno_gpu)) { > + gpu_write(gpu, REG_A3XX_VBIF_IN_RD_LIM_CONF0, 0x00181818); > + gpu_write(gpu, REG_A3XX_VBIF_IN_WR_LIM_CONF0, 0x00181818); > + gpu_write(gpu, REG_A3XX_VBIF_OUT_RD_LIM_CONF0, 0x00000018); > + gpu_write(gpu, REG_A3XX_VBIF_OUT_WR_LIM_CONF0, 0x00000018); > + gpu_write(gpu, REG_A3XX_VBIF_DDR_OUT_MAX_BURST, 0x00000303); > + gpu_write(gpu, REG_A3XX_VBIF_ROUND_ROBIN_QOS_ARB, 0x0003); > } else if (adreno_is_a306(adreno_gpu)) { > gpu_write(gpu, REG_A3XX_VBIF_ROUND_ROBIN_QOS_ARB, 0x0003); > gpu_write(gpu, REG_A3XX_VBIF_OUT_RD_LIM_CONF0, 0x0000000a); > @@ -230,7 +237,9 @@ static int a3xx_hw_init(struct msm_gpu *gpu) > gpu_write(gpu, REG_A3XX_UCHE_CACHE_MODE_CONTROL_REG, 0x00000001); > > /* Enable Clock gating: */ > - if (adreno_is_a306(adreno_gpu)) > + if (adreno_is_a305b(adreno_gpu)) > + gpu_write(gpu, REG_A3XX_RBBM_CLOCK_CTL, 0xaaaaaaaa); > + else if (adreno_is_a306(adreno_gpu)) > gpu_write(gpu, REG_A3XX_RBBM_CLOCK_CTL, 0xaaaaaaaa); > else if (adreno_is_a320(adreno_gpu)) > gpu_write(gpu, REG_A3XX_RBBM_CLOCK_CTL, 0xbfffffff); > @@ -333,7 +342,7 @@ static int a3xx_hw_init(struct msm_gpu *gpu) > AXXX_CP_QUEUE_THRESHOLDS_CSQ_IB1_START(2) | > AXXX_CP_QUEUE_THRESHOLDS_CSQ_IB2_START(6) | > AXXX_CP_QUEUE_THRESHOLDS_CSQ_ST_START(14)); > - } else if (adreno_is_a330(adreno_gpu)) { > + } else if (adreno_is_a330(adreno_gpu) || adreno_is_a305b(adreno_gpu)) { > /* NOTE: this (value take from downstream android driver) > * includes some bits outside of the known bitfields. But > * A330 has this "MERCIU queue" thing too, which might > @@ -559,7 +568,7 @@ struct msm_gpu *a3xx_gpu_init(struct drm_device *dev) > goto fail; > > /* if needed, allocate gmem: */ > - if (adreno_is_a330(adreno_gpu)) { > + if (adreno_is_a330(adreno_gpu) || adreno_is_a305b(adreno_gpu)) { > ret = adreno_gpu_ocmem_init(&adreno_gpu->base.pdev->dev, > adreno_gpu, &a3xx_gpu- >ocmem); > if (ret) > diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c > b/drivers/gpu/drm/msm/adreno/adreno_device.c index > f62ab5257e66..7028d5449956 100644 > --- a/drivers/gpu/drm/msm/adreno/adreno_device.c > +++ b/drivers/gpu/drm/msm/adreno/adreno_device.c > @@ -55,10 +55,17 @@ static const struct adreno_info gpulist[] = { > .inactive_period = DRM_MSM_INACTIVE_PERIOD, > .init = a2xx_gpu_init, > }, { > - .chip_ids = ADRENO_CHIP_IDS( > - 0x03000512, > - 0x03000520 > - ), > + .chip_ids = ADRENO_CHIP_IDS(0x03000512), > + .family = ADRENO_3XX, > + .fw = { > + [ADRENO_FW_PM4] = "a330_pm4.fw", > + [ADRENO_FW_PFP] = "a330_pfp.fw", > + }, > + .gmem = SZ_128K, > + .inactive_period = DRM_MSM_INACTIVE_PERIOD, > + .init = a3xx_gpu_init, > + }, { > + .chip_ids = ADRENO_CHIP_IDS(0x03000520), > .family = ADRENO_3XX, > .revn = 305, > .fw = { > diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h > b/drivers/gpu/drm/msm/adreno/adreno_gpu.h index 80b3f6312116..c654f21499bb > 100644 > --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h > +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h > @@ -247,6 +247,11 @@ static inline bool adreno_is_a305(const struct > adreno_gpu *gpu) return adreno_is_revn(gpu, 305); > } > > +static inline bool adreno_is_a305b(const struct adreno_gpu *gpu) > +{ > + return gpu->info->chip_ids[0] == 0x03000512; > +} > + > static inline bool adreno_is_a306(const struct adreno_gpu *gpu) > { > /* yes, 307, because a305c is 306 */