linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/7] soc: samsung: exynos-chipid: add gs101 support
@ 2025-11-18 13:56 Tudor Ambarus
  2025-11-18 13:56 ` [PATCH v2 1/7] dt-bindings: nvmem: add google,gs101-otp Tudor Ambarus
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Tudor Ambarus @ 2025-11-18 13:56 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar,
	Peter Griffin, André Draszik, Srinivas Kandagatla
  Cc: Krzysztof Kozlowski, semen.protsenko, willmcvicker, kernel-team,
	devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel,
	Tudor Ambarus, Krzysztof Kozlowski

Dependency
==========
Typical dependency of the DT patch depending on the bindings patch,
thus the bindings patch could go via the Samsung SoC tree with
Srinivas's ack.

Description
===========
GS101 is different (but also e850 and autov9 I assume) from the SoCs
that are currently handled by the exynos-chipid driver because the
chip ID info is part of the OTP registers. GS101 OTP has a clock, an
interrupt line, a register space (that contains product and chip ID,
TMU data, ASV, etc) and a 32Kbit memory space that can be
read/program/locked with specific commands. On GS101 the "ChipID block"
is just an abstraction, it's not a physical device. When the power-on
sequence progresses, the OTP chipid values are loaded to the OTP
registers.

Add the GS101 chip ID support. The support is intentionally added in the
exynos-chipid driver, and not in a dedicated Exynos OTP driver, because
we estimate that there will not be any OTP consumers in the kernel other
than the chip ID/SoC interface. The downstream GS101 drivers confirm
this supposition.

Testing
=======
root@google-gs:~# cat /sys/devices/soc0/family
Samsung Exynos
root@google-gs:~# cat /sys/devices/soc0/machine
Oriole
root@google-gs:~# cat /sys/devices/soc0/revision
11
root@google-gs:~# cat /sys/devices/soc0/soc_id
GS101

Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
Changes in v2:
- complete rework, treat it as a new patch set please.
- bindings were reviewed at:
  - Link: https://lore.kernel.org/linux-samsung-soc/27a5521cd7ddbed0e870ac416dc829722f1b36a5.camel@linaro.org/T/#me139353334db535806ca6462ae1e86b01ff032a7
  - addressed Andre's s/if of/is of
- part of the cleaning patches are from this trivial series:
  - Link: https://lore.kernel.org/linux-samsung-soc/20251112-chipid-trivial-v1-0-ec2dea03bd83@linaro.org/
- Link to v1: https://lore.kernel.org/r/20251031-gs101-chipid-v1-0-d78d1076b210@linaro.org

---
Tudor Ambarus (7):
      dt-bindings: nvmem: add google,gs101-otp
      soc: samsung: exynos-chipid: add google,gs101-otp support
      soc: samsung: exynos-chipid: use devm action to unregister soc device
      soc: samsung: exynos-chipid: use dev_err_probe where appropiate
      soc: samsung: exynos-chipid: rename method
      soc: samsung: exynos-chipid: downgrade dev_info to dev_dbg for soc info
      arm64: dts: exynos: gs101: add OTP node

 .../bindings/nvmem/google,gs101-otp.yaml           |  56 ++++++++
 arch/arm64/boot/dts/exynos/google/gs101.dtsi       |   7 +
 drivers/soc/samsung/exynos-chipid.c                | 148 +++++++++++++++------
 3 files changed, 168 insertions(+), 43 deletions(-)
---
base-commit: 4b67e4c65c1e0740ac12bd0d790eb5a9d0091aaa
change-id: 20251031-gs101-chipid-fd84da8afa2f

Best regards,
-- 
Tudor Ambarus <tudor.ambarus@linaro.org>



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

* [PATCH v2 1/7] dt-bindings: nvmem: add google,gs101-otp
  2025-11-18 13:56 [PATCH v2 0/7] soc: samsung: exynos-chipid: add gs101 support Tudor Ambarus
@ 2025-11-18 13:56 ` Tudor Ambarus
  2025-11-18 13:56 ` [PATCH v2 2/7] soc: samsung: exynos-chipid: add google,gs101-otp support Tudor Ambarus
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Tudor Ambarus @ 2025-11-18 13:56 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar,
	Peter Griffin, André Draszik, Srinivas Kandagatla
  Cc: Krzysztof Kozlowski, semen.protsenko, willmcvicker, kernel-team,
	devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel,
	Tudor Ambarus, Krzysztof Kozlowski

Add binding for the OTP controller found on Google GS101.

Reviewed-by: André Draszik <andre.draszik@linaro.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
 .../bindings/nvmem/google,gs101-otp.yaml           | 56 ++++++++++++++++++++++
 1 file changed, 56 insertions(+)

diff --git a/Documentation/devicetree/bindings/nvmem/google,gs101-otp.yaml b/Documentation/devicetree/bindings/nvmem/google,gs101-otp.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..8ed65e906a2a1b0c216a09c9444f87af61090b81
--- /dev/null
+++ b/Documentation/devicetree/bindings/nvmem/google,gs101-otp.yaml
@@ -0,0 +1,56 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/nvmem/google,gs101-otp.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Google GS101 OTP Controller
+
+maintainers:
+  - Tudor Ambarus <tudor.ambarus@linaro.org>
+
+description: |
+  OTP controller drives a NVMEM memory where system or user specific data
+  can be stored. The OTP controller register space is of interest as well
+  because it contains dedicated registers where it stores the Product ID
+  and the Chip ID (apart other things like TMU or ASV info).
+
+allOf:
+  - $ref: nvmem.yaml#
+
+properties:
+  compatible:
+    items:
+      - const: google,gs101-otp
+
+  clocks:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  reg:
+    maxItems: 1
+
+  power-domains:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - interrupts
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/google,gs101.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    efuse@10000000 {
+        compatible = "google,gs101-otp";
+        reg = <0x10000000 0xf084>;
+        clocks = <&cmu_misc CLK_GOUT_MISC_OTP_CON_TOP_PCLK>;
+        interrupts = <GIC_SPI 752 IRQ_TYPE_LEVEL_HIGH>;
+    };

-- 
2.52.0.rc1.455.g30608eb744-goog



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

* [PATCH v2 2/7] soc: samsung: exynos-chipid: add google,gs101-otp support
  2025-11-18 13:56 [PATCH v2 0/7] soc: samsung: exynos-chipid: add gs101 support Tudor Ambarus
  2025-11-18 13:56 ` [PATCH v2 1/7] dt-bindings: nvmem: add google,gs101-otp Tudor Ambarus
