[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADrjBPpWXHhRhid77=utZuaQVzw8aaXUV_EKwwn0=rp7-Jt+NQ@mail.gmail.com>
Date: Mon, 5 Feb 2024 15:14:55 +0000
From: Peter Griffin <peter.griffin@...aro.org>
To: Alexey Klimov <alexey.klimov@...aro.org>
Cc: krzysztof.kozlowski@...aro.org, alim.akhtar@...sung.com,
linux-samsung-soc@...r.kernel.org, semen.protsenko@...aro.org,
robh+dt@...nel.org, krzysztof.kozlowski+dt@...aro.org, conor+dt@...nel.org,
devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, klimov.linux@...il.com, kernel-team@...roid.com,
tudor.ambarus@...aro.org, andre.draszik@...aro.org, saravanak@...gle.com,
willmcvicker@...gle.com, arnd@...db.de
Subject: Re: [PATCH 4/4] soc: samsung: exynos-chipid: fix revision calculation
for gs101
Hi Alexey,
On Thu, 1 Feb 2024 at 17:22, Alexey Klimov <alexey.klimov@...aro.org> wrote:
>
> The main revision for gs101 SoC is not reported in the CHIPID_REV
> register. The gs101 Product ID and revisions registers have a behaviour
> split between old Exynos SoCs and new SoCs. The sub-revision is
> reported in CHIPID_REV register in [19:16] bits but main revision
> is still present in Product ID [7:0].
>
> To construct soc_info->revision correctly for gs101 the main_rev
> should not be reset from a value read from CHIPID_REV.
>
I think it would also be worth adding in the commit message how the
main_rev and sub_rev relate to the a0, b0, b1 reported by the
bootloader.
> Signed-off-by: Alexey Klimov <alexey.klimov@...aro.org>
> ---
> drivers/soc/samsung/exynos-chipid.c | 20 ++++++++++++++++----
> include/linux/soc/samsung/exynos-chipid.h | 1 +
> 2 files changed, 17 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/soc/samsung/exynos-chipid.c b/drivers/soc/samsung/exynos-chipid.c
> index 7fee6094db12..3b952ffd8cf7 100644
> --- a/drivers/soc/samsung/exynos-chipid.c
> +++ b/drivers/soc/samsung/exynos-chipid.c
> @@ -87,14 +87,26 @@ static int exynos_chipid_get_chipid_info(struct regmap *regmap,
> soc_info->product_id = val & EXYNOS_MASK;
>
> if (data->rev_reg != EXYNOS_CHIPID_REG_PRO_ID) {
> - ret = regmap_read(regmap, data->rev_reg, &val);
> + unsigned int val2;
> +
> + ret = regmap_read(regmap, data->rev_reg, &val2);
> if (ret < 0)
> return ret;
> +
> + if (data->main_rev_shift == 0)
> + main_rev = (val >> data->main_rev_shift)
> + & EXYNOS_REV_PART_MASK_GS101;
Looks like it can be simplified to
main_rev = val & EXYNOS_REV_PART_MASK_GS101;
Peter
Powered by blists - more mailing lists