linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] samsung: exynos-chipid: add Exynos7885 SoC support
@ 2021-10-31 17:53 David Virag
  2021-10-31 20:56 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 3+ messages in thread
From: David Virag @ 2021-10-31 17:53 UTC (permalink / raw)
  Cc: David Virag, Krzysztof Kozlowski, linux-arm-kernel,
	linux-samsung-soc, linux-kernel

Exynos 7885 has product id "0xE7885000". Add this id to the ids with
the name.

The downstream driver sets sub_rev to 2 if we are on Exynos 7885, we
detected sub_rev 1 and the 27th bit of the revision register is set.
This is presumably because Samsung might have set the wrong bits on
rev2 of the SoC in the chipid, but we may never know as we have no
manual.

Both the SM-A530F/jackpotlte with Exynos7885 and the SM-M305/m30lte
with Exynos7904 (rebranded Exynos7885 with lower clock speeds) seem
to have this bit set to 1 and have a sub_rev of 1 otherwise, but the
downstream driver corrects it to 2.
Let's replicate this behaviour in upstream too!

Signed-off-by: David Virag <virag.david003@gmail.com>
---
 drivers/soc/samsung/exynos-chipid.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/soc/samsung/exynos-chipid.c b/drivers/soc/samsung/exynos-chipid.c
index a28053ec7e6a..ec8c76275aec 100644
--- a/drivers/soc/samsung/exynos-chipid.c
+++ b/drivers/soc/samsung/exynos-chipid.c
@@ -55,6 +55,7 @@ static const struct exynos_soc_id {
 	{ "EXYNOS5440", 0xE5440000 },
 	{ "EXYNOS5800", 0xE5422000 },
 	{ "EXYNOS7420", 0xE7420000 },
+	{ "EXYNOS7885", 0xE7885000 },
 	{ "EXYNOS850", 0xE3830000 },
 	{ "EXYNOSAUTOV9", 0xAAA80000 },
 };
@@ -88,6 +89,14 @@ static int exynos_chipid_get_chipid_info(struct regmap *regmap,
 	}
 	main_rev = (val >> data->main_rev_shift) & EXYNOS_REV_PART_MASK;
 	sub_rev = (val >> data->sub_rev_shift) & EXYNOS_REV_PART_MASK;
+
+	//Exynos 7885 revision 2 apparently has the 27th bit set instead of having
+	//a sub_rev of 2. Correct for this!
+	if (soc_info->product_id == 0xE7885000) {
+		if ((sub_rev == 1) && (val & 0x04000000))
+			sub_rev = 2;
+	}
+
 	soc_info->revision = (main_rev << EXYNOS_REV_PART_SHIFT) | sub_rev;
 
 	return 0;
-- 
2.33.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-31 22:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-31 17:53 [PATCH] samsung: exynos-chipid: add Exynos7885 SoC support David Virag
2021-10-31 20:56 ` Krzysztof Kozlowski
2021-10-31 21:59   ` David Virag

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).