@ 2025-11-18 13:56 ` Tudor Ambarus
  2025-11-18 13:56 ` [PATCH v2 3/7] soc: samsung: exynos-chipid: use devm action to unregister soc device Tudor Ambarus
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Tudor Ambarus @ 2025-11-18 13:56 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar,
	Peter Griffin, André Draszik, Srinivas Kandagatla
  Cc: Krzysztof Kozlowski, semen.protsenko, willmcvicker, kernel-team,
	devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel,
	Tudor Ambarus

GS101 is different (but also e850 and autov9 I assume) from the SoCs
that are currently handled by the exynos-chipid driver because the
chip ID info is part of the OTP registers. GS101 OTP has a clock, an
interrupt line, a register space (that contains product and chip ID,
TMU data, ASV, etc) and a 32Kbit memory space that can be
read/program/locked with specific commands. On GS101 the "ChipID block"
is just an abstraction, it's not a physical device. When the power-on
sequence progresses, the OTP chipid values are loaded to the OTP
registers.

Add the GS101 chip ID support. The support is intentionally added in the
exynos-chipid driver, and not in a dedicated Exynos OTP driver, because
we estimate that there will not be any OTP consumers in the kernel other
than the chip ID/SoC interface. The downstream GS101 drivers confirm
this supposition.

Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
 drivers/soc/samsung/exynos-chipid.c | 86 ++++++++++++++++++++++++++++++++-----
 1 file changed, 75 insertions(+), 11 deletions(-)

diff --git a/drivers/soc/samsung/exynos-chipid.c b/drivers/soc/samsung/exynos-chipid.c
index d3b4b5508e0c808ee9f7b0039073ef57915d60fc..8904ffdaf9a6f6d069cc6af18a24dd00a2780892 100644
--- a/drivers/soc/samsung/exynos-chipid.c
+++ b/drivers/soc/samsung/exynos-chipid.c
@@ -13,8 +13,11 @@
  */
 
 #include <linux/array_size.h>
+#include <linux/clk.h>
 #include <linux/device.h>
