[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8f1caccc-8a49-4c26-aeb4-f46f81593a30@oss.qualcomm.com>
Date: Wed, 12 Nov 2025 11:56:00 +0100
From: Konrad Dybcio <konrad.dybcio@....qualcomm.com>
To: Akhil P Oommen <akhilpo@....qualcomm.com>,
Rob Clark <robin.clark@....qualcomm.com>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konradybcio@...nel.org>, Sean Paul <sean@...rly.run>,
Dmitry Baryshkov <lumag@...nel.org>,
Abhinav Kumar
<abhinav.kumar@...ux.dev>,
Jessica Zhang <jesszhan0024@...il.com>,
Marijn Suijten <marijn.suijten@...ainline.org>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Jonathan Marek <jonathan@...ek.ca>,
Jordan Crouse
<jordan@...micpenguin.net>,
Will Deacon <will@...nel.org>, Robin Murphy <robin.murphy@....com>,
Joerg Roedel <joro@...tes.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
Connor Abbott <cwabbott0@...il.com>
Cc: linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org,
dri-devel@...ts.freedesktop.org, freedreno@...ts.freedesktop.org,
linux-arm-kernel@...ts.infradead.org, iommu@...ts.linux.dev,
devicetree@...r.kernel.org
Subject: Re: [PATCH v2 09/21] drm/msm/a6xx: Rebase GMU register offsets
On 11/10/25 5:37 PM, Akhil P Oommen wrote:
> GMU registers are always at a fixed offset from the GPU base address,
> a consistency maintained at least within a given architecture generation.
> In A8x family, the base address of the GMU has changed, but the offsets
> of the gmu registers remain largely the same. To enable reuse of the gmu
> code for A8x chipsets, update the gmu register offsets to be relative
> to the GPU's base address instead of GMU's.
>
> Signed-off-by: Akhil P Oommen <akhilpo@....qualcomm.com>
> ---
The resulting diff is a little convoluted, but I think it generally
does the right thing
[...]
> +static void __iomem *a6xx_gmu_get_mmio(struct platform_device *pdev,
> + const char *name, resource_size_t *start)
> +{
> + void __iomem *ret;
> + struct resource *res = platform_get_resource_byname(pdev,
> + IORESOURCE_MEM, name);
> +
> + if (!res) {
> + DRM_DEV_ERROR(&pdev->dev, "Unable to find the %s registers\n", name);
> + return ERR_PTR(-EINVAL);
> + }
> +
> + ret = ioremap(res->start, resource_size(res));
> + if (!ret) {
> + DRM_DEV_ERROR(&pdev->dev, "Unable to map the %s registers\n", name);
> + return ERR_PTR(-EINVAL);
> + }
You can use devres here too, devm_platform_get_and_ioremap_resource()
Konrad
Powered by blists - more mailing lists