From nobody Sun Dec 14 11:55:55 2025 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 23DCF28ECF7; Fri, 9 May 2025 10:14:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746785678; cv=none; b=KELwqrmNJips1/Hcdy+go6eqSmZxa5W1ZWyAjRFOzd6U95fmPjJSdAcDUalF4+ECdEc7SM3Cb2T+kybnIL+451hHkKA3IugQs8GQCsYZhDucagItVgqfDaskZhNYQa6tRiJmjgI73/HjdDM0y+6salfGQ/ZTWs7gWvEBBLwPHTE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746785678; c=relaxed/simple; bh=HGN+lSC329vd4LrTVucVEkhNoI9JDXkgOdKiKkeryhg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=J84gS1dw+CQvxIKKZt7ejNi0gu0X8OF5nyXkGRSdIKUH2mwPVyoYVnDm+Q1r4i41KdhCReDjPEt5CdoycVhGA7ezU3pttu+oEgbjr6EQtm3C6CowILQZ2t6vlGtyvnCLcTn6x1kswA0V3LMP40MDQoNGpEaIO5jXy0neDz/Gjkw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=OZXOW0SC; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="OZXOW0SC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1746785674; bh=HGN+lSC329vd4LrTVucVEkhNoI9JDXkgOdKiKkeryhg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=OZXOW0SCCwPq+eNTxGYTg7T1fiR4e+jEpuOmP87zBA2ZjRQR5RvUyrqACOPFasr15 hVKMd6zRwfwOCYqqft+c7JYInrb3z2fW12cYJGkg+o/vQCXYqGyvwDNRXK0j3mgEaf mdhiW/ad54819cu1borBja8JRaJgNluS0gXYA9008sJFjox0PJZ6O4HAkQSnfmajIi GCzZ5gp9UaLnF0n1uKz698dLBSi1QWtyn+ilmedfEvQVRmScw5AzZ22vv4wOAEg+LK rmsNz1DWB5frP7rEV/BpCgK4QD/81mzU5PJ9anJg5FXDhVezd3v0nBooDngzJiHcax tO4KDrOs9J/bA== Received: from yukiji.home (amontpellier-657-1-116-247.w83-113.abo.wanadoo.fr [83.113.51.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: laeyraud) by bali.collaboradmins.com (Postfix) with ESMTPSA id C049317E0202; Fri, 9 May 2025 12:14:32 +0200 (CEST) From: Louis-Alexis Eyraud Date: Fri, 09 May 2025 12:12:50 +0200 Subject: [PATCH v6 4/5] drm/panfrost: Add support for Mali on the MT8370 SoC 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: <20250509-mt8370-enable-gpu-v6-4-2833888cb1d3@collabora.com> References: <20250509-mt8370-enable-gpu-v6-0-2833888cb1d3@collabora.com> In-Reply-To: <20250509-mt8370-enable-gpu-v6-0-2833888cb1d3@collabora.com> To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Boris Brezillon , Steven Price Cc: kernel@collabora.com, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Louis-Alexis Eyraud X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1746785666; l=2568; i=louisalexis.eyraud@collabora.com; s=20250113; h=from:subject:message-id; bh=HGN+lSC329vd4LrTVucVEkhNoI9JDXkgOdKiKkeryhg=; b=LpMLtSXuVD5FDdUslB7iS5yt9l3TGnYZSbqRdL706Aoq8i5sjoLP9giqbFM5Q9FOJyhlNbYoK 9sR7PaooMy9C2RwtjPBqdbwi19X9e60L9wfTIZBC0DwzGRzGCfdppmG X-Developer-Key: i=louisalexis.eyraud@collabora.com; a=ed25519; pk=CHFBDB2Kqh4EHc6JIqFn69GhxJJAzc0Zr4e8QxtumuM= Add a compatible for the MediaTek MT8370 SoC, with an integrated ARM Mali G57 MC2 GPU (Valhall-JM, dual core), with new platform data for its support in the panfrost driver. It uses the same data as MT8186 for the power management features to describe power supplies, pm_domains and enablement (one regulator, two power domains) but also sets the FORCE_AARCH64_PGTABLE flag in the GPU configuration quirks bitfield to enable AARCH64 4K page table format mode. As MT8186 and MT8370 SoC have different GPU architecture (Mali G52 2EE MC2 for MT8186), making them not compatible, and this mode is only enabled for Mediatek SoC that are Mali G57 based (compatible with mediatek,mali-mt8188 or mediatek,mali-8192), having specific platform data allows to set this flag for MT8370 without modifying MT8186 configuration and behaviour. Reviewed-by: Steven Price Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Louis-Alexis Eyraud --- drivers/gpu/drm/panfrost/panfrost_drv.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panf= rost/panfrost_drv.c index 21b28bef84015793d9dba6b1e585891dc0dfcb6d..07cd67baa81bfccabf3b1a29f7d= 78702038bb2cd 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -841,6 +841,15 @@ static const struct panfrost_compatible mediatek_mt819= 2_data =3D { .gpu_quirks =3D BIT(GPU_QUIRK_FORCE_AARCH64_PGTABLE), }; =20 +static const struct panfrost_compatible mediatek_mt8370_data =3D { + .num_supplies =3D ARRAY_SIZE(default_supplies) - 1, + .supply_names =3D default_supplies, + .num_pm_domains =3D 2, + .pm_domain_names =3D mediatek_pm_domains, + .pm_features =3D BIT(GPU_PM_CLK_DIS) | BIT(GPU_PM_VREG_OFF), + .gpu_quirks =3D BIT(GPU_QUIRK_FORCE_AARCH64_PGTABLE), +}; + static const struct of_device_id dt_match[] =3D { /* Set first to probe before the generic compatibles */ { .compatible =3D "amlogic,meson-gxm-mali", @@ -863,6 +872,7 @@ static const struct of_device_id dt_match[] =3D { { .compatible =3D "mediatek,mt8186-mali", .data =3D &mediatek_mt8186_data= }, { .compatible =3D "mediatek,mt8188-mali", .data =3D &mediatek_mt8188_data= }, { .compatible =3D "mediatek,mt8192-mali", .data =3D &mediatek_mt8192_data= }, + { .compatible =3D "mediatek,mt8370-mali", .data =3D &mediatek_mt8370_data= }, { .compatible =3D "allwinner,sun50i-h616-mali", .data =3D &allwinner_h616= _data }, {} }; --=20 2.49.0