-#include <linux/errno.h>
+#include <linux/device/devres.h>
+#include <linux/err.h>
+#include <linux/ioport.h>
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of.h>
@@ -27,9 +30,11 @@
 #include "exynos-asv.h"
 
 struct exynos_chipid_variant {
-	unsigned int rev_reg;		/* revision register offset */
+	unsigned int main_rev_reg;	/* main revision register offset */
+	unsigned int sub_rev_reg;	/* sub revision register offset */
 	unsigned int main_rev_shift;	/* main revision offset in rev_reg */
 	unsigned int sub_rev_shift;	/* sub revision offset in rev_reg */
+	bool efuse;
 };
 
 struct exynos_chipid_info {
@@ -68,6 +73,8 @@ static const struct exynos_soc_id {
 	{ "EXYNOS990", 0xE9830000 },
 	{ "EXYNOSAUTOV9", 0xAAA80000 },
 	{ "EXYNOSAUTOV920", 0x0A920000 },
+	/* Compatible with: google,gs101-otp */
+	{ "GS101", 0x9845000 },
 };
 
 static const char *product_id_to_soc_id(unsigned int product_id)
@@ -92,18 +99,52 @@ static int exynos_chipid_get_chipid_info(struct regmap *regmap,
 		return ret;
 	soc_info->product_id = val & EXYNOS_MASK;
 
-	if (data->rev_reg != EXYNOS_CHIPID_REG_PRO_ID) {
-		ret = regmap_read(regmap, data->rev_reg, &val);
+	if (data->sub_rev_reg == EXYNOS_CHIPID_REG_PRO_ID) {
+		/* exynos4210 case */
+		main_rev = (val >> data->main_rev_shift) & EXYNOS_REV_PART_MASK;
+		sub_rev = (val >> data->sub_rev_shift) & EXYNOS_REV_PART_MASK;
+	} else {
+		unsigned int val2;
+
+		ret = regmap_read(regmap, data->sub_rev_reg, &val2);
 		if (ret < 0)
 			return ret;
+
+		if (data->main_rev_reg == EXYNOS_CHIPID_REG_PRO_ID)
+			/* gs101 case */
+			main_rev = (val >> data->main_rev_shift) & EXYNOS_REV_PART_MASK;
+		else
+			/* exynos850 case */
+			main_rev = (val2 >> data->main_rev_shift) & EXYNOS_REV_PART_MASK;
+
+		sub_rev = (val2 >> data->sub_rev_shift) & EXYNOS_REV_PART_MASK;
 	}
-	main_rev = (val >> data->main_rev_shift) & EXYNOS_REV_PART_MASK;
-	sub_rev = (val >> data->sub_rev_shift) & EXYNOS_REV_PART_MASK;
+
 	soc_info->revision = (main_rev << EXYNOS_REV_PART_SHIFT) | sub_rev;
 
 	return 0;
 }
 
+static struct regmap *exynos_chipid_get_efuse_regmap(struct platform_device *pdev)
+{
+	struct resource *res;
+	void __iomem *base;
+
+	base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
+	if (IS_ERR(base))
+		return ERR_CAST(base);
+
+	const struct regmap_config reg_config = {
+		.reg_bits = 32,
+		.reg_stride = 4,
+		.val_bits = 32,
+		.use_relaxed_mmio = true,
+		.max_register = (resource_size(res) - reg_config.reg_stride),
+	};
+
+	return devm_regmap_init_mmio(&pdev->dev, base, &reg_config);
+}
+
 static int exynos_chipid_probe(struct platform_device *pdev)
 {
 	const struct exynos_chipid_variant *drv_data;
@@ -119,9 +160,23 @@ static int exynos_chipid_probe(struct platform_device *pdev)
 	if (!drv_data)
 		return -EINVAL;
 
-	regmap = device_node_to_regmap(dev->of_node);
-	if (IS_ERR(regmap))
-		return PTR_ERR(regmap);
+	if (drv_data->efuse) {
+		struct clk *clk;
+
+		regmap = exynos_chipid_get_efuse_regmap(pdev);
+		if (IS_ERR(regmap))
+			return dev_err_probe(dev, PTR_ERR(regmap),
+					     "failed to get efuse regmap\n");
+
+		clk = devm_clk_get_enabled(dev, NULL);
+		if (IS_ERR(clk))
+			return dev_err_probe(dev, PTR_ERR(clk),
+					     "failed to get clock\n");
+	} else {
+		regmap = device_node_to_regmap(dev->of_node);
+		if (IS_ERR(regmap))
+			return PTR_ERR(regmap);
+	}
 
 	ret = exynos_chipid_get_chipid_info(regmap, drv_data, &soc_info);
 	if (ret < 0)
@@ -177,19 +232,28 @@ static void exynos_chipid_remove(struct platform_device *pdev)
 }
 
 static const struct exynos_chipid_variant exynos4210_chipid_drv_data = {
-	.rev_reg	= 0x0,
 	.main_rev_shift	= 4,
 	.sub_rev_shift	= 0,
 };
 
 static const struct exynos_chipid_variant exynos850_chipid_drv_data = {
-	.rev_reg	= 0x10,
+	.main_rev_reg	= 0x10,
+	.sub_rev_reg	= 0x10,
 	.main_rev_shift	= 20,
 	.sub_rev_shift	= 16,
 };
 
+static const struct exynos_chipid_variant gs101_chipid_drv_data = {
+	.sub_rev_reg	= 0x10,
+	.sub_rev_shift	= 16,
+	.efuse = true,
+};
+
 static const struct of_device_id exynos_chipid_of_device_ids[] = {
 	{
+		.compatible	= "google,gs101-otp",
+		.data		= &gs101_chipid_drv_data,
+	}, {
 		.compatible	= "samsung,exynos4210-chipid",
 		.data		= &exynos4210_chipid_drv_data,
 	}, {

-- 
2.52.0.rc1.455.g30608eb744-goog



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

* [PATCH v2 3/7] soc: samsung: exynos-chipid: use devm action to unregister soc device
  2025-11-18 13:56 [PATCH v2 0/7] soc: samsung: exynos-chipid: add gs101 support Tudor Ambarus
  2025-11-18 13:56 ` [PATCH v2 1/7] dt-bindings: nvmem: add google,gs101-otp Tudor Ambarus
  2025-11-18 13:56 ` [PATCH v2 2/7] soc: samsung: exynos-chipid: add google,gs101-otp support Tudor Ambarus
@ 2025-11-18 13:56 ` Tudor Ambarus
  2025-11-19 12:13   ` Krzysztof Kozlowski
  2025-11-18 13:56 ` [PATCH v2 4/7] soc: samsung: exynos-chipid: use dev_err_probe where appropiate Tudor Ambarus
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 10+ messages in thread
From: Tudor Ambarus @ 2025-11-18 13:56 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar,
	Peter Griffin, André Draszik, Srinivas Kandagatla
  Cc: Krzysztof Kozlowski, semen.protsenko, willmcvicker, kernel-team,
	devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel,
	Tudor Ambarus

Simplify the unwinding of the soc device by using a devm action.
Add the action before the exynos_asv_init() to avoid an explicit call
to soc_device_unregister().

Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
 drivers/soc/samsung/exynos-chipid.c | 27 +++++++++++----------------
 1 file changed, 11 insertions(+), 16 deletions(-)

diff --git a/drivers/soc/samsung/exynos-chipid.c b/drivers/soc/samsung/exynos-chipid.c
index 8904ffdaf9a6f6d069cc6af18a24dd00a2780892..db73dfad4e1b4fb001cb653bc8caf8aa08d85f2d 100644
--- a/drivers/soc/samsung/exynos-chipid.c
+++ b/drivers/soc/samsung/exynos-chipid.c
@@ -145,6 +145,11 @@ static struct regmap *exynos_chipid_get_efuse_regmap(struct platform_device *pde
 	return devm_regmap_init_mmio(&pdev->dev, base, &reg_config);
 }
 
+static void exynos_chipid_unregister_soc(void *data)
+{
+	soc_device_unregister(data);
+}
+
 static int exynos_chipid_probe(struct platform_device *pdev)
 {
 	const struct exynos_chipid_variant *drv_data;
@@ -207,28 +212,19 @@ static int exynos_chipid_probe(struct platform_device *pdev)
 	if (IS_ERR(soc_dev))
 		return PTR_ERR(soc_dev);
 
-	ret = exynos_asv_init(dev, regmap);
+	ret = devm_add_action_or_reset(dev, exynos_chipid_unregister_soc,
+				       soc_dev);
 	if (ret)
-		goto err;
+		return dev_err_probe(dev, ret, "failed to add devm action\n");
 
-	platform_set_drvdata(pdev, soc_dev);
+	ret = exynos_asv_init(dev, regmap);
+	if (ret)
+		return ret;
 
 	dev_info(dev, "Exynos: CPU[%s] PRO_ID[0x%x] REV[0x%x] Detected\n",
 		 soc_dev_attr->soc_id, soc_info.product_id, soc_info.revision);
 
 	return 0;
-
-err:
-	soc_device_unregister(soc_dev);
-
-	return ret;
-}
-
-static void exynos_chipid_remove(struct platform_device *pdev)
-{
-	struct soc_device *soc_dev = platform_get_drvdata(pdev);
-
-	soc_device_unregister(soc_dev);
 }
 
 static const struct exynos_chipid_variant exynos4210_chipid_drv_data = {
@@ -270,7 +266,6 @@ static struct platform_driver exynos_chipid_driver = {
 		.of_match_table = exynos_chipid_of_device_ids,
 	},
 	.probe = exynos_chipid_probe,
-	.remove = exynos_chipid_remove,
 };
 module_platform_driver(exynos_chipid_driver);
 

-- 
2.52.0.rc1.455.g30608eb744-goog



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

* [PATCH v2 4/7] soc: samsung: exynos-chipid: use dev_err_probe where appropiate
  2025-11-18 13:56 [PATCH v2 0/7] soc: samsung: exynos-chipid: add gs101 support Tudor Ambarus
                   ` (2 preceding siblings ...)
  2025-11-18 13:56 ` [PATCH v2 3/7] soc: samsung: exynos-chipid: use devm action to unregister soc device Tudor Ambarus
@ 2025-11-18 13:56 ` Tudor Ambarus
  2025-11-18 13:56 ` [PATCH v2 5/7] soc: samsung: exynos-chipid: rename method Tudor Ambarus
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Tudor Ambarus @ 2025-11-18 13:56 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar,
	Peter Griffin, André Draszik, Srinivas Kandagatla
  Cc: Krzysztof Kozlowski, semen.protsenko, willmcvicker, kernel-team,
	devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel,
	Tudor Ambarus

Use dev_err_probe() to benefit of the standardized format of the error
code (e.g. "ENODEV" instead of -19), to get meanigful error messages, and
for more compact error paths.

Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
 drivers/soc/samsung/exynos-chipid.c | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/drivers/soc/samsung/exynos-chipid.c b/drivers/soc/samsung/exynos-chipid.c
index db73dfad4e1b4fb001cb653bc8caf8aa08d85f2d..e7dbe1bc45d6af58527125f512c0ff22c03a9629 100644
--- a/drivers/soc/samsung/exynos-chipid.c
+++ b/drivers/soc/samsung/exynos-chipid.c
@@ -87,8 +87,8 @@ static const char *product_id_to_soc_id(unsigned int product_id)
 	return NULL;
 }
 
-static int exynos_chipid_get_chipid_info(struct regmap *regmap,
-		const struct exynos_chipid_variant *data,
+static int exynos_chipid_get_chipid_info(struct device *dev,
+		struct regmap *regmap, const struct exynos_chipid_variant *data,
 		struct exynos_chipid_info *soc_info)
 {
 	int ret;
@@ -96,7 +96,7 @@ static int exynos_chipid_get_chipid_info(struct regmap *regmap,
 
 	ret = regmap_read(regmap, EXYNOS_CHIPID_REG_PRO_ID, &val);
 	if (ret < 0)
-		return ret;
+		return dev_err_probe(dev, ret, "failed to read Product ID\n");
 	soc_info->product_id = val & EXYNOS_MASK;
 
 	if (data->sub_rev_reg == EXYNOS_CHIPID_REG_PRO_ID) {
@@ -108,7 +108,8 @@ static int exynos_chipid_get_chipid_info(struct regmap *regmap,
 
 		ret = regmap_read(regmap, data->sub_rev_reg, &val2);
 		if (ret < 0)
-			return ret;
+			return dev_err_probe(dev, ret,
+					     "failed to read sub revision\n");
 
 		if (data->main_rev_reg == EXYNOS_CHIPID_REG_PRO_ID)
 			/* gs101 case */
@@ -163,7 +164,8 @@ static int exynos_chipid_probe(struct platform_device *pdev)
 
 	drv_data = of_device_get_match_data(dev);
 	if (!drv_data)
-		return -EINVAL;
+		return dev_err_probe(dev, -EINVAL,
+				     "failed to get match data\n");
 
 	if (drv_data->efuse) {
 		struct clk *clk;
@@ -180,10 +182,11 @@ static int exynos_chipid_probe(struct platform_device *pdev)
 	} else {
 		regmap = device_node_to_regmap(dev->of_node);
 		if (IS_ERR(regmap))
-			return PTR_ERR(regmap);
+			return dev_err_probe(dev, PTR_ERR(regmap),
+					     "failed to get regmap\n");
 	}
 
-	ret = exynos_chipid_get_chipid_info(regmap, drv_data, &soc_info);
+	ret = exynos_chipid_get_chipid_info(dev, regmap, drv_data, &soc_info);
 	if (ret < 0)
 		return ret;
 
@@ -202,15 +205,14 @@ static int exynos_chipid_probe(struct platform_device *pdev)
 	if (!soc_dev_attr->revision)
 		return -ENOMEM;
 	soc_dev_attr->soc_id = product_id_to_soc_id(soc_info.product_id);
-	if (!soc_dev_attr->soc_id) {
-		pr_err("Unknown SoC\n");
-		return -ENODEV;
-	}
+	if (!soc_dev_attr->soc_id)
+		return dev_err_probe(dev, -ENODEV, "Unknown SoC\n");
 
 	/* please note that the actual registration will be deferred */
 	soc_dev = soc_device_register(soc_dev_attr);
 	if (IS_ERR(soc_dev))
-		return PTR_ERR(soc_dev);
+		return dev_err_probe(dev, PTR_ERR(soc_dev),
+				     "failed to register to the soc interface\n");
 
 	ret = devm_add_action_or_reset(dev, exynos_chipid_unregister_soc,
 				       soc_dev);

-- 
2.52.0.rc1.455.g30608eb744-goog



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

* [PATCH v2 5/7] soc: samsung: exynos-chipid: rename method
  2025-11-18 13:56 [PATCH v2 0/7] soc: samsung: exynos-chipid: add gs101 support Tudor Ambarus
                   ` (3 preceding siblings ...)
  2025-11-18 13:56 ` [PATCH v2 4/7] soc: samsung: exynos-chipid: use dev_err_probe where appropiate Tudor Ambarus
@ 2025-11-18 13:56 ` Tudor Ambarus
  2025-11-18 13:56 ` [PATCH v2 6/7] soc: samsung: exynos-chipid: downgrade dev_info to dev_dbg for soc info Tudor Ambarus
  2025-11-18 13:56 ` [PATCH v2 7/7] arm64: dts: exynos: gs101: add OTP node Tudor Ambarus
  6 siblings, 0 replies; 10+ messages in thread
From: Tudor Ambarus @ 2025-11-18 13:56 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar,
	Peter Griffin, André Draszik, Srinivas Kandagatla
  Cc: Krzysztof Kozlowski, semen.protsenko, willmcvicker, kernel-team,
	devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel,
	Tudor Ambarus

s/product_id_to_soc_id/exynos_product_id_to_name.
Prepend exynos_ to avoid name space pollution. The method translates the
product id to a name, rename the method to make that clear. While
touching the code where it is called, add a blank line for readability
purposes.

Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
 drivers/soc/samsung/exynos-chipid.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/soc/samsung/exynos-chipid.c b/drivers/soc/samsung/exynos-chipid.c
index e7dbe1bc45d6af58527125f512c0ff22c03a9629..7ed7f44b6ae5357b71fee3994e4a4265aa870d41 100644
--- a/drivers/soc/samsung/exynos-chipid.c
+++ b/drivers/soc/samsung/exynos-chipid.c
@@ -77,7 +77,7 @@ static const struct exynos_soc_id {
 	{ "GS101", 0x9845000 },
 };
 
-static const char *product_id_to_soc_id(unsigned int product_id)
+static const char *exynos_product_id_to_name(unsigned int product_id)
 {
 	int i;
 
@@ -204,7 +204,8 @@ static int exynos_chipid_probe(struct platform_device *pdev)
 						soc_info.revision);
 	if (!soc_dev_attr->revision)
 		return -ENOMEM;
-	soc_dev_attr->soc_id = product_id_to_soc_id(soc_info.product_id);
+
+	soc_dev_attr->soc_id = exynos_product_id_to_name(soc_info.product_id);
 	if (!soc_dev_attr->soc_id)
 		return dev_err_probe(dev, -ENODEV, "Unknown SoC\n");
 

-- 
2.52.0.rc1.455.g30608eb744-goog



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

* [PATCH v2 6/7] soc: samsung: exynos-chipid: downgrade dev_info to dev_dbg for soc info
  2025-11-18 13:56 [PATCH v2 0/7] soc: samsung: exynos-chipid: add gs101 support Tudor Ambarus
                   ` (4 preceding siblings ...)
  2025-11-18 13:56 ` [PATCH v2 5/7] soc: samsung: exynos-chipid: rename method Tudor Ambarus
@ 2025-11-18 13:56 ` Tudor Ambarus
  2025-11-18 13:56 ` [PATCH v2 7/7] arm64: dts: exynos: gs101: add OTP node Tudor Ambarus
  6 siblings, 0 replies; 10+ messages in thread
From: Tudor Ambarus @ 2025-11-18 13:56 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar,
	Peter Griffin, André Draszik, Srinivas Kandagatla
  Cc: Krzysztof Kozlowski, semen.protsenko, willmcvicker, kernel-team,
	devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel,
	Tudor Ambarus

The SoC information is exposed to userspace using the standard soc
interface. Downgrade to dev_dbg to stop polluting the console log.

Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
 drivers/soc/samsung/exynos-chipid.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/soc/samsung/exynos-chipid.c b/drivers/soc/samsung/exynos-chipid.c
index 7ed7f44b6ae5357b71fee3994e4a4265aa870d41..e1b939e526cea9b2069da6e37a1a16950ce5ac44 100644
--- a/drivers/soc/samsung/exynos-chipid.c
+++ b/drivers/soc/samsung/exynos-chipid.c
@@ -224,8 +224,8 @@ static int exynos_chipid_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	dev_info(dev, "Exynos: CPU[%s] PRO_ID[0x%x] REV[0x%x] Detected\n",
-		 soc_dev_attr->soc_id, soc_info.product_id, soc_info.revision);
+	dev_dbg(dev, "Exynos: CPU[%s] PRO_ID[0x%x] REV[0x%x] Detected\n",
+		soc_dev_attr->soc_id, soc_info.product_id, soc_info.revision);
 
 	return 0;
 }

-- 
2.52.0.rc1.455.g30608eb744-goog



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

* [PATCH v2 7/7] arm64: dts: exynos: gs101: add OTP node
  2025-11-18 13:56 [PATCH v2 0/7] soc: samsung: exynos-chipid: add gs101 support Tudor Ambarus
                   ` (5 preceding siblings ...)
  2025-11-18 13:56 ` [PATCH v2 6/7] soc: samsung: exynos-chipid: downgrade dev_info to dev_dbg for soc info Tudor Ambarus
@ 2025-11-18 13:56 ` Tudor Ambarus
  6 siblings, 0 replies; 10+ messages in thread
From: Tudor Ambarus @ 2025-11-18 13:56 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar,
	Peter Griffin, André Draszik, Srinivas Kandagatla
  Cc: Krzysztof Kozlowski, semen.protsenko, willmcvicker, kernel-team,
	devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel,
	Tudor Ambarus

Add the OTP controller node.

Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
 arch/arm64/boot/dts/exynos/google/gs101.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm64/boot/dts/exynos/google/gs101.dtsi b/arch/arm64/boot/dts/exynos/google/gs101.dtsi
index d06d1d05f36408137a8acd98e43d48ea7d4f4292..4be983d4e291b3afe3530fbea0163f70c1a74671 100644
--- a/arch/arm64/boot/dts/exynos/google/gs101.dtsi
+++ b/arch/arm64/boot/dts/exynos/google/gs101.dtsi
@@ -571,6 +571,13 @@ soc: soc@0 {
 		#size-cells = <1>;
 		ranges = <0x0 0x0 0x0 0x40000000>;
 
+		efuse@10000000 {
+			compatible = "google,gs101-otp";
+			reg = <0x10000000 0xf084>;
+			clocks = <&cmu_misc CLK_GOUT_MISC_OTP_CON_TOP_PCLK>;
+			interrupts = <GIC_SPI 752 IRQ_TYPE_LEVEL_HIGH 0>;
+		};
+
 		cmu_misc: clock-controller@10010000 {
 			compatible = "google,gs101-cmu-misc";
 			reg = <0x10010000 0x10000>;

-- 
2.52.0.rc1.455.g30608eb744-goog



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

* Re: [PATCH v2 3/7] soc: samsung: exynos-chipid: use devm action to unregister soc device
  2025-11-18 13:56 ` [PATCH v2 3/7] soc: samsung: exynos-chipid: use devm action to unregister soc device Tudor Ambarus
@ 2025-11-19 12:13   ` Krzysztof Kozlowski
  2025-11-19 12:30     ` Tudor Ambarus
  0 siblings, 1 reply; 10+ messages in thread
From: Krzysztof Kozlowski @ 2025-11-19 12:13 UTC (permalink / raw)
  To: Tudor Ambarus, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Alim Akhtar, Peter Griffin, André Draszik,
	Srinivas Kandagatla
  Cc: semen.protsenko, willmcvicker, kernel-team, devicetree,
	linux-arm-kernel, linux-samsung-soc, linux-kernel

On 18/11/2025 14:56, Tudor Ambarus wrote:
> Simplify the unwinding of the soc device by using a devm action.
> Add the action before the exynos_asv_init() to avoid an explicit call
> to soc_device_unregister().
> 
> Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
> ---
>  drivers/soc/samsung/exynos-chipid.c | 27 +++++++++++----------------

Can I take the cleanups before new GS support?

That's btw preferred order for all work. Fixes should be independent or
first in the patchset. Then cleanups before features/new support.

Best regards,
Krzysztof


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

* Re: [PATCH v2 3/7] soc: samsung: exynos-chipid: use devm action to unregister soc device
  2025-11-19 12:13   ` Krzysztof Kozlowski
@ 2025-11-19 12:30     ` Tudor Ambarus
  0 siblings, 0 replies; 10+ messages in thread
From: Tudor Ambarus @ 2025-11-19 12:30 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Alim Akhtar, Peter Griffin, André Draszik,
	Srinivas Kandagatla
  Cc: semen.protsenko, willmcvicker, kernel-team, devicetree,
	linux-arm-kernel, linux-samsung-soc, linux-kernel



On 11/19/25 2:13 PM, Krzysztof Kozlowski wrote:
> On 18/11/2025 14:56, Tudor Ambarus wrote:
>> Simplify the unwinding of the soc device by using a devm action.
>> Add the action before the exynos_asv_init() to avoid an explicit call
>> to soc_device_unregister().
>>
>> Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
>> ---
>>  drivers/soc/samsung/exynos-chipid.c | 27 +++++++++++----------------
> 
> Can I take the cleanups before new GS support?

Fine by me. I'll send v3 then, to have the cleanups first.> 
> That's btw preferred order for all work. Fixes should be independent or
> first in the patchset. Then cleanups before features/new support.
I agree for the fixes. In the past I used to do the cleanups before new
support, and I got feedback that the cleanups might delay the integration
of the new support. I'm okay with both approaches, v3 will come.

Thanks,
ta


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

end of thread, other threads:[~2025-11-19 12:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-18 13:56 [PATCH v2 0/7] soc: samsung: exynos-chipid: add gs101 support Tudor Ambarus
2025-11-18 13:56 ` [PATCH v2 1/7] dt-bindings: nvmem: add google,gs101-otp Tudor Ambarus
2025-11-18 13:56 ` [PATCH v2 2/7] soc: samsung: exynos-chipid: add google,gs101-otp support Tudor Ambarus
2025-11-18 13:56 ` [PATCH v2 3/7] soc: samsung: exynos-chipid: use devm action to unregister soc device Tudor Ambarus
2025-11-19 12:13   ` Krzysztof Kozlowski
2025-11-19 12:30     ` Tudor Ambarus
2025-11-18 13:56 ` [PATCH v2 4/7] soc: samsung: exynos-chipid: use dev_err_probe where appropiate Tudor Ambarus
2025-11-18 13:56 ` [PATCH v2 5/7] soc: samsung: exynos-chipid: rename method Tudor Ambarus
2025-11-18 13:56 ` [PATCH v2 6/7] soc: samsung: exynos-chipid: downgrade dev_info to dev_dbg for soc info Tudor Ambarus
2025-11-18 13:56 ` [PATCH v2 7/7] arm64: dts: exynos: gs101: add OTP node Tudor Ambarus

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).