Linux clock framework development
 help / color / mirror / Atom feed
* [PATCH v4 00/13] arm64: add Synaptics SL2610 SoCs and RDK boards
@ 2026-12-04 14:07 Jisheng Zhang
  2026-12-04 14:07 ` [PATCH v4 01/13] arm64: kconfig: let ARCH_BERLIN cover Synaptics arm64 SoCs Jisheng Zhang
                   ` (12 more replies)
  0 siblings, 13 replies; 24+ messages in thread
From: Jisheng Zhang @ 2026-12-04 14:07 UTC (permalink / raw)
  To: Rob Herring, Conor Dooley, Krzysztof Kozlowski, Catalin Marinas,
	Will Deacon, Mark Rutland, Sebastian Hesselbarth, Stephen Boyd,
	Brian Masney, Jerome Brunet, Linus Walleij, Philipp Zabel,
	Lee Jones
  Cc: devicetree, linux-kernel, linux-arm-kernel, linux-clk, linux-gpio,
	mfd, Richard GENOUD

Add initial support for the Synaptics SL261X SoCs and corresponding
RDK boards.

The SL261X SoCs include five pin-to-pin compatible SoCs: SL2611, SL2613,
SL2615, SL2617, and SL2619.

Only reset, pinctrl, clk/pll, uart, gpio, i2c, spi, i3c are included in
this series. The support for Ethernet, USB, SDHCI, CAN, DMAC, XSPI will
be submitted after this series is merged.

Since this series may be split once got acks from maintainers. So a
consolidated MAINTAINERS update will follow once the subsystem series
have merged, avoiding overlapping changes to the Synaptics entry.

Another note: the reset driver use "ENOTSUPP" instead of "EOPNOTSUPP"
to keep unified style with reset core driver.

Hi Linus Walleij, Conor,

I didn't split the series in this version, because the same syscon node
exports reset, pinctl and clk, so I want to collect some acks before
split.

And query one question: the reset IDs, clk IDs header files are
needed by both pinctrl/reset drivers and soc dtsi/dts, so I'm not sure
how to split the series, any suggestion is appreciated.

since v3:
 - use MODULE_LICENSE("GPL")
 - drop "depend on MFD_SL2610_SYSCON" from RESET_SL2610
 - drop "depend on MFD_SL2610_SYSCON" from SL2610_CLK too
 - send out again. I dunno what happened why only 10 patches are
   out

since v2:
 - fix a typo in "GPIO54" offset, 0x887c instead of 0x87c
 - adopt Philipp suggestions into reset-sl2610.c
 - put sl2610-syscon.c into mfd/ instead of soc/synapitcs/
 - dt coding style fixes
 - Drop bootargs
 - Split the binding file
 - move i2c timing properties to board dts

since v1:
 - rebase on latest rcN
 - drop some patches which have been merged
 - let the "gbl" node export pinctrl/reset/clk devices with
   MFD_CELL_NAME()
 - use <linux/platform_device.h> instead of <linux/mod_devicetable.h>
 - adopt some coding suggestions from Uwe
 - Use 0 and 1 to select normal and strong pull-up on 10-bit pads 
 - collect Acked-by tag

Jisheng Zhang (13):
  arm64: kconfig: let ARCH_BERLIN cover Synaptics arm64 SoCs
  pinctrl: berlin: use u16 instead of u8 for the offset
  pinctrl: berlin: enable module build support
  pinctrl: berlin: add optional pinconf support
  dt-bindings: soc: synaptics: add SL2610 system controllers
  mfd: synaptics: add SL2610 system controller support
  reset: add Synaptics SL2610 reset controller support
  pinctrl: berlin: add Synaptics SL2610 pin controller support
  clk: berlin: add Synaptics clock controller helpers
  clk: berlin: add Synaptics SL2610 clocks and PLLs
  dt-bindings: arm: berlin: add Synaptics SL2610 SoCs and RDK boards
  arm64: dts: synaptics: add SL2610 family SoCs
  arm64: dts: synaptics: add SL2610 family RDK boards

 .../bindings/arm/marvell,berlin.yaml          |  20 +
 .../synaptics/syna,sl2610-avio-syscon.yaml    |  44 +
 .../soc/synaptics/syna,sl2610-cpu-syscon.yaml |  58 ++
 .../soc/synaptics/syna,sl2610-mcu-syscon.yaml |  97 +++
 .../soc/synaptics/syna,sl2610-soc-syscon.yaml | 104 +++
 arch/arm64/Kconfig.platforms                  |   4 +-
 arch/arm64/boot/dts/synaptics/Makefile        |   5 +
 arch/arm64/boot/dts/synaptics/sl2611-rdk.dts  |  16 +
 arch/arm64/boot/dts/synaptics/sl2611.dtsi     | 466 +++++++++++
 arch/arm64/boot/dts/synaptics/sl2613-rdk.dts  |  16 +
 arch/arm64/boot/dts/synaptics/sl2613.dtsi     |  12 +
 arch/arm64/boot/dts/synaptics/sl2615-rdk.dts  |  16 +
 arch/arm64/boot/dts/synaptics/sl2615.dtsi     |  46 ++
 arch/arm64/boot/dts/synaptics/sl2617-rdk.dts  |  16 +
 arch/arm64/boot/dts/synaptics/sl2617.dtsi     |  46 ++
 arch/arm64/boot/dts/synaptics/sl2619-rdk.dts  |  16 +
 arch/arm64/boot/dts/synaptics/sl2619.dtsi     |  44 +
 .../boot/dts/synaptics/sl261x-rdk-common.dtsi | 150 ++++
 drivers/clk/Kconfig                           |   1 +
 drivers/clk/berlin/Kconfig                    |  33 +
 drivers/clk/berlin/Makefile                   |   4 +
 drivers/clk/berlin/clk-sl2610.c               | 360 +++++++++
 drivers/clk/berlin/sl-clk.c                   | 279 +++++++
 drivers/clk/berlin/sl-clk.h                   |  31 +
 drivers/clk/berlin/sl-sysmgr-clk.c            | 241 ++++++
 drivers/clk/berlin/sl-sysmgr-clk.h            |  44 +
 drivers/clk/berlin/sl2610-pll.c               | 145 ++++
 drivers/clk/berlin/sl2610-pll.h               |  14 +
 drivers/mfd/Kconfig                           |  16 +
 drivers/mfd/Makefile                          |   1 +
 drivers/mfd/sl2610-syscon.c                   |  84 ++
 drivers/pinctrl/berlin/Kconfig                |  16 +
 drivers/pinctrl/berlin/Makefile               |   1 +
 drivers/pinctrl/berlin/berlin.c               | 255 +++++-
 drivers/pinctrl/berlin/berlin.h               |  17 +-
 drivers/pinctrl/berlin/pinctrl-sl2610.c       | 759 ++++++++++++++++++
 drivers/reset/Kconfig                         |  12 +
 drivers/reset/Makefile                        |   1 +
 drivers/reset/reset-sl2610.c                  | 224 ++++++
 include/dt-bindings/clock/syna,sl2610.h       | 131 +++
 include/dt-bindings/reset/syna,sl2610-reset.h |  80 ++
 41 files changed, 3905 insertions(+), 20 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-avio-syscon.yaml
 create mode 100644 Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-cpu-syscon.yaml
 create mode 100644 Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-mcu-syscon.yaml
 create mode 100644 Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-soc-syscon.yaml
 create mode 100644 arch/arm64/boot/dts/synaptics/sl2611-rdk.dts
 create mode 100644 arch/arm64/boot/dts/synaptics/sl2611.dtsi
 create mode 100644 arch/arm64/boot/dts/synaptics/sl2613-rdk.dts
 create mode 100644 arch/arm64/boot/dts/synaptics/sl2613.dtsi
 create mode 100644 arch/arm64/boot/dts/synaptics/sl2615-rdk.dts
 create mode 100644 arch/arm64/boot/dts/synaptics/sl2615.dtsi
 create mode 100644 arch/arm64/boot/dts/synaptics/sl2617-rdk.dts
 create mode 100644 arch/arm64/boot/dts/synaptics/sl2617.dtsi
 create mode 100644 arch/arm64/boot/dts/synaptics/sl2619-rdk.dts
 create mode 100644 arch/arm64/boot/dts/synaptics/sl2619.dtsi
 create mode 100644 arch/arm64/boot/dts/synaptics/sl261x-rdk-common.dtsi
 create mode 100644 drivers/clk/berlin/Kconfig
 create mode 100644 drivers/clk/berlin/clk-sl2610.c
 create mode 100644 drivers/clk/berlin/sl-clk.c
 create mode 100644 drivers/clk/berlin/sl-clk.h
 create mode 100644 drivers/clk/berlin/sl-sysmgr-clk.c
 create mode 100644 drivers/clk/berlin/sl-sysmgr-clk.h
 create mode 100644 drivers/clk/berlin/sl2610-pll.c
 create mode 100644 drivers/clk/berlin/sl2610-pll.h
 create mode 100644 drivers/mfd/sl2610-syscon.c
 create mode 100644 drivers/pinctrl/berlin/pinctrl-sl2610.c
 create mode 100644 drivers/reset/reset-sl2610.c
 create mode 100644 include/dt-bindings/clock/syna,sl2610.h
 create mode 100644 include/dt-bindings/reset/syna,sl2610-reset.h

-- 
2.55.0


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

* [PATCH v4 01/13] arm64: kconfig: let ARCH_BERLIN cover Synaptics arm64 SoCs
  2026-12-04 14:07 [PATCH v4 00/13] arm64: add Synaptics SL2610 SoCs and RDK boards Jisheng Zhang
@ 2026-12-04 14:07 ` Jisheng Zhang
  2026-12-04 14:07 ` [PATCH v4 02/13] pinctrl: berlin: use u16 instead of u8 for the offset Jisheng Zhang
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 24+ messages in thread
From: Jisheng Zhang @ 2026-12-04 14:07 UTC (permalink / raw)
  To: Rob Herring, Conor Dooley, Krzysztof Kozlowski, Catalin Marinas,
	Will Deacon, Mark Rutland, Sebastian Hesselbarth, Stephen Boyd,
	Brian Masney, Jerome Brunet, Linus Walleij, Philipp Zabel,
	Lee Jones
  Cc: devicetree, linux-kernel, linux-arm-kernel, linux-clk, linux-gpio,
	mfd, Richard GENOUD

Extend ARCH_BERLIN to cover Synaptics arm64 SoCs.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 arch/arm64/Kconfig.platforms | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
index 49dcd7be82ce..b830161fe68b 100644
--- a/arch/arm64/Kconfig.platforms
+++ b/arch/arm64/Kconfig.platforms
@@ -108,13 +108,13 @@ config ARCH_BRCMSTB
 endif
 
 config ARCH_BERLIN
-	bool "Marvell Berlin SoC Family"
+	bool "Synaptics/Marvell Berlin SoC Family"
 	select DW_APB_ICTL
 	select DW_APB_TIMER_OF
 	select GPIOLIB
 	select PINCTRL
 	help
-	  This enables support for Marvell Berlin SoC Family
+	  This enables support for Synaptics SoCs or Marvell Berlin SoC Family
 
 config ARCH_BITMAIN
 	bool "Bitmain SoC Platforms"
-- 
2.55.0


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

* [PATCH v4 02/13] pinctrl: berlin: use u16 instead of u8 for the offset
  2026-12-04 14:07 [PATCH v4 00/13] arm64: add Synaptics SL2610 SoCs and RDK boards Jisheng Zhang
  2026-12-04 14:07 ` [PATCH v4 01/13] arm64: kconfig: let ARCH_BERLIN cover Synaptics arm64 SoCs Jisheng Zhang
@ 2026-12-04 14:07 ` Jisheng Zhang
  2026-12-04 14:07 ` [PATCH v4 03/13] pinctrl: berlin: enable module build support Jisheng Zhang
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 24+ messages in thread
From: Jisheng Zhang @ 2026-12-04 14:07 UTC (permalink / raw)
  To: Rob Herring, Conor Dooley, Krzysztof Kozlowski, Catalin Marinas,
	Will Deacon, Mark Rutland, Sebastian Hesselbarth, Stephen Boyd,
	Brian Masney, Jerome Brunet, Linus Walleij, Philipp Zabel,
	Lee Jones
  Cc: devicetree, linux-kernel, linux-arm-kernel, linux-clk, linux-gpio,
	mfd, Richard GENOUD

The u8 may not be enough for newer Synaptics SoCs.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 drivers/pinctrl/berlin/berlin.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/berlin/berlin.h b/drivers/pinctrl/berlin/berlin.h
index 231aab61d415..7e7096842eda 100644
--- a/drivers/pinctrl/berlin/berlin.h
+++ b/drivers/pinctrl/berlin/berlin.h
@@ -17,7 +17,7 @@ struct berlin_desc_function {
 
 struct berlin_desc_group {
 	const char			*name;
-	u8				offset;
+	u16				offset;
 	u8				bit_width;
 	u8				lsb;
 	struct berlin_desc_function	*functions;
-- 
2.55.0


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

* [PATCH v4 03/13] pinctrl: berlin: enable module build support
  2026-12-04 14:07 [PATCH v4 00/13] arm64: add Synaptics SL2610 SoCs and RDK boards Jisheng Zhang
  2026-12-04 14:07 ` [PATCH v4 01/13] arm64: kconfig: let ARCH_BERLIN cover Synaptics arm64 SoCs Jisheng Zhang
  2026-12-04 14:07 ` [PATCH v4 02/13] pinctrl: berlin: use u16 instead of u8 for the offset Jisheng Zhang
@ 2026-12-04 14:07 ` Jisheng Zhang
  2026-12-04 15:03   ` sashiko-bot
  2026-12-04 14:07 ` [PATCH v4 04/13] pinctrl: berlin: add optional pinconf support Jisheng Zhang
                   ` (9 subsequent siblings)
  12 siblings, 1 reply; 24+ messages in thread
From: Jisheng Zhang @ 2026-12-04 14:07 UTC (permalink / raw)
  To: Rob Herring, Conor Dooley, Krzysztof Kozlowski, Catalin Marinas,
	Will Deacon, Mark Rutland, Sebastian Hesselbarth, Stephen Boyd,
	Brian Masney, Jerome Brunet, Linus Walleij, Philipp Zabel,
	Lee Jones
  Cc: devicetree, linux-kernel, linux-arm-kernel, linux-clk, linux-gpio,
	mfd, Richard GENOUD

For Android GKI + vendor_dlkm deployments, where vendor-specific
drivers must be kept separate from the GKI vmlinux and loaded as
modules from the vendor partition, we need to enable module build
support for berlin pinctrl drivers.

To acchive this goal:

1.Use devm_* APIs to alloc memory, so that we don't need to care free when
unloading.

2.Export two symbols which will be used by SoC pinctrl drivers.

3.Add MODULE_LICENSE and MODULE_DESCRIPTION

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 drivers/pinctrl/berlin/berlin.c | 27 ++++++++++++++-------------
 drivers/pinctrl/berlin/berlin.h | 15 +++++++++++++++
 2 files changed, 29 insertions(+), 13 deletions(-)

diff --git a/drivers/pinctrl/berlin/berlin.c b/drivers/pinctrl/berlin/berlin.c
index 8a612ce2d1d3..9337de1973af 100644
--- a/drivers/pinctrl/berlin/berlin.c
+++ b/drivers/pinctrl/berlin/berlin.c
@@ -215,7 +215,8 @@ static int berlin_pinctrl_build_state(struct platform_device *pdev)
 	}
 
 	/* we will reallocate later */
-	pctrl->functions = kzalloc_objs(*pctrl->functions, max_functions);
+	pctrl->functions = devm_kcalloc(&pdev->dev, max_functions,
+					sizeof(*pctrl->functions), GFP_KERNEL);
 	if (!pctrl->functions)
 		return -ENOMEM;
 
@@ -230,13 +231,11 @@ static int berlin_pinctrl_build_state(struct platform_device *pdev)
 		}
 	}
 
-	new_functions = krealloc(pctrl->functions,
-				    pctrl->nfunctions * sizeof(*pctrl->functions),
-				    GFP_KERNEL);
-	if (!new_functions) {
-		kfree(pctrl->functions);
+	new_functions = devm_krealloc(&pdev->dev, pctrl->functions,
+				      pctrl->nfunctions * sizeof(*pctrl->functions),
+				      GFP_KERNEL);
+	if (!new_functions)
 		return -ENOMEM;
-	}
 
 	pctrl->functions = new_functions;
 	/* map functions to theirs groups */
@@ -257,20 +256,17 @@ static int berlin_pinctrl_build_state(struct platform_device *pdev)
 				function++;
 			}
 
-			if (!found) {
-				kfree(pctrl->functions);
+			if (!found)
 				return -EINVAL;
-			}
 
 			if (!function->groups) {
 				function->groups =
 					devm_kzalloc_objs(&pdev->dev,
 							  *function->groups,
 							  function->ngroups);
-				if (!function->groups) {
-					kfree(pctrl->functions);
+
+				if (!function->groups)
 					return -ENOMEM;
-				}
 			}
 
 			groups = (const char **)function->groups;
@@ -326,6 +322,7 @@ int berlin_pinctrl_probe_regmap(struct platform_device *pdev,
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(berlin_pinctrl_probe_regmap);
 
 int berlin_pinctrl_probe(struct platform_device *pdev,
 			 const struct berlin_pinctrl_desc *desc)
@@ -340,3 +337,7 @@ int berlin_pinctrl_probe(struct platform_device *pdev,
 
 	return berlin_pinctrl_probe_regmap(pdev, desc, regmap);
 }
+EXPORT_SYMBOL_GPL(berlin_pinctrl_probe);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("pinctrl library for Synaptics SoCs");
diff --git a/drivers/pinctrl/berlin/berlin.h b/drivers/pinctrl/berlin/berlin.h
index 7e7096842eda..8ff70d682593 100644
--- a/drivers/pinctrl/berlin/berlin.h
+++ b/drivers/pinctrl/berlin/berlin.h
@@ -20,6 +20,8 @@ struct berlin_desc_group {
 	u16				offset;
 	u8				bit_width;
 	u8				lsb;
+	u16				conf_offset;
+	u8				conf_bits;
 	struct berlin_desc_function	*functions;
 };
 
@@ -28,6 +30,19 @@ struct berlin_pinctrl_desc {
 	unsigned			ngroups;
 };
 
+#define BERLIN_PINCTRLCONF_GROUP(_name, _offset, _width, _lsb,		\
+		_conf_offset, _conf_bits, ...)				\
+	{								\
+		.name = _name,						\
+		.offset = _offset,					\
+		.bit_width = _width,					\
+		.lsb = _lsb,						\
+		.conf_offset = _conf_offset,				\
+		.conf_bits = _conf_bits,				\
+		.functions = (struct berlin_desc_function[]){		\
+			__VA_ARGS__, { } },				\
+	}
+
 #define BERLIN_PINCTRL_GROUP(_name, _offset, _width, _lsb, ...)		\
 	{								\
 		.name = _name,						\
-- 
2.55.0


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

* [PATCH v4 04/13] pinctrl: berlin: add optional pinconf support
  2026-12-04 14:07 [PATCH v4 00/13] arm64: add Synaptics SL2610 SoCs and RDK boards Jisheng Zhang
                   ` (2 preceding siblings ...)
  2026-12-04 14:07 ` [PATCH v4 03/13] pinctrl: berlin: enable module build support Jisheng Zhang
@ 2026-12-04 14:07 ` Jisheng Zhang
  2026-12-04 15:22   ` sashiko-bot
  2026-12-04 14:07 ` [PATCH v4 05/13] dt-bindings: soc: synaptics: add SL2610 system controllers Jisheng Zhang
                   ` (8 subsequent siblings)
  12 siblings, 1 reply; 24+ messages in thread
From: Jisheng Zhang @ 2026-12-04 14:07 UTC (permalink / raw)
  To: Rob Herring, Conor Dooley, Krzysztof Kozlowski, Catalin Marinas,
	Will Deacon, Mark Rutland, Sebastian Hesselbarth, Stephen Boyd,
	Brian Masney, Jerome Brunet, Linus Walleij, Philipp Zabel,
	Lee Jones
  Cc: devicetree, linux-kernel, linux-arm-kernel, linux-clk, linux-gpio,
	mfd, Richard GENOUD

Add pin configuration support for newer Synaptics SoCs.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 drivers/pinctrl/berlin/Kconfig  |   1 +
 drivers/pinctrl/berlin/berlin.c | 228 +++++++++++++++++++++++++++++++-
 2 files changed, 225 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/berlin/Kconfig b/drivers/pinctrl/berlin/Kconfig
index 9b1644d1d4ea..abb1c912b9ba 100644
--- a/drivers/pinctrl/berlin/Kconfig
+++ b/drivers/pinctrl/berlin/Kconfig
@@ -3,6 +3,7 @@ if (ARCH_BERLIN || COMPILE_TEST)
 
 config PINCTRL_BERLIN
 	bool
+	select GENERIC_PINCONF
 	select PINMUX
 	select REGMAP_MMIO
 
diff --git a/drivers/pinctrl/berlin/berlin.c b/drivers/pinctrl/berlin/berlin.c
index 9337de1973af..82215c36b856 100644
--- a/drivers/pinctrl/berlin/berlin.c
+++ b/drivers/pinctrl/berlin/berlin.c
@@ -7,12 +7,15 @@
  * Antoine Ténart <antoine.tenart@free-electrons.com>
  */
 
+#include <linux/bitfield.h>
 #include <linux/io.h>
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_device.h>
+#include <linux/pinctrl/pinconf-generic.h>
+#include <linux/pinctrl/pinconf.h>
 #include <linux/pinctrl/pinctrl.h>
 #include <linux/pinctrl/pinmux.h>
 #include <linux/platform_device.h>
@@ -20,9 +23,24 @@
 #include <linux/slab.h>
 
 #include "../core.h"
+#include "../pinconf.h"
 #include "../pinctrl-utils.h"
 #include "berlin.h"
 
+#define PINCFG_DS_10BIT		GENMASK(3, 0)
+#define PINCFG_IE_10BIT		BIT(4)
+#define PINCFG_PE_10BIT		BIT(5)
+#define PINCFG_PS_10BIT		BIT(6)
+#define PINCFG_SL_10BIT		BIT(7)
+#define PINCFG_SPU_10BIT	BIT(8)
+#define PINCFG_ST_10BIT		BIT(9)
+#define PINCFG_DS_8BIT		GENMASK(2, 0)
+#define PINCFG_IE_8BIT		BIT(3)
+#define PINCFG_PD_8BIT		BIT(4)
+#define PINCFG_PU_8BIT		BIT(5)
+#define PINCFG_SL_8BIT		BIT(6)
+#define PINCFG_ST_8BIT		BIT(7)
+
 struct berlin_pinctrl {
 	struct regmap *regmap;
 	struct device *dev;
@@ -56,6 +74,8 @@ static int berlin_pinctrl_dt_node_to_map(struct pinctrl_dev *pctrl_dev,
 	struct property *prop;
 	const char *function_name, *group_name;
 	unsigned reserved_maps = 0;
+	unsigned long *configs = NULL;
+	unsigned int num_configs = 0;
 	int ret, ngroups;
 
 	*map = NULL;
@@ -75,11 +95,19 @@ static int berlin_pinctrl_dt_node_to_map(struct pinctrl_dev *pctrl_dev,
 		return -EINVAL;
 	}
 
+	ret = pinconf_generic_parse_dt_config(node, pctrl_dev, &configs,
+					      &num_configs);
+	if (ret < 0) {
+		dev_err(pctrl->dev, "%s: could not parse node property\n",
+			node->name);
+		return ret;
+	}
+
 	ret = pinctrl_utils_reserve_map(pctrl_dev, map, &reserved_maps,
-					num_maps, ngroups);
+					num_maps, ngroups * (num_configs + 1));
 	if (ret) {
 		dev_err(pctrl->dev, "can't reserve map: %d\n", ret);
-		return ret;
+		goto exit;
 	}
 
 	of_property_for_each_string(node, "groups", prop, group_name) {
@@ -88,11 +116,22 @@ static int berlin_pinctrl_dt_node_to_map(struct pinctrl_dev *pctrl_dev,
 						function_name);
 		if (ret) {
 			dev_err(pctrl->dev, "can't add map: %d\n", ret);
-			return ret;
+			goto exit;
+		}
+
+		if (num_configs) {
+			ret = pinctrl_utils_add_map_configs(pctrl_dev, map,
+					&reserved_maps, num_maps, group_name,
+					configs, num_configs,
+					PIN_MAP_TYPE_CONFIGS_GROUP);
+			if (ret < 0)
+				goto exit;
 		}
 	}
 
-	return 0;
+exit:
+	kfree(configs);
+	return ret;
 }
 
 static const struct pinctrl_ops berlin_pinctrl_ops = {
@@ -177,6 +216,186 @@ static const struct pinmux_ops berlin_pinmux_ops = {
 	.set_mux		= &berlin_pinmux_set,
 };
 
+static int berlin_pinconf_group_get(struct pinctrl_dev *pctrl_dev,
+				    unsigned int group, unsigned long *configs)
+{
+	enum pin_config_param param = pinconf_to_config_param(*configs);
+	struct berlin_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctrl_dev);
+	const struct berlin_desc_group *group_desc = pctrl->desc->groups + group;
+	bool enabled;
+	u32 val;
+	int ret;
+	u8 conf_bits = group_desc->conf_bits;
+
+	if (!conf_bits)
+		return -EOPNOTSUPP;
+
+	ret = regmap_read(pctrl->regmap, group_desc->conf_offset, &val);
+	if (ret)
+		return ret;
+
+	switch (param) {
+	case PIN_CONFIG_BIAS_DISABLE:
+		if (conf_bits == 10)
+			enabled = !(val & PINCFG_PE_10BIT);
+		else
+			enabled = !(val & (PINCFG_PD_8BIT | PINCFG_PU_8BIT));
+		val = 0;
+		break;
+	case PIN_CONFIG_BIAS_PULL_DOWN:
+		if (conf_bits == 10)
+			enabled = (val & (PINCFG_PE_10BIT | PINCFG_PS_10BIT)) == PINCFG_PE_10BIT;
+		else
+			enabled = val & PINCFG_PD_8BIT;
+		val = enabled ? 1 : 0;
+		break;
+	case PIN_CONFIG_BIAS_PULL_UP:
+		if (conf_bits == 10)
+			enabled = (val & (PINCFG_PE_10BIT | PINCFG_PS_10BIT)) ==
+				  (PINCFG_PE_10BIT | PINCFG_PS_10BIT);
+		else
+			enabled = val & PINCFG_PU_8BIT;
+		val = enabled ? 1 : 0;
+		break;
+	case PIN_CONFIG_DRIVE_STRENGTH:
+		enabled = true;
+		if (conf_bits == 10)
+			val = FIELD_GET(PINCFG_DS_10BIT, val);
+		else
+			val = FIELD_GET(PINCFG_DS_8BIT, val);
+		break;
+	case PIN_CONFIG_INPUT_ENABLE:
+		if (conf_bits == 10)
+			enabled = val & PINCFG_IE_10BIT;
+		else
+			enabled = val & PINCFG_IE_8BIT;
+		val = enabled ? 1 : 0;
+		break;
+	case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
+		if (conf_bits == 10)
+			enabled = val & PINCFG_ST_10BIT;
+		else
+			enabled = val & PINCFG_ST_8BIT;
+		val = enabled ? 1 : 0;
+		break;
+	case PIN_CONFIG_SLEW_RATE:
+		if (conf_bits == 10)
+			enabled = val & PINCFG_SL_10BIT;
+		else
+			enabled = val & PINCFG_SL_8BIT;
+		val = enabled ? 1 : 0;
+		break;
+	default:
+		return -EOPNOTSUPP;
+	}
+
+	*configs = pinconf_to_config_packed(param, val);
+	return enabled ? 0 : -EINVAL;
+}
+
+static int berlin_pinconf_group_set(struct pinctrl_dev *pctrl_dev,
+				    unsigned int group, unsigned long *configs,
+				    unsigned int nconfigs)
+{
+	struct berlin_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctrl_dev);
+	const struct berlin_desc_group *group_desc = pctrl->desc->groups + group;
+	u8 conf_bits = group_desc->conf_bits;
+	u32 mask = 0, val = 0;
+	int i;
+
+	if (!conf_bits)
+		return -EOPNOTSUPP;
+
+	for (i = 0; i < nconfigs; i++) {
+		enum pin_config_param param =
+					pinconf_to_config_param(configs[i]);
+		u32 arg = pinconf_to_config_argument(configs[i]);
+
+		switch (param) {
+		case PIN_CONFIG_BIAS_DISABLE:
+		case PIN_CONFIG_BIAS_PULL_DOWN:
+		case PIN_CONFIG_BIAS_PULL_UP:
+			if (param != PIN_CONFIG_BIAS_DISABLE && arg > 1)
+				return -EINVAL;
+
+			if (conf_bits == 10) {
+				mask |= PINCFG_PE_10BIT | PINCFG_PS_10BIT |
+					PINCFG_SPU_10BIT;
+				val &= ~(PINCFG_PE_10BIT | PINCFG_PS_10BIT |
+					 PINCFG_SPU_10BIT);
+				if (param != PIN_CONFIG_BIAS_DISABLE && arg) {
+					val |= PINCFG_PE_10BIT;
+					if (param == PIN_CONFIG_BIAS_PULL_UP)
+						val |= PINCFG_PS_10BIT;
+				}
+			} else {
+				mask |= PINCFG_PU_8BIT | PINCFG_PD_8BIT;
+				val &= ~(PINCFG_PU_8BIT | PINCFG_PD_8BIT);
+				if (param != PIN_CONFIG_BIAS_DISABLE && arg)
+					val |= param == PIN_CONFIG_BIAS_PULL_UP ?
+						PINCFG_PU_8BIT : PINCFG_PD_8BIT;
+			}
+			break;
+		case PIN_CONFIG_DRIVE_STRENGTH:
+			if (conf_bits == 10) {
+				if (arg > FIELD_MAX(PINCFG_DS_10BIT))
+					return -EINVAL;
+				mask |= PINCFG_DS_10BIT;
+				val |= FIELD_PREP(PINCFG_DS_10BIT, arg);
+			} else {
+				if (arg > FIELD_MAX(PINCFG_DS_8BIT))
+					return -EINVAL;
+				mask |= PINCFG_DS_8BIT;
+				val |= FIELD_PREP(PINCFG_DS_8BIT, arg);
+			}
+			break;
+		case PIN_CONFIG_INPUT_ENABLE:
+			if (conf_bits == 10) {
+				mask |= PINCFG_IE_10BIT;
+				if (arg)
+					val |= PINCFG_IE_10BIT;
+			} else {
+				mask |= PINCFG_IE_8BIT;
+				if (arg)
+					val |= PINCFG_IE_8BIT;
+			}
+			break;
+		case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
+			if (conf_bits == 10) {
+				mask |= PINCFG_ST_10BIT;
+				if (arg)
+					val |= PINCFG_ST_10BIT;
+			} else {
+				mask |= PINCFG_ST_8BIT;
+				if (arg)
+					val |= PINCFG_ST_8BIT;
+			}
+			break;
+		case PIN_CONFIG_SLEW_RATE:
+			if (conf_bits == 10) {
+				mask |= PINCFG_SL_10BIT;
+				if (arg)
+					val |= PINCFG_SL_10BIT;
+			} else {
+				mask |= PINCFG_SL_8BIT;
+				if (arg)
+					val |= PINCFG_SL_8BIT;
+			}
+			break;
+		default:
+			return -EOPNOTSUPP;
+		}
+	}
+
+	return regmap_update_bits(pctrl->regmap, group_desc->conf_offset, mask, val);
+}
+
+static const struct pinconf_ops berlin_confops = {
+	.is_generic = true,
+	.pin_config_group_get = berlin_pinconf_group_get,
+	.pin_config_group_set = berlin_pinconf_group_set,
+};
+
 static int berlin_pinctrl_add_function(struct berlin_pinctrl *pctrl,
 				       const char *name)
 {
@@ -286,6 +505,7 @@ static const struct pinctrl_desc berlin_pctrl_desc = {
 	.name		= "berlin-pinctrl",
 	.pctlops	= &berlin_pinctrl_ops,
 	.pmxops		= &berlin_pinmux_ops,
+	.confops	= &berlin_confops,
 	.owner		= THIS_MODULE,
 };
 
-- 
2.55.0


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

* [PATCH v4 05/13] dt-bindings: soc: synaptics: add SL2610 system controllers
  2026-12-04 14:07 [PATCH v4 00/13] arm64: add Synaptics SL2610 SoCs and RDK boards Jisheng Zhang
                   ` (3 preceding siblings ...)
  2026-12-04 14:07 ` [PATCH v4 04/13] pinctrl: berlin: add optional pinconf support Jisheng Zhang
@ 2026-12-04 14:07 ` Jisheng Zhang
  2026-12-04 15:41   ` sashiko-bot
  2026-12-04 14:07 ` [PATCH v4 06/13] mfd: synaptics: add SL2610 system controller support Jisheng Zhang
                   ` (7 subsequent siblings)
  12 siblings, 1 reply; 24+ messages in thread
From: Jisheng Zhang @ 2026-12-04 14:07 UTC (permalink / raw)
  To: Rob Herring, Conor Dooley, Krzysztof Kozlowski, Catalin Marinas,
	Will Deacon, Mark Rutland, Sebastian Hesselbarth, Stephen Boyd,
	Brian Masney, Jerome Brunet, Linus Walleij, Philipp Zabel,
	Lee Jones
  Cc: devicetree, linux-kernel, linux-arm-kernel, linux-clk, linux-gpio,
	mfd, Richard GENOUD

Describe the SoC, MCU, AVIO and CPU system control blocks, including their
clock inputs, clock and reset providers, and pin configuration subnodes.
The clock and reset providers share each register block node.

Add the clock and reset identifiers used by consumers of these blocks.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 .../synaptics/syna,sl2610-avio-syscon.yaml    |  44 ++++++
 .../soc/synaptics/syna,sl2610-cpu-syscon.yaml |  58 ++++++++
 .../soc/synaptics/syna,sl2610-mcu-syscon.yaml |  97 +++++++++++++
 .../soc/synaptics/syna,sl2610-soc-syscon.yaml | 104 ++++++++++++++
 include/dt-bindings/clock/syna,sl2610.h       | 131 ++++++++++++++++++
 include/dt-bindings/reset/syna,sl2610-reset.h |  80 +++++++++++
 6 files changed, 514 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-avio-syscon.yaml
 create mode 100644 Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-cpu-syscon.yaml
 create mode 100644 Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-mcu-syscon.yaml
 create mode 100644 Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-soc-syscon.yaml
 create mode 100644 include/dt-bindings/clock/syna,sl2610.h
 create mode 100644 include/dt-bindings/reset/syna,sl2610-reset.h

diff --git a/Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-avio-syscon.yaml b/Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-avio-syscon.yaml
new file mode 100644
index 000000000000..92e64f53524c
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-avio-syscon.yaml
@@ -0,0 +1,44 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/synaptics/syna,sl2610-avio-syscon.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Synaptics SL2610 AVIO audio PLL controller
+
+maintainers:
+  - Jisheng Zhang <jszhang@kernel.org>
+
+description: |
+  The SL2610 AVIO system control block contains the audio PLLs. The
+  external reference clock supplies the PLL input. This binding does not
+  expose clock specifiers for this block.
+
+properties:
+  compatible:
+    items:
+      - const: syna,sl2610-avio-syscon
+      - const: syscon
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+    description: External reference clock input.
+
+required:
+  - compatible
+  - reg
+  - clocks
+
+additionalProperties: false
+
+examples:
+  - |
+    syscon@f7490000 {
+        compatible = "syna,sl2610-avio-syscon", "syscon";
+        reg = <0xf7490000 0x4000>;
+        clocks = <&osc>;
+    };
+...
diff --git a/Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-cpu-syscon.yaml b/Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-cpu-syscon.yaml
new file mode 100644
index 000000000000..25af41f158e0
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-cpu-syscon.yaml
@@ -0,0 +1,58 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/synaptics/syna,sl2610-cpu-syscon.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Synaptics SL2610 CPU clock controller
+
+maintainers:
+  - Jisheng Zhang <jszhang@kernel.org>
+
+description: |
+  The SL2610 CPU system control block contains the CPU PLL and clock
+  controls for the CPU cores and DynamIQ Shared Unit. Clock specifiers refer
+  directly to this node, using indices from <dt-bindings/clock/syna,sl2610.h>.
+
+  The PLL bypass control resides in the SoC system control block, referenced
+  by syna,gbl-syscon.
+
+properties:
+  compatible:
+    items:
+      - const: syna,sl2610-cpu-syscon
+      - const: syscon
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+    description: External reference clock input.
+
+  '#clock-cells':
+    const: 1
+
+  syna,gbl-syscon:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: Phandle to the SoC system control registers for CPU PLL bypass.
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - '#clock-cells'
+  - syna,gbl-syscon
+
+additionalProperties: false
+
+examples:
+  - |
+    syscon@f7e30000 {
+        compatible = "syna,sl2610-cpu-syscon", "syscon";
+        reg = <0xf7e30000 0x4000>;
+        #clock-cells = <1>;
+        clocks = <&osc>;
+        syna,gbl-syscon = <&chip>;
+    };
+...
diff --git a/Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-mcu-syscon.yaml b/Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-mcu-syscon.yaml
new file mode 100644
index 000000000000..9902908a5798
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-mcu-syscon.yaml
@@ -0,0 +1,97 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/synaptics/syna,sl2610-mcu-syscon.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Synaptics SL2610 MCU pin, clock and reset controller
+
+maintainers:
+  - Jisheng Zhang <jszhang@kernel.org>
+
+description: |
+  The SL2610 MCU system control block contains pin multiplexing and pad
+  configuration registers, clock controllers, and reset controllers for the
+  MCU domain.
+
+  Pin group configurations are direct children of this node. Clock and reset
+  specifiers refer directly to this node. Clock indices are defined in
+  <dt-bindings/clock/syna,sl2610.h> and reset indices in
+  <dt-bindings/reset/syna,sl2610-reset.h>.
+
+properties:
+  compatible:
+    items:
+      - const: syna,sl2610-mcu-syscon
+      - const: syscon
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+    description: External reference clock input.
+
+  '#clock-cells':
+    const: 1
+
+  '#reset-cells':
+    const: 1
+
+patternProperties:
+  '-(pmux|pins)$':
+    type: object
+    description: Pin group mux and electrical configuration.
+    allOf:
+      - $ref: /schemas/pinctrl/pinmux-node.yaml#
+      - $ref: /schemas/pinctrl/pincfg-node.yaml#
+    properties:
+      groups:
+        $ref: /schemas/types.yaml#/definitions/string-array
+      function:
+        $ref: /schemas/types.yaml#/definitions/string
+      bias-pull-up:
+        description: |
+          Enable the default pull-up with a boolean or 1, or disable it with 0.
+          Pull resistance is not selectable.
+        oneOf:
+          - type: boolean
+          - $ref: /schemas/types.yaml#/definitions/uint32
+            enum: [0, 1]
+      bias-pull-down:
+        description: |
+          Enable the default pull-down with a boolean or 1, or disable it with 0.
+          Pull resistance is not selectable.
+        oneOf:
+          - type: boolean
+          - $ref: /schemas/types.yaml#/definitions/uint32
+            enum: [0, 1]
+    required:
+      - groups
+      - function
+    unevaluatedProperties: false
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - '#clock-cells'
+  - '#reset-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    syscon@e5025000 {
+        compatible = "syna,sl2610-mcu-syscon", "syscon";
+        reg = <0xe5025000 0x1000>;
+        #clock-cells = <1>;
+        #reset-cells = <1>;
+        clocks = <&osc>;
+
+        i2c0-pmux {
+            function = "tw0";
+            groups = "SM_GPIO12", "SM_GPIO13";
+        };
+    };
+...
diff --git a/Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-soc-syscon.yaml b/Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-soc-syscon.yaml
new file mode 100644
index 000000000000..7c31689864dc
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-soc-syscon.yaml
@@ -0,0 +1,104 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/synaptics/syna,sl2610-soc-syscon.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Synaptics SL2610 SoC pin, clock and reset controller
+
+maintainers:
+  - Jisheng Zhang <jszhang@kernel.org>
+
+description: |
+  The SL2610 SoC system control block contains pin multiplexing and pad
+  configuration registers, clock controllers, and reset controllers. It also
+  contains peripheral control registers accessed through the syscon interface.
+
+  Pin group configurations are direct children of this node. Clock and reset
+  specifiers refer directly to this node. Clock indices are defined in
+  <dt-bindings/clock/syna,sl2610.h> and reset indices in
+  <dt-bindings/reset/syna,sl2610-reset.h>.
+
+properties:
+  compatible:
+    items:
+      - const: syna,sl2610-soc-syscon
+      - const: syscon
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+    description: External reference clock input.
+
+  '#clock-cells':
+    const: 1
+
+  '#reset-cells':
+    const: 1
+
+patternProperties:
+  '-(pmux|pins)$':
+    type: object
+    description: Pin group mux and electrical configuration.
+    allOf:
+      - $ref: /schemas/pinctrl/pinmux-node.yaml#
+      - $ref: /schemas/pinctrl/pincfg-node.yaml#
+    properties:
+      groups:
+        $ref: /schemas/types.yaml#/definitions/string-array
+      function:
+        $ref: /schemas/types.yaml#/definitions/string
+      bias-pull-up:
+        description: |
+          Enable the default pull-up with a boolean or 1, or disable it with 0.
+          Pull resistance is not selectable.
+        oneOf:
+          - type: boolean
+          - $ref: /schemas/types.yaml#/definitions/uint32
+            enum: [0, 1]
+      bias-pull-down:
+        description: |
+          Enable the default pull-down with a boolean or 1, or disable it with 0.
+          Pull resistance is not selectable.
+        oneOf:
+          - type: boolean
+          - $ref: /schemas/types.yaml#/definitions/uint32
+            enum: [0, 1]
+    required:
+      - groups
+      - function
+    unevaluatedProperties: false
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - '#clock-cells'
+  - '#reset-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    syscon@f7e10000 {
+        compatible = "syna,sl2610-soc-syscon", "syscon";
+        reg = <0xf7e10000 0x10000>;
+        #clock-cells = <1>;
+        #reset-cells = <1>;
+        clocks = <&osc>;
+
+        i2c2-pmux {
+            function = "tw2";
+            groups = "GPIO23", "GPIO24";
+            bias-pull-up;
+        };
+
+        i2c3-pmux {
+            function = "tw3";
+            groups = "GPIO27", "GPIO28";
+            bias-pull-up = <1>;
+        };
+    };
+...
diff --git a/include/dt-bindings/clock/syna,sl2610.h b/include/dt-bindings/clock/syna,sl2610.h
new file mode 100644
index 000000000000..c563a2b5ed06
--- /dev/null
+++ b/include/dt-bindings/clock/syna,sl2610.h
@@ -0,0 +1,131 @@
+/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
+/*
+ * Synaptics SL2610 clock tree IDs
+ *
+ * Copyright (C) 2025 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <jszhang@kernel.org>
+ */
+
+/* SoC domain */
+
+/* GBL common clks */
+#define CLK_CPUFASTREF		0
+#define CLK_MEMFASTREF		1
+#define CLK_CFG			2
+#define CLK_SYS			3
+#define CLK_PERIFSYS		4
+#define CLK_APBCORE		5
+#define CLK_APBSER		6
+#define CLK_ATB			7
+#define CLK_HPC			8
+#define CLK_EMMC		9
+#define CLK_SD0			10
+#define CLK_SD1			11
+#define CLK_GETHRGMII		12
+#define CLK_GETHRGMII1		13
+#define CLK_GE0_PTP_REF		14
+#define CLK_GE1_PTP_REF		15
+#define CLK_USB2TEST		16
+#define CLK_USB2TEST480MG0	17
+#define CLK_USB2TEST480MG1	18
+#define CLK_USB2TEST480MG2	19
+#define CLK_USB2TEST100MG0	20
+#define CLK_USB2TEST100MG1	21
+#define CLK_USB2TEST100MG2	22
+#define CLK_USB2TEST100MG3	23
+#define CLK_PERIFTEST125MG0	24
+#define CLK_PERIFTEST200MG0	25
+#define CLK_PERIFTEST200MG1	26
+#define CLK_GPU			27
+#define CLK_NPU			28
+#define CLK_AVIOSYS		29
+#define CLK_AIOSYS		30
+#define CLK_AVIO_LCDC2SCAN	31
+#define CLK_AVIO_IPI		32
+#define CLK_AVIO_P		33
+#define CLK_AVIO_DPHYRXTXESC	34
+#define CLK_AVIOFPLL		35
+#define CLK_AVIO_RX_SCANBYTE	36
+#define CLK_AVIO_RX_SCANTEST	37
+
+/* GBL gate clks */
+#define CLK_USB0CORE		38
+#define CLK_SDIOSYS		39
+#define CLK_EMMCSYS		40
+#define CLK_GPUAXI		41
+#define CLK_GETHRGMIISYS	42
+#define CLK_SDIO1SYS		43
+#define CLK_USB1CORE		44
+#define CLK_GETHRGMII1SYS	45
+#define CLK_USB0PHYREF		46
+#define CLK_USB1PHYREF		47
+#define CLK_APBUART0		48
+#define CLK_APBUART1		49
+#define CLK_APBUART2		50
+#define CLK_APBUART3		51
+#define CLK_APBI2C0		52
+#define CLK_APBI2C1		53
+#define CLK_APBSPI0		54
+#define CLK_APBSPI1		55
+#define CLK_APBSPI2		56
+#define CLK_APBSPI3		57
+#define CLK_APBGPIO		58
+#define CLK_APBTIMERS		59
+#define CLK_APBSYSCNT		60
+#define CLK_APBWDT		61
+#define CLK_APBDMA		62
+#define SL2610_CLK_MAX		63
+
+/* cpuss */
+#define CLK_CPU0		0
+#define CLK_CPU1		1
+#define CLK_DSU			2
+#define SL2610_CPU_CLK_MAX	3
+
+
+/* sysmgr domain */
+
+#define CLK_CFG_UART0		0
+#define CLK_SER_UART0		1
+#define CLK_CFG_UART1		2
+#define CLK_CFG_UART2		3
+#define CLK_CFG_UART3		4
+#define CLK_CFG_GPIO		5
+#define CLK_CFG_I2CM0		6
+#define CLK_CFG_I2CM1		7
+#define CLK_CFG_SPIM		8
+#define CLK_CFG_SPIS		9
+#define CLK_CFG_I3C		10
+#define CLK_CFG_XSPI		11
+#define CLK_AXI_XSPI		12
+#define CLK_CFG_PVT		13
+#define CLK_CFG_ADC		14
+#define CLK_CFG_PWM		15
+#define CLK_BUS_CAN0		16
+#define CLK_BUS_CAN1		17
+#define CLK_CFG_PDM		18
+
+#define CLK_SER_UART1		19
+#define CLK_SER_UART2		20
+#define CLK_SER_UART3		21
+#define CLK_DEB_GPIO		22
+#define CLK_SER_I2CM0		23
+#define CLK_SER_I2CM1		24
+#define CLK_SER_SPIM		25
+#define CLK_SER_SPIS		26
+#define CLK_SER_I3C		27
+#define CLK_SER_XSPI		28
+#define CLK_HS_PVT		29
+#define CLK_CORE_ADC		30
+#define CLK_SER_PWM		31
+#define CLK_SER_CAN0		32
+#define CLK_SER_CAN1		33
+#define CLK_SER_PDM		34
+#define CLK_REF_CALIB		35
+
+#define CLK_MCU_REF		36
+#define CLK_MCU_PLL		37
+#define CLK_MCU_IO_PLL		38
+#define CLK_MCU_APB		39
+#define CLK_MCU_AXI		40
diff --git a/include/dt-bindings/reset/syna,sl2610-reset.h b/include/dt-bindings/reset/syna,sl2610-reset.h
new file mode 100644
index 000000000000..909d63147692
--- /dev/null
+++ b/include/dt-bindings/reset/syna,sl2610-reset.h
@@ -0,0 +1,80 @@
+/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
+/*
+ * Copyright (C) 2026 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <jszhang@kernel.org>
+ */
+
+#ifndef _DT_BINDINGS_SL2610_RESET_H
+#define _DT_BINDINGS_SL2610_RESET_H
+
+/* ACPU subsystem */
+#define RST_SOC_SDIO0		0
+#define RST_SOC_USB0		1
+#define RST_SOC_EMMC		2
+#define RST_SOC_GETH0		3
+#define RST_SOC_SDIO1		4
+#define RST_SOC_USB1		5
+#define RST_SOC_GETH1		6
+#define RST_SOC_USB0PHY		7
+#define RST_SOC_USB0CORE	8
+#define RST_SOC_USB0MAHB	9
+#define RST_SOC_USB1PHY		10
+#define RST_SOC_USB1CORE	11
+#define RST_SOC_USB1MAHB	12
+#define RST_SOC_UART0		13
+#define RST_SOC_UART1		14
+#define RST_SOC_UART2		15
+#define RST_SOC_UART3		16
+#define RST_SOC_I2C0		17
+#define RST_SOC_I2C1		18
+#define RST_SOC_SPI0		19
+#define RST_SOC_SPI1		20
+#define RST_SOC_SPI2		21
+#define RST_SOC_SPI3		22
+#define RST_SOC_APBTIMERS	23
+#define RST_SOC_APBSYSCNT	24
+#define RST_SOC_APBWDT		25
+#define RST_SOC_APBGPIO		26
+#define RST_SOC_APBDMA		27
+#define RST_SOC_GPUCORE		28
+#define RST_SOC_NPUCORE		29
+#define RST_SOC_AVIOAIOG	30
+#define RST_SOC_AVIOVPPG	31
+#define RST_SOC_AVIOVIPG	32
+
+/* system subsystem */
+#define RST_SM_ADCCORE		0
+#define RST_SM_ADCPRST		1
+#define RST_SM_CAN0PRST		2
+#define RST_SM_CAN0SRST		3
+#define RST_SM_CAN1PRST		4
+#define RST_SM_CAN1SRST		5
+#define RST_SM_GPIOPRST		6
+#define RST_SM_GPIOSRST		7
+#define RST_SM_I2CM0PRST	8
+#define RST_SM_I2CM0SRST	9
+#define RST_SM_I2CM1PRST	10
+#define RST_SM_I2CM1SRST	11
+#define RST_SM_I3CPRST		12
+#define RST_SM_I3CSRST		13
+#define RST_SM_PDMPRST		14
+#define RST_SM_PDMSRST		15
+#define RST_SM_PVTHSRST		16
+#define RST_SM_PVTPRST		17
+#define RST_SM_PWMPERIRST	18
+#define RST_SM_PWMPRST		19
+#define RST_SM_SPIMPRST		20
+#define RST_SM_SPIMSRST		21
+#define RST_SM_SPISPRST		22
+#define RST_SM_SPISSRST		23
+#define RST_SM_UART0PRST	24
+#define RST_SM_UART0SRST	25
+#define RST_SM_UART1PRST	26
+#define RST_SM_UART1SRST	27
+#define RST_SM_UART2PRST	28
+#define RST_SM_UART2SRST	29
+#define RST_SM_UART3PRST	30
+#define RST_SM_UART3SRST	31
+
+#endif /* _DT_BINDINGS_SL2610_RESET_H */
-- 
2.55.0


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

* [PATCH v4 06/13] mfd: synaptics: add SL2610 system controller support
  2026-12-04 14:07 [PATCH v4 00/13] arm64: add Synaptics SL2610 SoCs and RDK boards Jisheng Zhang
                   ` (4 preceding siblings ...)
  2026-12-04 14:07 ` [PATCH v4 05/13] dt-bindings: soc: synaptics: add SL2610 system controllers Jisheng Zhang
@ 2026-12-04 14:07 ` Jisheng Zhang
  2026-12-04 15:58   ` sashiko-bot
  2026-12-04 14:07 ` [PATCH v4 07/13] reset: add Synaptics SL2610 reset " Jisheng Zhang
                   ` (6 subsequent siblings)
  12 siblings, 1 reply; 24+ messages in thread
From: Jisheng Zhang @ 2026-12-04 14:07 UTC (permalink / raw)
  To: Rob Herring, Conor Dooley, Krzysztof Kozlowski, Catalin Marinas,
	Will Deacon, Mark Rutland, Sebastian Hesselbarth, Stephen Boyd,
	Brian Masney, Jerome Brunet, Linus Walleij, Philipp Zabel,
	Lee Jones
  Cc: devicetree, linux-kernel, linux-arm-kernel, linux-clk, linux-gpio,
	mfd, Richard GENOUD

Create the clock, reset and pin controller platform devices implemented
by each SL2610 system control block. Select the appropriate MFD cells
from per-block compatible data while keeping register access available
through the shared syscon.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 drivers/mfd/Kconfig         | 16 +++++++
 drivers/mfd/Makefile        |  1 +
 drivers/mfd/sl2610-syscon.c | 84 +++++++++++++++++++++++++++++++++++++
 3 files changed, 101 insertions(+)
 create mode 100644 drivers/mfd/sl2610-syscon.c

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 87ed55c155f0..687012727bb5 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -1656,6 +1656,22 @@ config MFD_SUN6I_PRCM
 	  in the A31, A23, and A33 SoCs. Other Allwinner SoCs contain similar
 	  hardware, but they do not use this driver.
 
+config MFD_SL2610_SYSCON
+	tristate "Synaptics SL2610 system controller"
+	depends on ARCH_BERLIN || COMPILE_TEST
+	depends on OF && HAS_IOMEM
+	select MFD_CORE
+	select MFD_SYSCON
+	help
+	  Support the global and control register blocks on Synaptics SL2610
+	  SoCs. This creates devices for the clock, reset and pin controllers
+	  provided by each register block.
+
+	  Say Y here to enable access to these functions on SL2610 systems.
+
+	  To compile this driver as a module, choose M here: the module will be
+	  called sl2610-syscon.
+
 config MFD_SYSCON
 	bool "System Controller Register R/W Based on Regmap"
 	select REGMAP_MMIO
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index f8101d2a9ce9..7807d98c169f 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -239,6 +239,7 @@ sec-core-objs			:= sec-common.o sec-irq.o
 obj-$(CONFIG_MFD_SEC_CORE)	+= sec-core.o
 obj-$(CONFIG_MFD_SEC_ACPM)	+= sec-acpm.o
 obj-$(CONFIG_MFD_SEC_I2C)	+= sec-i2c.o
+obj-$(CONFIG_MFD_SL2610_SYSCON)	+= sl2610-syscon.o
 obj-$(CONFIG_MFD_SYSCON)	+= syscon.o
 obj-$(CONFIG_MFD_LM3533)	+= lm3533-core.o lm3533-ctrlbank.o
 obj-$(CONFIG_MFD_VEXPRESS_SYSREG)	+= vexpress-sysreg.o
diff --git a/drivers/mfd/sl2610-syscon.c b/drivers/mfd/sl2610-syscon.c
new file mode 100644
index 000000000000..c6fc2955ac0d
--- /dev/null
+++ b/drivers/mfd/sl2610-syscon.c
@@ -0,0 +1,84 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (C) 2026 Synaptics Incorporated
+ */
+
+#include <linux/mfd/core.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+
+struct sl2610_syscon_data {
+	const struct mfd_cell *cells;
+	unsigned int num_cells;
+};
+
+static const struct mfd_cell sl2610_soc_cells[] = {
+	MFD_CELL_NAME("sl2610-soc-clk"),
+	MFD_CELL_NAME("sl2610-soc-reset"),
+	MFD_CELL_NAME("sl2610-soc-pinctrl"),
+};
+
+static const struct mfd_cell sl2610_mcu_cells[] = {
+	MFD_CELL_NAME("sl2610-mcu-clk"),
+	MFD_CELL_NAME("sl2610-mcu-reset"),
+	MFD_CELL_NAME("sl2610-mcu-pinctrl"),
+};
+
+static const struct mfd_cell sl2610_avio_cells[] = {
+	MFD_CELL_NAME("sl2610-avio-clk"),
+};
+
+static const struct mfd_cell sl2610_cpu_cells[] = {
+	MFD_CELL_NAME("sl2610-cpu-clk"),
+};
+
+static const struct sl2610_syscon_data sl2610_soc_data = {
+	.cells = sl2610_soc_cells,
+	.num_cells = ARRAY_SIZE(sl2610_soc_cells),
+};
+
+static const struct sl2610_syscon_data sl2610_mcu_data = {
+	.cells = sl2610_mcu_cells,
+	.num_cells = ARRAY_SIZE(sl2610_mcu_cells),
+};
+
+static const struct sl2610_syscon_data sl2610_avio_data = {
+	.cells = sl2610_avio_cells,
+	.num_cells = ARRAY_SIZE(sl2610_avio_cells),
+};
+
+static const struct sl2610_syscon_data sl2610_cpu_data = {
+	.cells = sl2610_cpu_cells,
+	.num_cells = ARRAY_SIZE(sl2610_cpu_cells),
+};
+
+static int sl2610_syscon_probe(struct platform_device *pdev)
+{
+	const struct sl2610_syscon_data *data = device_get_match_data(&pdev->dev);
+
+	return devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO,
+				    data->cells, data->num_cells, NULL, 0, NULL);
+}
+
+static const struct of_device_id sl2610_syscon_of_match[] = {
+	{ .compatible = "syna,sl2610-soc-syscon", .data = &sl2610_soc_data },
+	{ .compatible = "syna,sl2610-mcu-syscon", .data = &sl2610_mcu_data },
+	{ .compatible = "syna,sl2610-avio-syscon", .data = &sl2610_avio_data },
+	{ .compatible = "syna,sl2610-cpu-syscon", .data = &sl2610_cpu_data },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, sl2610_syscon_of_match);
+
+static struct platform_driver sl2610_syscon_driver = {
+	.probe = sl2610_syscon_probe,
+	.driver = {
+		.name = "sl2610-syscon",
+		.of_match_table = sl2610_syscon_of_match,
+	},
+};
+module_platform_driver(sl2610_syscon_driver);
+
+MODULE_AUTHOR("Jisheng Zhang <jszhang@kernel.org>");
+MODULE_DESCRIPTION("Synaptics SL2610 system controller");
+MODULE_LICENSE("GPL");
-- 
2.55.0


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

* [PATCH v4 07/13] reset: add Synaptics SL2610 reset controller support
  2026-12-04 14:07 [PATCH v4 00/13] arm64: add Synaptics SL2610 SoCs and RDK boards Jisheng Zhang
                   ` (5 preceding siblings ...)
  2026-12-04 14:07 ` [PATCH v4 06/13] mfd: synaptics: add SL2610 system controller support Jisheng Zhang
@ 2026-12-04 14:07 ` Jisheng Zhang
  2026-12-04 16:24   ` sashiko-bot
  2026-12-04 14:07 ` [PATCH v4 08/13] pinctrl: berlin: add Synaptics SL2610 pin " Jisheng Zhang
                   ` (5 subsequent siblings)
  12 siblings, 1 reply; 24+ messages in thread
From: Jisheng Zhang @ 2026-12-04 14:07 UTC (permalink / raw)
  To: Rob Herring, Conor Dooley, Krzysztof Kozlowski, Catalin Marinas,
	Will Deacon, Mark Rutland, Sebastian Hesselbarth, Stephen Boyd,
	Brian Masney, Jerome Brunet, Linus Walleij, Philipp Zabel,
	Lee Jones
  Cc: devicetree, linux-kernel, linux-arm-kernel, linux-clk, linux-gpio,
	mfd, Richard GENOUD

Support the SoC and MCU reset controls exposed by the SL2610 system
controllers. Match the MFD-created platform devices, use the parent
syscon regmap and register each reset provider against the parent DT node.

Handle both pulse resets and sticky resets with assert/deassert controls.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 drivers/reset/Kconfig        |  12 ++
 drivers/reset/Makefile       |   1 +
 drivers/reset/reset-sl2610.c | 224 +++++++++++++++++++++++++++++++++++
 3 files changed, 237 insertions(+)
 create mode 100644 drivers/reset/reset-sl2610.c

diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig
index eda9c698a95f..0c0f475914f6 100644
--- a/drivers/reset/Kconfig
+++ b/drivers/reset/Kconfig
@@ -358,6 +358,18 @@ config RESET_SUNXI
 	help
 	  This enables the reset driver for Allwinner SoCs.
 
+config RESET_SL2610
+	tristate "Synaptics SL2610 Reset Driver"
+	depends on ARCH_BERLIN || COMPILE_TEST
+	depends on OF && HAS_IOMEM
+	help
+	  Support the reset controllers in the SoC and MCU system control
+	  blocks of Synaptics SL2610 SoCs. Both pulse and sticky reset lines
+	  are supported.
+
+	  To compile this driver as a module, choose M here. The module will
+	  be called reset-sl2610.
+
 config RESET_TENSTORRENT_ATLANTIS
 	tristate "Tenstorrent atlantis reset driver"
 	depends on ARCH_TENSTORRENT || COMPILE_TEST
diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile
index 489fafd6bbe3..d28276a4f2ea 100644
--- a/drivers/reset/Makefile
+++ b/drivers/reset/Makefile
@@ -42,6 +42,7 @@ obj-$(CONFIG_RESET_SCMI) += reset-scmi.o
 obj-$(CONFIG_RESET_SIMPLE) += reset-simple.o
 obj-$(CONFIG_RESET_SKY1) += reset-sky1.o
 obj-$(CONFIG_RESET_SKY1_AUDSS) += reset-sky1-audss.o
+obj-$(CONFIG_RESET_SL2610) += reset-sl2610.o
 obj-$(CONFIG_RESET_SOCFPGA) += reset-socfpga.o
 obj-$(CONFIG_RESET_SUNPLUS) += reset-sunplus.o
 obj-$(CONFIG_RESET_SUNXI) += reset-sunxi.o
diff --git a/drivers/reset/reset-sl2610.c b/drivers/reset/reset-sl2610.c
new file mode 100644
index 000000000000..dc55a05d29d8
--- /dev/null
+++ b/drivers/reset/reset-sl2610.c
@@ -0,0 +1,224 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2026 Synaptics Incorporated
+ *
+ * Synaptics SL2610 reset driver
+ *
+ * Author: Jisheng Zhang <jszhang@kernel.org>
+ */
+
+#include <dt-bindings/reset/syna,sl2610-reset.h>
+#include <linux/delay.h>
+#include <linux/io.h>
+#include <linux/mfd/syscon.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/platform_device.h>
+#include <linux/regmap.h>
+#include <linux/reset-controller.h>
+#include <linux/slab.h>
+#include <linux/types.h>
+
+/* SL2610 ACPU subsystem */
+#define SL2610_GBL_PERIFRESET			0x350
+#define SL2610_GBL_PERIFSTICKYRESET		0x360
+#define SL2610_GBL_APBPERIFRESET		0x370
+#define SL2610_GBL_TOPSTICKYRESET		0x378
+#define SL2610_GBL_AVIOSTICKYRESET		0x37c
+
+/* SL2610 system subsystem */
+#define SL2610_SMGBL_STICKYRST0			0x400
+
+#define SL2610_RESET(id, reg, bit, sticky)[id] = { reg, BIT(bit), sticky }
+
+struct sl2610_reset_cfg {
+	u32 reg;
+	u32 bit;
+	bool sticky;
+};
+
+struct sl2610_reset_data {
+	const struct sl2610_reset_cfg *cfgs;
+	size_t num;
+};
+
+struct sl2610_reset_priv {
+	struct regmap *regmap;
+	const struct sl2610_reset_cfg *cfgs;
+	struct reset_controller_dev rcdev;
+};
+
+static inline struct sl2610_reset_priv *
+to_sl2610_reset_priv(struct reset_controller_dev *rcdev)
+{
+	return container_of(rcdev, struct sl2610_reset_priv, rcdev);
+}
+
+static const struct sl2610_reset_cfg sl2610_reset_cfgs[] = {
+	SL2610_RESET(RST_SOC_SDIO0, SL2610_GBL_PERIFRESET, 2, false),
+	SL2610_RESET(RST_SOC_USB0, SL2610_GBL_PERIFRESET, 4, false),
+	SL2610_RESET(RST_SOC_EMMC, SL2610_GBL_PERIFRESET, 5, false),
+	SL2610_RESET(RST_SOC_GETH0, SL2610_GBL_PERIFRESET, 6, false),
+	SL2610_RESET(RST_SOC_SDIO1, SL2610_GBL_PERIFRESET, 7, false),
+	SL2610_RESET(RST_SOC_USB1, SL2610_GBL_PERIFRESET, 8, false),
+	SL2610_RESET(RST_SOC_GETH1, SL2610_GBL_PERIFRESET, 9, false),
+	SL2610_RESET(RST_SOC_USB0PHY, SL2610_GBL_PERIFSTICKYRESET, 0, true),
+	SL2610_RESET(RST_SOC_USB0CORE, SL2610_GBL_PERIFSTICKYRESET, 1, true),
+	SL2610_RESET(RST_SOC_USB0MAHB, SL2610_GBL_PERIFSTICKYRESET, 2, true),
+	SL2610_RESET(RST_SOC_USB1PHY, SL2610_GBL_PERIFSTICKYRESET, 3, true),
+	SL2610_RESET(RST_SOC_USB1CORE, SL2610_GBL_PERIFSTICKYRESET, 4, true),
+	SL2610_RESET(RST_SOC_USB1MAHB, SL2610_GBL_PERIFSTICKYRESET, 5, true),
+	SL2610_RESET(RST_SOC_UART0, SL2610_GBL_APBPERIFRESET, 0, false),
+	SL2610_RESET(RST_SOC_UART1, SL2610_GBL_APBPERIFRESET, 1, false),
+	SL2610_RESET(RST_SOC_UART2, SL2610_GBL_APBPERIFRESET, 2, false),
+	SL2610_RESET(RST_SOC_UART3, SL2610_GBL_APBPERIFRESET, 3, false),
+	SL2610_RESET(RST_SOC_I2C0, SL2610_GBL_APBPERIFRESET, 4, false),
+	SL2610_RESET(RST_SOC_I2C1, SL2610_GBL_APBPERIFRESET, 5, false),
+	SL2610_RESET(RST_SOC_SPI0, SL2610_GBL_APBPERIFRESET, 6, false),
+	SL2610_RESET(RST_SOC_SPI1, SL2610_GBL_APBPERIFRESET, 7, false),
+	SL2610_RESET(RST_SOC_SPI2, SL2610_GBL_APBPERIFRESET, 8, false),
+	SL2610_RESET(RST_SOC_SPI3, SL2610_GBL_APBPERIFRESET, 9, false),
+	SL2610_RESET(RST_SOC_APBTIMERS, SL2610_GBL_APBPERIFRESET, 10, false),
+	SL2610_RESET(RST_SOC_APBSYSCNT, SL2610_GBL_APBPERIFRESET, 11, false),
+	SL2610_RESET(RST_SOC_APBWDT, SL2610_GBL_APBPERIFRESET, 12, false),
+	SL2610_RESET(RST_SOC_APBGPIO, SL2610_GBL_APBPERIFRESET, 13, false),
+	SL2610_RESET(RST_SOC_APBDMA, SL2610_GBL_APBPERIFRESET, 14, false),
+	SL2610_RESET(RST_SOC_GPUCORE, SL2610_GBL_TOPSTICKYRESET, 0, true),
+	SL2610_RESET(RST_SOC_NPUCORE, SL2610_GBL_TOPSTICKYRESET, 1, true),
+	SL2610_RESET(RST_SOC_AVIOAIOG, SL2610_GBL_AVIOSTICKYRESET, 0, true),
+	SL2610_RESET(RST_SOC_AVIOVPPG, SL2610_GBL_AVIOSTICKYRESET, 1, true),
+	SL2610_RESET(RST_SOC_AVIOVIPG, SL2610_GBL_AVIOSTICKYRESET, 2, true),
+};
+
+static const struct sl2610_reset_cfg sl2610_system_reset_cfgs[] = {
+	SL2610_RESET(RST_SM_ADCCORE, SL2610_SMGBL_STICKYRST0, 0, true),
+	SL2610_RESET(RST_SM_ADCPRST, SL2610_SMGBL_STICKYRST0, 1, true),
+	SL2610_RESET(RST_SM_CAN0PRST, SL2610_SMGBL_STICKYRST0, 2, true),
+	SL2610_RESET(RST_SM_CAN0SRST, SL2610_SMGBL_STICKYRST0, 3, true),
+	SL2610_RESET(RST_SM_CAN1PRST, SL2610_SMGBL_STICKYRST0, 4, true),
+	SL2610_RESET(RST_SM_CAN1SRST, SL2610_SMGBL_STICKYRST0, 5, true),
+	SL2610_RESET(RST_SM_GPIOPRST, SL2610_SMGBL_STICKYRST0, 6, true),
+	SL2610_RESET(RST_SM_GPIOSRST, SL2610_SMGBL_STICKYRST0, 7, true),
+	SL2610_RESET(RST_SM_I2CM0PRST, SL2610_SMGBL_STICKYRST0, 8, true),
+	SL2610_RESET(RST_SM_I2CM0SRST, SL2610_SMGBL_STICKYRST0, 9, true),
+	SL2610_RESET(RST_SM_I2CM1PRST, SL2610_SMGBL_STICKYRST0, 10, true),
+	SL2610_RESET(RST_SM_I2CM1SRST, SL2610_SMGBL_STICKYRST0, 11, true),
+	SL2610_RESET(RST_SM_I3CPRST, SL2610_SMGBL_STICKYRST0, 12, true),
+	SL2610_RESET(RST_SM_I3CSRST, SL2610_SMGBL_STICKYRST0, 13, true),
+	SL2610_RESET(RST_SM_PDMPRST, SL2610_SMGBL_STICKYRST0, 14, true),
+	SL2610_RESET(RST_SM_PDMSRST, SL2610_SMGBL_STICKYRST0, 15, true),
+	SL2610_RESET(RST_SM_PVTHSRST, SL2610_SMGBL_STICKYRST0, 16, true),
+	SL2610_RESET(RST_SM_PVTPRST, SL2610_SMGBL_STICKYRST0, 17, true),
+	SL2610_RESET(RST_SM_PWMPERIRST, SL2610_SMGBL_STICKYRST0, 18, true),
+	SL2610_RESET(RST_SM_PWMPRST, SL2610_SMGBL_STICKYRST0, 19, true),
+	SL2610_RESET(RST_SM_SPIMPRST, SL2610_SMGBL_STICKYRST0, 20, true),
+	SL2610_RESET(RST_SM_SPIMSRST, SL2610_SMGBL_STICKYRST0, 21, true),
+	SL2610_RESET(RST_SM_SPISPRST, SL2610_SMGBL_STICKYRST0, 22, true),
+	SL2610_RESET(RST_SM_SPISSRST, SL2610_SMGBL_STICKYRST0, 23, true),
+	SL2610_RESET(RST_SM_UART0PRST, SL2610_SMGBL_STICKYRST0, 24, true),
+	SL2610_RESET(RST_SM_UART0SRST, SL2610_SMGBL_STICKYRST0, 25, true),
+	SL2610_RESET(RST_SM_UART1PRST, SL2610_SMGBL_STICKYRST0, 26, true),
+	SL2610_RESET(RST_SM_UART1SRST, SL2610_SMGBL_STICKYRST0, 27, true),
+	SL2610_RESET(RST_SM_UART2PRST, SL2610_SMGBL_STICKYRST0, 28, true),
+	SL2610_RESET(RST_SM_UART2SRST, SL2610_SMGBL_STICKYRST0, 29, true),
+	SL2610_RESET(RST_SM_UART3PRST, SL2610_SMGBL_STICKYRST0, 30, true),
+	SL2610_RESET(RST_SM_UART3SRST, SL2610_SMGBL_STICKYRST0, 31, true),
+};
+
+static const struct sl2610_reset_data sl2610_reset_data = {
+	.cfgs = sl2610_reset_cfgs,
+	.num = ARRAY_SIZE(sl2610_reset_cfgs),
+};
+
+static const struct sl2610_reset_data sl2610_system_reset_data = {
+	.cfgs = sl2610_system_reset_cfgs,
+	.num = ARRAY_SIZE(sl2610_system_reset_cfgs),
+};
+
+static int sl2610_reset_assert(struct reset_controller_dev *rcdev,
+			       unsigned long id)
+{
+	struct sl2610_reset_priv *priv = to_sl2610_reset_priv(rcdev);
+	const struct sl2610_reset_cfg *cfg = &priv->cfgs[id];
+
+	if (!cfg->sticky)
+		return -ENOTSUPP;
+
+	return regmap_clear_bits(priv->regmap, cfg->reg, cfg->bit);
+}
+
+static int sl2610_reset_deassert(struct reset_controller_dev *rcdev,
+				 unsigned long id)
+{
+	struct sl2610_reset_priv *priv = to_sl2610_reset_priv(rcdev);
+	const struct sl2610_reset_cfg *cfg = &priv->cfgs[id];
+
+	if (!cfg->sticky)
+		return 0;
+
+	return regmap_set_bits(priv->regmap, cfg->reg, cfg->bit);
+}
+
+static int sl2610_reset_reset(struct reset_controller_dev *rcdev,
+			      unsigned long id)
+{
+	struct sl2610_reset_priv *priv = to_sl2610_reset_priv(rcdev);
+	const struct sl2610_reset_cfg *cfg = &priv->cfgs[id];
+
+	if (cfg->sticky)
+		return -ENOTSUPP;
+
+	return regmap_set_bits(priv->regmap, cfg->reg, cfg->bit);
+}
+
+static const struct reset_control_ops sl2610_reset_ops = {
+	.reset	= sl2610_reset_reset,
+	.assert = sl2610_reset_assert,
+	.deassert = sl2610_reset_deassert,
+};
+
+static int sl2610_reset_probe(struct platform_device *pdev)
+{
+	struct device_node *parent_np = pdev->dev.parent->of_node;
+	struct sl2610_reset_priv *priv;
+	const struct sl2610_reset_data *data =
+		(void *)platform_get_device_id(pdev)->driver_data;
+
+	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
+	if (!priv)
+		return -ENOMEM;
+
+	priv->regmap = syscon_node_to_regmap(parent_np);
+	if (IS_ERR(priv->regmap))
+		return PTR_ERR(priv->regmap);
+
+	priv->rcdev.owner = THIS_MODULE;
+	priv->rcdev.ops = &sl2610_reset_ops;
+	priv->rcdev.dev = &pdev->dev;
+	priv->rcdev.of_node = parent_np;
+	priv->rcdev.nr_resets = data->num;
+	priv->cfgs = data->cfgs;
+
+	return devm_reset_controller_register(&pdev->dev, &priv->rcdev);
+}
+
+static const struct platform_device_id sl2610_reset_ids[] = {
+	{ "sl2610-soc-reset", (kernel_ulong_t)&sl2610_reset_data },
+	{ "sl2610-mcu-reset", (kernel_ulong_t)&sl2610_system_reset_data },
+	{ }
+};
+MODULE_DEVICE_TABLE(platform, sl2610_reset_ids);
+
+static struct platform_driver sl2610_reset_driver = {
+	.probe = sl2610_reset_probe,
+	.id_table = sl2610_reset_ids,
+	.driver = {
+		.name = "sl2610-reset",
+	},
+};
+module_platform_driver(sl2610_reset_driver);
+
+MODULE_AUTHOR("Jisheng Zhang <jszhang@kernel.org>");
+MODULE_DESCRIPTION("Synaptics SL2610 reset controller");
+MODULE_LICENSE("GPL");
-- 
2.55.0


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

* [PATCH v4 08/13] pinctrl: berlin: add Synaptics SL2610 pin controller support
  2026-12-04 14:07 [PATCH v4 00/13] arm64: add Synaptics SL2610 SoCs and RDK boards Jisheng Zhang
                   ` (6 preceding siblings ...)
  2026-12-04 14:07 ` [PATCH v4 07/13] reset: add Synaptics SL2610 reset " Jisheng Zhang
@ 2026-12-04 14:07 ` Jisheng Zhang
  2026-12-04 16:51   ` sashiko-bot
  2026-12-04 14:07 ` [PATCH v4 09/13] clk: berlin: add Synaptics clock controller helpers Jisheng Zhang
                   ` (4 subsequent siblings)
  12 siblings, 1 reply; 24+ messages in thread
From: Jisheng Zhang @ 2026-12-04 14:07 UTC (permalink / raw)
  To: Rob Herring, Conor Dooley, Krzysztof Kozlowski, Catalin Marinas,
	Will Deacon, Mark Rutland, Sebastian Hesselbarth, Stephen Boyd,
	Brian Masney, Jerome Brunet, Linus Walleij, Philipp Zabel,
	Lee Jones
  Cc: devicetree, linux-kernel, linux-arm-kernel, linux-clk, linux-gpio,
	mfd, Richard GENOUD

Add the SoC and MCU pin groups and mux functions for SL2610, together
with their pad configuration register descriptions. Bind to the platform
devices created by the system controller and associate pin configurations
with the parent syscon DT node.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 drivers/pinctrl/berlin/Kconfig          |  15 +
 drivers/pinctrl/berlin/Makefile         |   1 +
 drivers/pinctrl/berlin/pinctrl-sl2610.c | 759 ++++++++++++++++++++++++
 3 files changed, 775 insertions(+)
 create mode 100644 drivers/pinctrl/berlin/pinctrl-sl2610.c

diff --git a/drivers/pinctrl/berlin/Kconfig b/drivers/pinctrl/berlin/Kconfig
index abb1c912b9ba..0ed25151caf4 100644
--- a/drivers/pinctrl/berlin/Kconfig
+++ b/drivers/pinctrl/berlin/Kconfig
@@ -32,4 +32,19 @@ config PINCTRL_BERLIN_BG4CT
 	depends on OF
 	select PINCTRL_BERLIN
 
+config PINCTRL_SL2610
+	tristate "Synaptics SL2610 pin controller driver"
+	depends on MFD_SL2610_SYSCON
+	depends on OF && HAS_IOMEM
+	select GENERIC_PINCONF
+	select PINCONF
+	select PINCTRL_BERLIN
+	help
+	  Support the SoC and MCU pin controllers on Synaptics SL2610 SoCs.
+	  These provide pin multiplexing and electrical pad configuration
+	  through their parent system control blocks.
+
+	  To compile this driver as a module, choose M here. The module will
+	  be called pinctrl-sl2610.
+
 endif
diff --git a/drivers/pinctrl/berlin/Makefile b/drivers/pinctrl/berlin/Makefile
index 7b4aa5444a4a..448965293e6a 100644
--- a/drivers/pinctrl/berlin/Makefile
+++ b/drivers/pinctrl/berlin/Makefile
@@ -5,3 +5,4 @@ obj-$(CONFIG_PINCTRL_BERLIN_BG2CD)	+= berlin-bg2cd.o
 obj-$(CONFIG_PINCTRL_BERLIN_BG2Q)	+= berlin-bg2q.o
 obj-$(CONFIG_PINCTRL_BERLIN_BG4CT)	+= berlin-bg4ct.o
 obj-$(CONFIG_PINCTRL_AS370)		+= pinctrl-as370.o
+obj-$(CONFIG_PINCTRL_SL2610)		+= pinctrl-sl2610.o
diff --git a/drivers/pinctrl/berlin/pinctrl-sl2610.c b/drivers/pinctrl/berlin/pinctrl-sl2610.c
new file mode 100644
index 000000000000..90b2538597cc
--- /dev/null
+++ b/drivers/pinctrl/berlin/pinctrl-sl2610.c
@@ -0,0 +1,759 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Synaptics SL2610 pinctrl driver
+ *
+ * Copyright (C) 2025 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <jszhang@kernel.org>
+ */
+
+#include <linux/init.h>
+#include <linux/mfd/syscon.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/property.h>
+#include <linux/regmap.h>
+
+#include "berlin.h"
+
+static const struct berlin_desc_group sl2610_soc_pinctrl_groups[] = {
+	BERLIN_PINCTRLCONF_GROUP("GPIO23", 0x8000, 0x3, 0x00,
+			0x8800, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO23 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "tw2"), /* SCL */
+			BERLIN_PINCTRL_FUNCTION(0x2, "rgmii"), /* MDC */
+			BERLIN_PINCTRL_FUNCTION(0x3, "key_row0"),
+			BERLIN_PINCTRL_FUNCTION(0x5, "spi3"), /* SS2n */
+			BERLIN_PINCTRL_FUNCTION(0x6, "key_col3"),
+			BERLIN_PINCTRL_FUNCTION(0x7, "dbg")), /* OUT4 */
+	BERLIN_PINCTRLCONF_GROUP("GPIO24", 0x8000, 0x3, 0x03,
+			0x8804, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO24 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "tw2"), /* SDA */
+			BERLIN_PINCTRL_FUNCTION(0x2, "rgmii"), /* MDIO */
+			BERLIN_PINCTRL_FUNCTION(0x3, "key_row1"),
+			BERLIN_PINCTRL_FUNCTION(0x5, "spi3"), /* SS3n */
+			BERLIN_PINCTRL_FUNCTION(0x6, "key_col2"),
+			BERLIN_PINCTRL_FUNCTION(0x7, "dbg")), /* OUT5 */
+	BERLIN_PINCTRLCONF_GROUP("GPIO25", 0x8000, 0x3, 0x06,
+			0x8808, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO25 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "uart5"), /* RXD */
+			BERLIN_PINCTRL_FUNCTION(0x2, "gpio_trig1"),
+			BERLIN_PINCTRL_FUNCTION(0x3, "key_row2"),
+			BERLIN_PINCTRL_FUNCTION(0x4, "sm_uart1"), /* RXD */
+			BERLIN_PINCTRL_FUNCTION(0x6, "key_col1"),
+			BERLIN_PINCTRL_FUNCTION(0x7, "dbg")), /* OUT6 */
+	BERLIN_PINCTRLCONF_GROUP("GPIO26", 0x8000, 0x3, 0x09,
+			0x880c, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO26 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "uart5"), /* TXD */
+			BERLIN_PINCTRL_FUNCTION(0x2, "rgmii"), /* PTP_PPS_O */
+			BERLIN_PINCTRL_FUNCTION(0x4, "sm_uart1"), /* TXD */
+			BERLIN_PINCTRL_FUNCTION(0x5, "usb2"), /* VBUS */
+			BERLIN_PINCTRL_FUNCTION(0x7, "dbg")), /* OUT7 */
+	BERLIN_PINCTRLCONF_GROUP("GPIO27", 0x8000, 0x3, 0x0c,
+			0x8810, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO27 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "tw3"), /* SCL */
+			BERLIN_PINCTRL_FUNCTION(0x2, "uart4"), /* TXD */
+			BERLIN_PINCTRL_FUNCTION(0x4, "sm_uart1")), /* RTSn */
+	BERLIN_PINCTRLCONF_GROUP("GPIO28", 0x8000, 0x3, 0x0f,
+			0x8814, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO28 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "tw3"), /* SDA */
+			BERLIN_PINCTRL_FUNCTION(0x2, "uart4"), /* RXD */
+			BERLIN_PINCTRL_FUNCTION(0x4, "sm_uart1")), /* CTSn */
+	BERLIN_PINCTRLCONF_GROUP("GPIO29", 0x8000, 0x3, 0x12,
+			0x8818, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO29 */
+			BERLIN_PINCTRL_FUNCTION(0x2, "uart4"), /* DE */
+			BERLIN_PINCTRL_FUNCTION(0x3, "key_row4"),
+			BERLIN_PINCTRL_FUNCTION(0x4, "sm_uart1"), /* RXD */
+			BERLIN_PINCTRL_FUNCTION(0x6, "key_col4"),
+			BERLIN_PINCTRL_FUNCTION(0x7, "spi4")), /* SDI */
+	BERLIN_PINCTRLCONF_GROUP("GPIO30", 0x8000, 0x3, 0x15,
+			0x881c, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO30 */
+			BERLIN_PINCTRL_FUNCTION(0x2, "uart4"), /* REn */
+			BERLIN_PINCTRL_FUNCTION(0x3, "key_row5"),
+			BERLIN_PINCTRL_FUNCTION(0x4, "sm_uart1"), /* TXD */
+			BERLIN_PINCTRL_FUNCTION(0x6, "key_col5"),
+			BERLIN_PINCTRL_FUNCTION(0x7, "spi4")), /* SCLK */
+	BERLIN_PINCTRLCONF_GROUP("GPIO31", 0x8000, 0x3, 0x18,
+			0x8820, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO31 */
+			BERLIN_PINCTRL_FUNCTION(0x2, "rgmii"), /* MDC */
+			BERLIN_PINCTRL_FUNCTION(0x5, "spi5"), /* SS3n */
+			BERLIN_PINCTRL_FUNCTION(0x6, "spi3"), /* SS2n */
+			BERLIN_PINCTRL_FUNCTION(0x7, "spi4")), /* SS2n */
+	BERLIN_PINCTRLCONF_GROUP("GPIO32", 0x8000, 0x3, 0x1b,
+			0x8824, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO32 */
+			BERLIN_PINCTRL_FUNCTION(0x2, "rgmii"), /* MDIO */
+			BERLIN_PINCTRL_FUNCTION(0x6, "spi3"), /* SS3n */
+			BERLIN_PINCTRL_FUNCTION(0x7, "spi4")), /* SS3n */
+	BERLIN_PINCTRLCONF_GROUP("GPIO33", 0x8004, 0x3, 0x00,
+			0x8828, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO33 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii1"), /* TD0 */
+			BERLIN_PINCTRL_FUNCTION(0x2, "rmii1"), /* TXD0 */
+			BERLIN_PINCTRL_FUNCTION(0x5, "can0"), /* TX */
+			BERLIN_PINCTRL_FUNCTION(0x6, "spi3"), /* SS1n */
+			BERLIN_PINCTRL_FUNCTION(0x7, "spi4")), /* SS1n */
+	BERLIN_PINCTRLCONF_GROUP("GPIO34", 0x8004, 0x3, 0x03,
+			0x882c, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO34 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii1"), /* TD1 */
+			BERLIN_PINCTRL_FUNCTION(0x2, "rmii1"), /* TXD1 */
+			BERLIN_PINCTRL_FUNCTION(0x5, "can0")), /* RX */
+	BERLIN_PINCTRLCONF_GROUP("GPIO35", 0x8004, 0x3, 0x06,
+			0x8830, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO35 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii1"), /* TD2 */
+			BERLIN_PINCTRL_FUNCTION(0x2, "rmii2"), /* TXD0 */
+			BERLIN_PINCTRL_FUNCTION(0x3, "key_col7"),
+			BERLIN_PINCTRL_FUNCTION(0x4, "uart5"), /* RXD */
+			BERLIN_PINCTRL_FUNCTION(0x7, "spi4")), /* SS0n */
+	BERLIN_PINCTRLCONF_GROUP("GPIO36", 0x8004, 0x3, 0x09,
+			0x8834, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO36 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii1"), /* TD3 */
+			BERLIN_PINCTRL_FUNCTION(0x2, "rmii2"), /* TXD1 */
+			BERLIN_PINCTRL_FUNCTION(0x4, "uart5"), /* TXD */
+			BERLIN_PINCTRL_FUNCTION(0x7, "spi4")), /* SDO */
+	BERLIN_PINCTRLCONF_GROUP("GPIO37", 0x8004, 0x3, 0x0c,
+			0x8838, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO37 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii1"), /* RD0 */
+			BERLIN_PINCTRL_FUNCTION(0x2, "rmii1"), /* RXD0 */
+			BERLIN_PINCTRL_FUNCTION(0x5, "can1"), /* TX */
+			BERLIN_PINCTRL_FUNCTION(0x7, "spi5")), /* SDI */
+	BERLIN_PINCTRLCONF_GROUP("GPIO38", 0x8004, 0x3, 0x0f,
+			0x883c, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO38 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii1"), /* RD1 */
+			BERLIN_PINCTRL_FUNCTION(0x2, "rmii1"), /* RXD1 */
+			BERLIN_PINCTRL_FUNCTION(0x5, "can1"), /* RX */
+			BERLIN_PINCTRL_FUNCTION(0x7, "spi5")), /* SDO */
+	BERLIN_PINCTRLCONF_GROUP("GPIO39", 0x8004, 0x3, 0x12,
+			0x8840, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO39 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii1"), /* RD2 */
+			BERLIN_PINCTRL_FUNCTION(0x2, "rmii2"), /* RXD0 */
+			BERLIN_PINCTRL_FUNCTION(0x3, "key_row6"),
+			BERLIN_PINCTRL_FUNCTION(0x4, "uart6"), /* RXD */
+			BERLIN_PINCTRL_FUNCTION(0x5, "spi5"), /* SS1n*/
+			BERLIN_PINCTRL_FUNCTION(0x6, "spi4")), /* SS3n  */
+	BERLIN_PINCTRLCONF_GROUP("GPIO40", 0x8004, 0x3, 0x15,
+			0x8844, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO40 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii1"), /* RD3 */
+			BERLIN_PINCTRL_FUNCTION(0x2, "rmii2"), /* RXD1 */
+			BERLIN_PINCTRL_FUNCTION(0x3, "key_row7"),
+			BERLIN_PINCTRL_FUNCTION(0x4, "uart6"), /* TXD */
+			BERLIN_PINCTRL_FUNCTION(0x5, "spi5"), /* SS2n */
+			BERLIN_PINCTRL_FUNCTION(0x6, "spi4")), /* SS2n  */
+	BERLIN_PINCTRLCONF_GROUP("GPIO41", 0x8004, 0x3, 0x18,
+			0x8848, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO41 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii1"), /* RXC */
+			BERLIN_PINCTRL_FUNCTION(0x2, "rmii1"), /* CRSDV */
+			BERLIN_PINCTRL_FUNCTION(0x7, "spi5")), /* SCLK */
+	BERLIN_PINCTRLCONF_GROUP("GPIO42", 0x8004, 0x3, 0x1b,
+			0x884c, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO42 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii1"), /* TXC */
+			BERLIN_PINCTRL_FUNCTION(0x2, "rmii2"), /* CRSDV */
+			BERLIN_PINCTRL_FUNCTION(0x3, "key_row8"),
+			BERLIN_PINCTRL_FUNCTION(0x4, "uart7"), /* RXD */
+			BERLIN_PINCTRL_FUNCTION(0x6, "spi4")), /* SCLK */
+	BERLIN_PINCTRLCONF_GROUP("GPIO43", 0x8008, 0x3, 0x00,
+			0x8850, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO43 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii1"), /* TXCTL */
+			BERLIN_PINCTRL_FUNCTION(0x2, "rmii1"), /* TXEN */
+			BERLIN_PINCTRL_FUNCTION(0x6, "spi4")), /* SS0n */
+	BERLIN_PINCTRLCONF_GROUP("GPIO44", 0x8008, 0x3, 0x03,
+			0x8854, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO44 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii1"), /* RXCTL */
+			BERLIN_PINCTRL_FUNCTION(0x2, "rmii2"), /* TXEN */
+			BERLIN_PINCTRL_FUNCTION(0x3, "key_row9"),
+			BERLIN_PINCTRL_FUNCTION(0x4, "uart7"), /* TXD */
+			BERLIN_PINCTRL_FUNCTION(0x6, "spi4")), /* SDI */
+	BERLIN_PINCTRLCONF_GROUP("GPIO45", 0x8008, 0x3, 0x06,
+			0x8858, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO45 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii1"), /* CLKOUT */
+			BERLIN_PINCTRL_FUNCTION(0x2, "rmii1")), /* REFCLK */
+	BERLIN_PINCTRLCONF_GROUP("GPIO46", 0x8008, 0x3, 0x09,
+			0x885c, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO46 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "sdio1"), /* CDn */
+			BERLIN_PINCTRL_FUNCTION(0x2, "sdio2"), /* CDn */
+			BERLIN_PINCTRL_FUNCTION(0x3, "key_col0"),
+			BERLIN_PINCTRL_FUNCTION(0x5, "sm_uart1"), /* RTSn */
+			BERLIN_PINCTRL_FUNCTION(0x6, "key_row9"),
+			BERLIN_PINCTRL_FUNCTION(0x7, "dsi")), /* TE */
+	BERLIN_PINCTRLCONF_GROUP("GPIO47", 0x8008, 0x3, 0x0c,
+			0x8860, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO47 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "sdio1"), /* WP */
+			BERLIN_PINCTRL_FUNCTION(0x2, "sdio2"), /* WP */
+			BERLIN_PINCTRL_FUNCTION(0x3, "key_col1"),
+			BERLIN_PINCTRL_FUNCTION(0x4, "rmii2"), /* REFCLK */
+			BERLIN_PINCTRL_FUNCTION(0x5, "sm_uart1"), /* CTSn */
+			BERLIN_PINCTRL_FUNCTION(0x6, "key_row8")),
+	BERLIN_PINCTRLCONF_GROUP("GPIO48", 0x8008, 0x3, 0x0f,
+			0x8864, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO48 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii2"), /* TD0 */
+			BERLIN_PINCTRL_FUNCTION(0x5, "spi5"), /* SS0n */
+			BERLIN_PINCTRL_FUNCTION(0x6, "spi4"), /* SS2n */
+			BERLIN_PINCTRL_FUNCTION(0x7, "spi3")), /* SS3n */
+	BERLIN_PINCTRLCONF_GROUP("GPIO49", 0x8008, 0x3, 0x12,
+			0x8868, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO49 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii2"), /* TD1 */
+			BERLIN_PINCTRL_FUNCTION(0x5, "spi5"), /* SDO */
+			BERLIN_PINCTRL_FUNCTION(0x6, "spi4"), /* SS3n */
+			BERLIN_PINCTRL_FUNCTION(0x7, "spi3")), /* SS2n */
+	BERLIN_PINCTRLCONF_GROUP("GPIO50", 0x8008, 0x3, 0x15,
+			0x886c, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO50 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii2"), /* TD2 */
+			BERLIN_PINCTRL_FUNCTION(0x5, "spi5"), /* SCLK */
+			BERLIN_PINCTRL_FUNCTION(0x7, "spi3")), /* SS1n */
+	BERLIN_PINCTRLCONF_GROUP("GPIO51", 0x8008, 0x3, 0x18,
+			0x8870, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO51 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii2"), /* TD3 */
+			BERLIN_PINCTRL_FUNCTION(0x7, "spi3")), /* SS0n */
+	BERLIN_PINCTRLCONF_GROUP("GPIO52", 0x8008, 0x3, 0x1b,
+			0x8874, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO52 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii2"), /* RD0 */
+			BERLIN_PINCTRL_FUNCTION(0x6, "spi4"), /* SS2n */
+			BERLIN_PINCTRL_FUNCTION(0x7, "spi3")), /* SDO */
+	BERLIN_PINCTRLCONF_GROUP("GPIO53", 0x800c, 0x3, 0x00,
+			0x8878, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO53 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii2"), /* RD1 */
+			BERLIN_PINCTRL_FUNCTION(0x6, "spi4"), /* SS3n */
+			BERLIN_PINCTRL_FUNCTION(0x7, "spi3")), /* SCLK */
+	BERLIN_PINCTRLCONF_GROUP("GPIO54", 0x800c, 0x3, 0x03,
+			0x887c, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO54 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii2"), /* RD2 */
+			BERLIN_PINCTRL_FUNCTION(0x7, "spi3")), /* SDI */
+	BERLIN_PINCTRLCONF_GROUP("GPIO55", 0x800c, 0x3, 0x06,
+			0x8880, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO55 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii2"), /* RD3 */
+			BERLIN_PINCTRL_FUNCTION(0x5, "spi5"), /* SDI */
+			BERLIN_PINCTRL_FUNCTION(0x7, "spi4")), /* SS1n */
+	BERLIN_PINCTRLCONF_GROUP("GPIO56", 0x800c, 0x3, 0x09,
+			0x8884, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO56 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii2"), /* RXC */
+			BERLIN_PINCTRL_FUNCTION(0x7, "spi4")), /* SS0n */
+	BERLIN_PINCTRLCONF_GROUP("GPIO57", 0x800c, 0x3, 0x0c,
+			0x8888, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO57 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii2"), /* TXC */
+			BERLIN_PINCTRL_FUNCTION(0x7, "spi4")), /* SDO */
+	BERLIN_PINCTRLCONF_GROUP("GPIO58", 0x800c, 0x3, 0x0f,
+			0x888c, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO58 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii2"), /* TXCTL */
+			BERLIN_PINCTRL_FUNCTION(0x7, "spi4")), /* SCLK */
+	BERLIN_PINCTRLCONF_GROUP("GPIO59", 0x800c, 0x3, 0x12,
+			0x8890, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO59 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "rgmii2"), /* RXCTL */
+			BERLIN_PINCTRL_FUNCTION(0x7, "spi4")), /* SDI */
+	BERLIN_PINCTRLCONF_GROUP("GPIO0", 0x800c, 0x3, 0x15,
+			0x8894, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO0 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"), /* LRCK */
+			BERLIN_PINCTRL_FUNCTION(0x7, "spi3")), /* SS0n */
+	BERLIN_PINCTRLCONF_GROUP("GPIO1", 0x800c, 0x3, 0x18,
+			0x8898, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO1 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"), /* BCLK */
+			BERLIN_PINCTRL_FUNCTION(0x7, "spi3")), /* SCLK */
+	BERLIN_PINCTRLCONF_GROUP("GPIO2", 0x800c, 0x3, 0x1b,
+			0x889c, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO2*/
+			BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"), /* DO */
+			BERLIN_PINCTRL_FUNCTION(0x4, "spdif"), /* O */
+			BERLIN_PINCTRL_FUNCTION(0x7, "spi3")), /* SDO */
+	BERLIN_PINCTRLCONF_GROUP("GPIO3", 0x8010, 0x3, 0x00,
+			0x88a0, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO3 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"), /* MCLK */
+			BERLIN_PINCTRL_FUNCTION(0x7, "spi3")), /* SS1n */
+	BERLIN_PINCTRLCONF_GROUP("GPIO4", 0x8010, 0x3, 0x03,
+			0x88a4, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO4 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "i2s1"), /* DI */
+			BERLIN_PINCTRL_FUNCTION(0x4, "spdif"), /* I */
+			BERLIN_PINCTRL_FUNCTION(0x7, "spi3")), /* SDI */
+	BERLIN_PINCTRLCONF_GROUP("GPIO5", 0x8010, 0x3, 0x06,
+			0x88a8, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO5 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"), /* LRCK */
+			BERLIN_PINCTRL_FUNCTION(0x2, "cam"), /* PIXCLK */
+			BERLIN_PINCTRL_FUNCTION(0x3, "key_row0"),
+			BERLIN_PINCTRL_FUNCTION(0x4, "spdif"), /* I */
+			BERLIN_PINCTRL_FUNCTION(0x6, "key_col7")),
+	BERLIN_PINCTRLCONF_GROUP("GPIO6", 0x8010, 0x3, 0x09,
+			0x88ac, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO6 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"), /* BCLK */
+			BERLIN_PINCTRL_FUNCTION(0x2, "cam"), /* HSYNC */
+			BERLIN_PINCTRL_FUNCTION(0x3, "key_row1"),
+			BERLIN_PINCTRL_FUNCTION(0x4, "spdif"), /* O */
+			BERLIN_PINCTRL_FUNCTION(0x6, "key_col6")),
+	BERLIN_PINCTRLCONF_GROUP("GPIO7", 0x8010, 0x3, 0x0c,
+			0x88b0, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO7 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"), /* DO */
+			BERLIN_PINCTRL_FUNCTION(0x3, "key_row2"),
+			BERLIN_PINCTRL_FUNCTION(0x4, "spdif"), /* O */
+			BERLIN_PINCTRL_FUNCTION(0x5, "sm_pdm"), /* CLKIO */
+			BERLIN_PINCTRL_FUNCTION(0x6, "key_col5")),
+	BERLIN_PINCTRLCONF_GROUP("GPIO8", 0x8010, 0x3, 0x0f,
+			0x88b4, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO8 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"), /* DI */
+			BERLIN_PINCTRL_FUNCTION(0x2, "cam"), /* VSYNC */
+			BERLIN_PINCTRL_FUNCTION(0x3, "key_row3"),
+			BERLIN_PINCTRL_FUNCTION(0x4, "spdif"), /* I */
+			BERLIN_PINCTRL_FUNCTION(0x6, "key_col4")),
+	BERLIN_PINCTRLCONF_GROUP("GPIO9", 0x8010, 0x3, 0x12,
+			0x88b8, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO9 */
+			BERLIN_PINCTRL_FUNCTION(0x2, "cam"), /* DATA0 */
+			BERLIN_PINCTRL_FUNCTION(0x4, "pdm")), /* DI1 */
+	BERLIN_PINCTRLCONF_GROUP("GPIO10", 0x8010, 0x3, 0x15,
+			0x88bc, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO10 */
+			BERLIN_PINCTRL_FUNCTION(0x2, "cam"), /* DATA1 */
+			BERLIN_PINCTRL_FUNCTION(0x4, "pdm"), /* DI2 */
+			BERLIN_PINCTRL_FUNCTION(0x5, "dsi")), /* TE */
+	BERLIN_PINCTRLCONF_GROUP("GPIO11", 0x8010, 0x3, 0x18,
+			0x88c0, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO11 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "i2s2"), /* MCLK */
+			BERLIN_PINCTRL_FUNCTION(0x2, "cam"), /* DATA2 */
+			BERLIN_PINCTRL_FUNCTION(0x4, "sm_pdm"), /* CLKIO */
+			BERLIN_PINCTRL_FUNCTION(0x7, "dbg")), /* CLK */
+	BERLIN_PINCTRLCONF_GROUP("GPIO12", 0x8010, 0x3, 0x1b,
+			0x88c4, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO12 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "i2s3"), /* LRCK */
+			BERLIN_PINCTRL_FUNCTION(0x2, "cam"), /* DATA3 */
+			BERLIN_PINCTRL_FUNCTION(0x3, "sdio2"), /* WP */
+			BERLIN_PINCTRL_FUNCTION(0x4, "sdio1"), /* WP */
+			BERLIN_PINCTRL_FUNCTION(0x7, "dbg")), /* OUT0 */
+	BERLIN_PINCTRLCONF_GROUP("GPIO13", 0x8014, 0x3, 0x00,
+			0x88c8, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO13 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "i2s3"), /* BCLK */
+			BERLIN_PINCTRL_FUNCTION(0x2, "pdm"), /* DI1 */
+			BERLIN_PINCTRL_FUNCTION(0x3, "rgmii"), /* PTP_PPS_O */
+			BERLIN_PINCTRL_FUNCTION(0x4, "usb2"), /* VBUS */
+			BERLIN_PINCTRL_FUNCTION(0x7, "dbg")), /* OUT1 */
+	BERLIN_PINCTRLCONF_GROUP("GPIO14", 0x8014, 0x3, 0x03,
+			0x88cc, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO14 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "i2s3"), /* DO */
+			BERLIN_PINCTRL_FUNCTION(0x4, "pdm"), /* DI3 */
+			BERLIN_PINCTRL_FUNCTION(0x6, "spdif"), /* O */
+			BERLIN_PINCTRL_FUNCTION(0x7, "dbg")), /* OUT2 */
+	BERLIN_PINCTRLCONF_GROUP("GPIO15", 0x8014, 0x3, 0x06,
+			0x88d0, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO15 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "i2s3"), /* DI */
+			BERLIN_PINCTRL_FUNCTION(0x2, "cam"), /* DATA4 */
+			BERLIN_PINCTRL_FUNCTION(0x4, "sm_pdm"), /* DI0 */
+			BERLIN_PINCTRL_FUNCTION(0x6, "spdif"), /* I */
+			BERLIN_PINCTRL_FUNCTION(0x7, "dbg")), /* OUT3 */
+	BERLIN_PINCTRLCONF_GROUP("GPIO16", 0x8014, 0x3, 0x09,
+			0x88d4, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO16 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "spi2"), /* SS0n */
+			BERLIN_PINCTRL_FUNCTION(0x3, "sdio2")), /* DAT3 */
+	BERLIN_PINCTRLCONF_GROUP("GPIO17", 0x8014, 0x3, 0x0c,
+			0x88d8, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO17 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "spi2"), /* SS1n */
+			BERLIN_PINCTRL_FUNCTION(0x2, "cam"), /* DATA5 */
+			BERLIN_PINCTRL_FUNCTION(0x3, "sdio2"), /* DAT2 */
+			BERLIN_PINCTRL_FUNCTION(0x5, "dsi")), /* TE */
+	BERLIN_PINCTRLCONF_GROUP("GPIO18", 0x8014, 0x3, 0x0f,
+			0x88dc, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO18 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "spi2"), /* SS2n */
+			BERLIN_PINCTRL_FUNCTION(0x2, "cam"), /* DATA6 */
+			BERLIN_PINCTRL_FUNCTION(0x3, "sdio2"), /* DAT1 */
+			BERLIN_PINCTRL_FUNCTION(0x4, "pdm"), /* DI2 */
+			BERLIN_PINCTRL_FUNCTION(0x5, "can1")), /* RX */
+	BERLIN_PINCTRLCONF_GROUP("GPIO19", 0x8014, 0x3, 0x12,
+			0x88e0, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO19 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "spi2"), /* SS3n */
+			BERLIN_PINCTRL_FUNCTION(0x2, "cam"), /* DATA7 */
+			BERLIN_PINCTRL_FUNCTION(0x3, "sdio2"), /* DAT0 */
+			BERLIN_PINCTRL_FUNCTION(0x4, "pdm"), /* DI3 */
+			BERLIN_PINCTRL_FUNCTION(0x5, "can1")), /* TX */
+	BERLIN_PINCTRLCONF_GROUP("GPIO20", 0x8014, 0x3, 0x15,
+			0x88e4, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO20 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "spi2"), /* SDO */
+			BERLIN_PINCTRL_FUNCTION(0x3, "sdio2")), /* CMD */
+	BERLIN_PINCTRLCONF_GROUP("GPIO21", 0x8014, 0x3, 0x18,
+			0x88e8, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO21 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "spi2"), /* SCLK */
+			BERLIN_PINCTRL_FUNCTION(0x3, "sdio2"), /* CLK */
+			BERLIN_PINCTRL_FUNCTION(0x5, "clkout")),
+	BERLIN_PINCTRLCONF_GROUP("GPIO22", 0x8014, 0x3, 0x1b,
+			0x88ec, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* GPIO22 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "spi2"), /* SDI */
+			BERLIN_PINCTRL_FUNCTION(0x3, "sdio2"), /* CDn */
+			BERLIN_PINCTRL_FUNCTION(0x4, "sdio1")), /* CDn */
+};
+
+static const struct berlin_desc_group sl2610_sysmgr_pinctrl_groups[] = {
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO31", 0xb00, 0x3, 0x00,
+			0xc00, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO31*/
+			BERLIN_PINCTRL_FUNCTION(0x1, "pwm"), /* SM PWM0*/
+			BERLIN_PINCTRL_FUNCTION(0x2, "uart1"), /* SM UART1 RXD */
+			BERLIN_PINCTRL_FUNCTION(0x3, "key_row7"),
+			BERLIN_PINCTRL_FUNCTION(0x4, "pdm"), /* SM PDM DI0 */
+			BERLIN_PINCTRL_FUNCTION(0x5, "uart0"), /* SM UART0 RXD */
+			BERLIN_PINCTRL_FUNCTION(0x6, "can1")), /* SM CAN1 RX */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO32", 0xb00, 0x3, 0x03,
+			0xc04, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO32 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "pwm"), /* SM PWM1 */
+			BERLIN_PINCTRL_FUNCTION(0x2, "uart1"), /* SM UART1 TXD */
+			BERLIN_PINCTRL_FUNCTION(0x3, "key_col0"),
+			BERLIN_PINCTRL_FUNCTION(0x4, "pdm"), /* SM PDM CLKIO */
+			BERLIN_PINCTRL_FUNCTION(0x5, "uart0"), /* SM UART0 TXD */
+			BERLIN_PINCTRL_FUNCTION(0x6, "can1")), /* SM CAN1 TX */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO33", 0xb00, 0x3, 0x06,
+			0xc08, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO33 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "pwm"), /* SM PWM2 */
+			BERLIN_PINCTRL_FUNCTION(0x3, "uart2"), /* SM UART2 TXD */
+			BERLIN_PINCTRL_FUNCTION(0x4, "uart3"), /* SM UART3 RTSn */
+			BERLIN_PINCTRL_FUNCTION(0x5, "key_row5"),
+			BERLIN_PINCTRL_FUNCTION(0x6, "uart3_de")), /* SM UART3 DE */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO34", 0xb00, 0x3, 0x09,
+			0xc0c, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO34 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "pwm"), /* SM PWM3 */
+			BERLIN_PINCTRL_FUNCTION(0x3, "uart2"), /* SM UART2 RXD */
+			BERLIN_PINCTRL_FUNCTION(0x4, "uart3"), /* SM UART3 CTSn */
+			BERLIN_PINCTRL_FUNCTION(0x5, "key_row4"),
+			BERLIN_PINCTRL_FUNCTION(0x6, "uart3_ren")), /* SM UART3 REn */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO35", 0xb00, 0x3, 0x0c,
+			0xc10, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO35 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "pwm"), /* SM PWM4 */
+			BERLIN_PINCTRL_FUNCTION(0x2, "uart1"), /* SM UART1 RTSn */
+			BERLIN_PINCTRL_FUNCTION(0x3, "uart3"), /* SM UART3 TXD */
+			BERLIN_PINCTRL_FUNCTION(0x4, "uart2"), /* SM UART2 RTSn */
+			BERLIN_PINCTRL_FUNCTION(0x5, "key_row3"),
+			BERLIN_PINCTRL_FUNCTION(0x6, "uart0")), /* SM UART0 RTSn */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO36", 0xb00, 0x3, 0x0f,
+			0xc14, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO36 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "pwm"), /* SM PWM5 */
+			BERLIN_PINCTRL_FUNCTION(0x2, "uart1"), /* SM UART1 CTSn */
+			BERLIN_PINCTRL_FUNCTION(0x3, "uart3"), /* SM UART3 RXD */
+			BERLIN_PINCTRL_FUNCTION(0x4, "uart2"), /* SM UART2 CTSn */
+			BERLIN_PINCTRL_FUNCTION(0x5, "key_row2"),
+			BERLIN_PINCTRL_FUNCTION(0x6, "uart0")), /* SM UART0 CTSn */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO37", 0xb00, 0x3, 0x12,
+			0xc18, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO37 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "pwm"), /* SM PWM6 */
+			BERLIN_PINCTRL_FUNCTION(0x3, "tw0"), /* SM TW0 SCL */
+			BERLIN_PINCTRL_FUNCTION(0x4, "key_row6"),
+			BERLIN_PINCTRL_FUNCTION(0x5, "pdm")), /* SM PDM CLKIO */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO38", 0xb00, 0x3, 0x15,
+			0xc1c, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO38 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "pwm"), /* SM PWM7 */
+			BERLIN_PINCTRL_FUNCTION(0x3, "tw0"), /* SM TW0 SDA */
+			BERLIN_PINCTRL_FUNCTION(0x5, "pdm")), /* SM PDM DI0 */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO3", 0xb00, 0x3, 0x18,
+			0xc20, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO3 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "spi1"), /* SM SPI1 SS0n */
+			BERLIN_PINCTRL_FUNCTION(0x2, "tw1"), /* SM TW1 SCL */
+			BERLIN_PINCTRL_FUNCTION(0x3, "pwm"), /* SM PWM8 */
+			BERLIN_PINCTRL_FUNCTION(0x4, "i3c")), /* SM I3C MS SCL */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO4", 0xb00, 0x3, 0x1b,
+			0xc24, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO4 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "spi1"), /* SM SPI1 SS1n */
+			BERLIN_PINCTRL_FUNCTION(0x2, "tw1"), /* SM TW1 SDA */
+			BERLIN_PINCTRL_FUNCTION(0x3, "pwm"), /* SM PWM0 */
+			BERLIN_PINCTRL_FUNCTION(0x4, "i3c")), /* SM I3C MS SDA */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO5", 0xb04, 0x3, 0x00,
+			0xc28, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO5 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "spi1"), /* SM SPI1 SS2n */
+			BERLIN_PINCTRL_FUNCTION(0x3, "pwm")), /* SM PWM1 */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO6", 0xb04, 0x3, 0x03,
+			0xc2c, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO6 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "spi1"), /* SM SPI1 SS3n */
+			BERLIN_PINCTRL_FUNCTION(0x2, "spi1s"), /* SM SPI1S SSn */
+			BERLIN_PINCTRL_FUNCTION(0x3, "pwm")), /* SM PWM2 */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO9", 0xb04, 0x3, 0x06,
+			0xc30, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO9 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "spi1"), /* SM SPI1 SDO */
+			BERLIN_PINCTRL_FUNCTION(0x2, "spi1s"), /* SM SPI1S SDO */
+			BERLIN_PINCTRL_FUNCTION(0x3, "pwm")), /* SM PWM3 */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO10", 0xb04, 0x3, 0x09,
+			0xc34, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO10 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "spi1"), /* SM SPI1 SCLK */
+			BERLIN_PINCTRL_FUNCTION(0x2, "spi1s"), /* SM SPI1S SCLK */
+			BERLIN_PINCTRL_FUNCTION(0x3, "pwm")), /* SM PWM4 */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO11", 0xb04, 0x3, 0x0c,
+			0xc38, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO11 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "spi1"), /* SM SPI1 SDI */
+			BERLIN_PINCTRL_FUNCTION(0x2, "spi1s"), /* SM SPI1S SDI */
+			BERLIN_PINCTRL_FUNCTION(0x3, "pwm")), /* SM PWM5 */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO30", 0xb04, 0x3, 0x0f,
+			0xc44, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO30 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "xspi"), /* SM XSPI DATA7 */
+			BERLIN_PINCTRL_FUNCTION(0x3, "key_col6"),
+			BERLIN_PINCTRL_FUNCTION(0x7, "sm_clkout")),
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO29", 0xb04, 0x3, 0x12,
+			0xc48, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO29 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "xspi"), /* SM XSPI DATA6 */
+			BERLIN_PINCTRL_FUNCTION(0x2, "uart3"), /* SM UART3 RXD */
+			BERLIN_PINCTRL_FUNCTION(0x3, "key_col5"),
+			BERLIN_PINCTRL_FUNCTION(0x4, "uart2"), /* SM UART2 CTSn */
+			BERLIN_PINCTRL_FUNCTION(0x5, "uart0"), /* SM UART0 CTSn */
+			BERLIN_PINCTRL_FUNCTION(0x6, "key_row2"),
+			BERLIN_PINCTRL_FUNCTION(0x7, "uart1")), /* SM UART1 CTSn */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO28", 0xb04, 0x3, 0x15,
+			0xc4c, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO28 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "xspi"), /* SM XSPI DATA5 */
+			BERLIN_PINCTRL_FUNCTION(0x2, "uart3"), /* SM UART3 TXD */
+			BERLIN_PINCTRL_FUNCTION(0x3, "key_col4"),
+			BERLIN_PINCTRL_FUNCTION(0x4, "uart2"), /* SM UART2 RTSn */
+			BERLIN_PINCTRL_FUNCTION(0x5, "uart0"), /* SM UART0 RTSn */
+			BERLIN_PINCTRL_FUNCTION(0x6, "key_row3"),
+			BERLIN_PINCTRL_FUNCTION(0x7, "uart1")), /* SM UART1 RTSn */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO27", 0xb04, 0x3, 0x18,
+			0xc50, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO27 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "xspi"), /* SM XSPI DATA4 */
+			BERLIN_PINCTRL_FUNCTION(0x2, "uart2"), /* SM UART2 RXD */
+			BERLIN_PINCTRL_FUNCTION(0x3, "key_col3"),
+			BERLIN_PINCTRL_FUNCTION(0x4, "uart3"), /* SM UART3 CTSn */
+			BERLIN_PINCTRL_FUNCTION(0x5, "uart3_ren"), /* SM UART3 REn */
+			BERLIN_PINCTRL_FUNCTION(0x6, "key_row4")),
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO26", 0xb04, 0x3, 0x1b,
+			0xc54, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO26 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "xspi"), /* SM XSPI CS1n */
+			BERLIN_PINCTRL_FUNCTION(0x2, "uart2"), /* SM UART2 TXD */
+			BERLIN_PINCTRL_FUNCTION(0x3, "key_col2"),
+			BERLIN_PINCTRL_FUNCTION(0x4, "uart3"), /* SM UART3 RTSn */
+			BERLIN_PINCTRL_FUNCTION(0x5, "uart3_de"), /* SM UART3 DE */
+			BERLIN_PINCTRL_FUNCTION(0x6, "key_row5"),
+			BERLIN_PINCTRL_FUNCTION(0x7, "sm_clkout")),
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO25", 0xb08, 0x3, 0x00,
+			0xc58, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO25 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "xspi"), /* SM XSPI DQS */
+			BERLIN_PINCTRL_FUNCTION(0x6, "key_row6")),
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO24", 0xb08, 0x3, 0x03,
+			0xc5c, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO24 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "xspi")), /* SM XSPI CLKn */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO23", 0xb08, 0x3, 0x06,
+			0xc60, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO23 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "xspi")), /* SM XSPI CLK */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO22", 0xb08, 0x3, 0x09,
+			0xc64, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO22 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "xspi")), /* SM XSPI DATA3 */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO21", 0xb08, 0x3, 0x0c,
+			0xc68, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO21 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "xspi")), /* SM XSPI DATA2 */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO20", 0xb08, 0x3, 0x0f,
+			0xc6c, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO20 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "xspi")), /* SM XSPI DATA1 */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO19", 0xb08, 0x3, 0x12,
+			0xc70, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO19 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "xspi")), /* SM XSPI DATA0 */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO18", 0xb08, 0x3, 0x15,
+			0xc74, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO18 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "xspi")), /* SM XSPI CS0n*/
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO17", 0xb08, 0x3, 0x18,
+			0xc78, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO17 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "uart1"), /* SM UART1 TXD */
+			BERLIN_PINCTRL_FUNCTION(0x2, "can0"), /* SM CAN0 TX */
+			BERLIN_PINCTRL_FUNCTION(0x3, "pwm"), /* SM PWM8 */
+			BERLIN_PINCTRL_FUNCTION(0x6, "uart0")), /* SM UART0 TXD */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO15", 0xb08, 0x3, 0x1b,
+			0xc7c, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO15 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "tw1"), /* SM TW1 SDA */
+			BERLIN_PINCTRL_FUNCTION(0x2, "uart0"), /* SM UART0 RTSn */
+			BERLIN_PINCTRL_FUNCTION(0x3, "pwm"), /* SM PWM11 */
+			BERLIN_PINCTRL_FUNCTION(0x4, "can0"), /* SM CAN0 TX */
+			BERLIN_PINCTRL_FUNCTION(0x6, "uart1"), /* SM UART1 RTSn */
+			BERLIN_PINCTRL_FUNCTION(0x7, "dbg")), /* DBG OUT */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO14", 0xb0c, 0x3, 0x00,
+			0xc80, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO14 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "tw1"), /* SM TW1 SCL */
+			BERLIN_PINCTRL_FUNCTION(0x2, "uart0"), /* SM UART0 CTSn */
+			BERLIN_PINCTRL_FUNCTION(0x3, "pwm"), /* SM PWM10 */
+			BERLIN_PINCTRL_FUNCTION(0x4, "can0"), /* SM CAN0 RX */
+			BERLIN_PINCTRL_FUNCTION(0x6, "uart1"), /* SM UART1 CTSn */
+			BERLIN_PINCTRL_FUNCTION(0x7, "dbg")), /* DBG OUT */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO16", 0xb0c, 0x3, 0x03,
+			0xc84, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO16 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "uart1"), /* SM UART1 RXD */
+			BERLIN_PINCTRL_FUNCTION(0x2, "can0"), /* SM CAN0 RX */
+			BERLIN_PINCTRL_FUNCTION(0x3, "pwm")), /* SM PWM7 */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO13", 0xb0c, 0x3, 0x06,
+			0xc88, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO13 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "tw0"), /* SM TW0 SDA */
+			BERLIN_PINCTRL_FUNCTION(0x2, "i3c"), /* SM I3C MS SDA */
+			BERLIN_PINCTRL_FUNCTION(0x3, "sm_clkout"),
+			BERLIN_PINCTRL_FUNCTION(0x7, "dbg")), /* DBG out */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO12", 0xb0c, 0x3, 0x09,
+			0xc8c, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO12 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "tw0"), /* SM TW0 SCL */
+			BERLIN_PINCTRL_FUNCTION(0x2, "i3c"), /* SM I3C MS SCL */
+			BERLIN_PINCTRL_FUNCTION(0x3, "pwm"), /* SM PWM6 */
+			BERLIN_PINCTRL_FUNCTION(0x7, "dbg")), /* DBG CLK */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO8", 0xb0c, 0x3, 0x0c,
+			0xc90, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO8 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "uart0"), /* SM UART0 TXD */
+			BERLIN_PINCTRL_FUNCTION(0x2, "can0"), /* SM CAN0 TX */
+			BERLIN_PINCTRL_FUNCTION(0x3, "sm_clkout"),
+			BERLIN_PINCTRL_FUNCTION(0x6, "uart1")), /* SM UART0 TXD */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO7", 0xb0c, 0x3, 0x0f,
+			0xc94, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"), /* SM GPIO7 */
+			BERLIN_PINCTRL_FUNCTION(0x1, "uart0"), /* SM UART0 RXD */
+			BERLIN_PINCTRL_FUNCTION(0x2, "can0"), /* SM CAN0 RX */
+			BERLIN_PINCTRL_FUNCTION(0x3, "key_row6"),
+			BERLIN_PINCTRL_FUNCTION(0x4, "gpio_trig"), /* TRIG2 */
+			BERLIN_PINCTRL_FUNCTION(0x5, "pwm"), /* SM PWM9 */
+			BERLIN_PINCTRL_FUNCTION(0x6, "uart1")), /* SM UART0 RXD */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO2", 0xb0c, 0x3, 0x12,
+			0xc98, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "jtag"), /* TDO */
+			BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* SM GPIO2 */
+			BERLIN_PINCTRL_FUNCTION(0x2, "pdm"), /* SM PDM CLKIO */
+			BERLIN_PINCTRL_FUNCTION(0x3, "i2s2"), /* MCLK */
+			BERLIN_PINCTRL_FUNCTION(0x6, "pwm")), /* SM PWM11 */
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO1", 0xb0c, 0x3, 0x15,
+			0xc9c, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "jtag"), /* TDI */
+			BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* SM GPIO1 */
+			BERLIN_PINCTRL_FUNCTION(0x2, "uart0"), /* SM UART0 RXD */
+			BERLIN_PINCTRL_FUNCTION(0x3, "key_col1"),
+			BERLIN_PINCTRL_FUNCTION(0x4, "gpio_trig"), /* TRIG0 */
+			BERLIN_PINCTRL_FUNCTION(0x5, "pwm"), /* SM PWM9 */
+			BERLIN_PINCTRL_FUNCTION(0x6, "key_row7")),
+	BERLIN_PINCTRLCONF_GROUP("SM_GPIO0", 0xb0c, 0x3, 0x18,
+			0xca0, 10,
+			BERLIN_PINCTRL_FUNCTION(0x0, "jtag"), /* TMS */
+			BERLIN_PINCTRL_FUNCTION(0x1, "gpio"), /* SM GPIO0 */
+			BERLIN_PINCTRL_FUNCTION(0x2, "uart0"), /* SM UART0 TXD */
+			BERLIN_PINCTRL_FUNCTION(0x3, "key_col0"),
+			BERLIN_PINCTRL_FUNCTION(0x5, "pdm"), /* SM PDM DI0 */
+			BERLIN_PINCTRL_FUNCTION(0x6, "pwm")), /* SM PWM10 */
+};
+
+static const struct berlin_pinctrl_desc sl2610_soc_pinctrl_data = {
+	.groups = sl2610_soc_pinctrl_groups,
+	.ngroups = ARRAY_SIZE(sl2610_soc_pinctrl_groups),
+};
+
+static const struct berlin_pinctrl_desc sl2610_sysmgr_pinctrl_data = {
+	.groups = sl2610_sysmgr_pinctrl_groups,
+	.ngroups = ARRAY_SIZE(sl2610_sysmgr_pinctrl_groups),
+};
+
+static const struct platform_device_id sl2610_pinctrl_ids[] = {
+	{ "sl2610-soc-pinctrl", (kernel_ulong_t)&sl2610_soc_pinctrl_data },
+	{ "sl2610-mcu-pinctrl", (kernel_ulong_t)&sl2610_sysmgr_pinctrl_data },
+	{ }
+};
+MODULE_DEVICE_TABLE(platform, sl2610_pinctrl_ids);
+
+static void sl2610_pinctrl_clear_node(void *data)
+{
+	device_set_node(data, NULL);
+}
+
+static int sl2610_pinctrl_probe(struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+	const struct berlin_pinctrl_desc *desc =
+		(void *)platform_get_device_id(pdev)->driver_data;
+	struct regmap *regmap;
+	int ret;
+
+	regmap = syscon_node_to_regmap(dev->parent->of_node);
+	if (IS_ERR(regmap))
+		return dev_err_probe(dev, PTR_ERR(regmap), "Failed to get syscon regmap\n");
+
+	device_set_node(dev, dev_fwnode(dev->parent));
+	ret = devm_add_action_or_reset(dev, sl2610_pinctrl_clear_node, dev);
+	if (ret)
+		return ret;
+
+	return berlin_pinctrl_probe_regmap(pdev, desc, regmap);
+}
+
+static struct platform_driver sl2610_pinctrl_driver = {
+	.probe = sl2610_pinctrl_probe,
+	.id_table = sl2610_pinctrl_ids,
+	.driver = {
+		.name = "sl2610-pinctrl",
+	},
+};
+module_platform_driver(sl2610_pinctrl_driver);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Jisheng Zhang <jszhang@kernel.org>");
+MODULE_DESCRIPTION("pinctrl driver for Synaptics SL2610 SoC");
-- 
2.55.0


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

* [PATCH v4 09/13] clk: berlin: add Synaptics clock controller helpers
  2026-12-04 14:07 [PATCH v4 00/13] arm64: add Synaptics SL2610 SoCs and RDK boards Jisheng Zhang
                   ` (7 preceding siblings ...)
  2026-12-04 14:07 ` [PATCH v4 08/13] pinctrl: berlin: add Synaptics SL2610 pin " Jisheng Zhang
@ 2026-12-04 14:07 ` Jisheng Zhang
  2026-12-04 17:13   ` sashiko-bot
  2026-12-04 14:07 ` [PATCH v4 10/13] clk: berlin: add Synaptics SL2610 clocks and PLLs Jisheng Zhang
                   ` (3 subsequent siblings)
  12 siblings, 1 reply; 24+ messages in thread
From: Jisheng Zhang @ 2026-12-04 14:07 UTC (permalink / raw)
  To: Rob Herring, Conor Dooley, Krzysztof Kozlowski, Catalin Marinas,
	Will Deacon, Mark Rutland, Sebastian Hesselbarth, Stephen Boyd,
	Brian Masney, Jerome Brunet, Linus Walleij, Philipp Zabel,
	Lee Jones
  Cc: devicetree, linux-kernel, linux-arm-kernel, linux-clk, linux-gpio,
	mfd, Richard GENOUD

Add the configurable divider and gate clock implementation shared by
Synaptics system controllers. Provide the MCU system manager helper for
registering its fixed clocks, gates and peripheral dividers.

Keep clock resources managed by the MFD clock device and obtain the
register range and provider node from its parent.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 drivers/clk/Kconfig                |   1 +
 drivers/clk/berlin/Kconfig         |   7 +
 drivers/clk/berlin/Makefile        |   2 +
 drivers/clk/berlin/sl-clk.c        | 279 +++++++++++++++++++++++++++++
 drivers/clk/berlin/sl-clk.h        |  31 ++++
 drivers/clk/berlin/sl-sysmgr-clk.c | 241 +++++++++++++++++++++++++
 drivers/clk/berlin/sl-sysmgr-clk.h |  44 +++++
 7 files changed, 605 insertions(+)
 create mode 100644 drivers/clk/berlin/Kconfig
 create mode 100644 drivers/clk/berlin/sl-clk.c
 create mode 100644 drivers/clk/berlin/sl-clk.h
 create mode 100644 drivers/clk/berlin/sl-sysmgr-clk.c
 create mode 100644 drivers/clk/berlin/sl-sysmgr-clk.h

diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
index 37a8e35d4178..906fabfe0d33 100644
--- a/drivers/clk/Kconfig
+++ b/drivers/clk/Kconfig
@@ -514,6 +514,7 @@ source "drivers/clk/analogbits/Kconfig"
 source "drivers/clk/anlogic/Kconfig"
 source "drivers/clk/aspeed/Kconfig"
 source "drivers/clk/bcm/Kconfig"
+source "drivers/clk/berlin/Kconfig"
 source "drivers/clk/cix/Kconfig"
 source "drivers/clk/davinci/Kconfig"
 source "drivers/clk/eswin/Kconfig"
diff --git a/drivers/clk/berlin/Kconfig b/drivers/clk/berlin/Kconfig
new file mode 100644
index 000000000000..8f71d4c7a478
--- /dev/null
+++ b/drivers/clk/berlin/Kconfig
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0
+
+config SL_COMMON_CLK
+	bool
+
+config SL_SYSMGR_CLK
+	bool
diff --git a/drivers/clk/berlin/Makefile b/drivers/clk/berlin/Makefile
index 3733733a4806..5dbd0fd264ad 100644
--- a/drivers/clk/berlin/Makefile
+++ b/drivers/clk/berlin/Makefile
@@ -3,3 +3,5 @@ obj-y += berlin2-avpll.o berlin2-pll.o berlin2-div.o
 obj-$(CONFIG_MACH_BERLIN_BG2)	+= bg2.o
 obj-$(CONFIG_MACH_BERLIN_BG2CD)	+= bg2.o
 obj-$(CONFIG_MACH_BERLIN_BG2Q)	+= bg2q.o
+obj-$(CONFIG_SL_COMMON_CLK)	+= sl-clk.o
+obj-$(CONFIG_SL_SYSMGR_CLK)	+= sl-sysmgr-clk.o
diff --git a/drivers/clk/berlin/sl-clk.c b/drivers/clk/berlin/sl-clk.c
new file mode 100644
index 000000000000..e212320a0637
--- /dev/null
+++ b/drivers/clk/berlin/sl-clk.c
@@ -0,0 +1,279 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2018 Synaptics Incorporated
+ * Copyright (c) 2015 Marvell Technology Group Ltd.
+ *
+ * Author: Jisheng Zhang <jszhang@kernel.org>
+ */
+
+#include <linux/bitfield.h>
+#include <linux/bitops.h>
+#include <linux/clk-provider.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/slab.h>
+#include <linux/spinlock.h>
+
+#include "sl-clk.h"
+
+#define SL_CLK_EN		BIT(0)
+#define SL_CLK_PLL_SEL		GENMASK(3, 1)
+#define SL_CLK_PLL_SWITCH	BIT(4)
+#define SL_CLK_DIV_SWITCH	BIT(5)
+#define SL_CLK_DIV3_SWITCH	BIT(6)
+#define SL_CLK_DIV_SEL		GENMASK(9, 7)
+#define SL_MAX_PARENTS	6
+
+struct sl_clk {
+	struct clk_hw hw;
+	void __iomem *reg;
+	spinlock_t *lock;
+	struct device *dev;
+};
+
+#define to_sl_clk(_hw) container_of(_hw, struct sl_clk, hw)
+
+static const unsigned int sl_clk_values[] = { 1, 2, 3, 4, 6, 8, 12 };
+
+static unsigned int sl_clk_value(u32 val)
+{
+	static const u8 div_table[] = { 0, 2, 4, 6, 8, 12, 0, 0 };
+
+	if (val & SL_CLK_DIV3_SWITCH)
+		return 3;
+	if (!(val & SL_CLK_DIV_SWITCH))
+		return 1;
+
+	return div_table[FIELD_GET(SL_CLK_DIV_SEL, val)];
+}
+
+static unsigned long sl_clk_recalc_rate(struct clk_hw *hw,
+					unsigned long parent_rate)
+{
+	struct sl_clk *clk = to_sl_clk(hw);
+	unsigned int divisor = sl_clk_value(readl_relaxed(clk->reg));
+
+	if (WARN_ON_ONCE(!divisor))
+		return 0;
+
+	return parent_rate / divisor;
+}
+
+static unsigned int sl_clk_best(unsigned long parent_rate,
+				unsigned long rate)
+{
+	unsigned long best_diff = ULONG_MAX;
+	unsigned int best = 1, i;
+
+	for (i = 0; i < ARRAY_SIZE(sl_clk_values); i++) {
+		unsigned long candidate = parent_rate / sl_clk_values[i];
+		unsigned long diff = candidate > rate ? candidate - rate :
+							     rate - candidate;
+
+		if (diff < best_diff) {
+			best_diff = diff;
+			best = sl_clk_values[i];
+		}
+	}
+
+	return best;
+}
+
+static int sl_clk_determine_rate(struct clk_hw *hw,
+				 struct clk_rate_request *req)
+{
+	struct clk_hw *parent = clk_hw_get_parent(hw);
+
+	if (!parent)
+		return -EINVAL;
+
+	req->best_parent_hw = parent;
+	req->best_parent_rate = clk_hw_get_rate(parent);
+	req->rate = req->best_parent_rate /
+		    sl_clk_best(req->best_parent_rate, req->rate);
+
+	return 0;
+}
+
+static int sl_clk_set_rate(struct clk_hw *hw, unsigned long rate,
+			   unsigned long parent_rate)
+{
+	struct sl_clk *clk = to_sl_clk(hw);
+	unsigned int divisor, select;
+	unsigned long flags;
+	u32 val;
+
+	divisor = sl_clk_best(parent_rate, rate);
+	if (parent_rate / divisor != rate)
+		return -EINVAL;
+
+	spin_lock_irqsave(clk->lock, flags);
+	val = readl_relaxed(clk->reg);
+	val &= ~(SL_CLK_DIV3_SWITCH | SL_CLK_DIV_SWITCH |
+		 SL_CLK_DIV_SEL);
+	if (divisor == 3) {
+		val |= SL_CLK_DIV3_SWITCH;
+	} else if (divisor != 1) {
+		switch (divisor) {
+		case 2:
+			select = 1;
+			break;
+		case 4:
+			select = 2;
+			break;
+		case 6:
+			select = 3;
+			break;
+		case 8:
+			select = 4;
+			break;
+		case 12:
+			select = 5;
+			break;
+		default:
+			spin_unlock_irqrestore(clk->lock, flags);
+			return -EINVAL;
+		}
+		val |= SL_CLK_DIV_SWITCH |
+			FIELD_PREP(SL_CLK_DIV_SEL, select);
+	}
+	writel_relaxed(val, clk->reg);
+	spin_unlock_irqrestore(clk->lock, flags);
+
+	return 0;
+}
+
+static u8 sl_clk_get_parent(struct clk_hw *hw)
+{
+	struct sl_clk *clk = to_sl_clk(hw);
+	u32 val = readl_relaxed(clk->reg);
+	u8 selector;
+	unsigned int index;
+
+	if (!(val & SL_CLK_PLL_SWITCH))
+		return 0;
+
+	selector = FIELD_GET(SL_CLK_PLL_SEL, val);
+	index = selector + 1;
+	if (index < clk_hw_get_num_parents(hw))
+		return index;
+
+	dev_warn(clk->dev, "%s: unsupported parent selector %u\n",
+		 clk_hw_get_name(hw), selector);
+	return 0;
+}
+
+static int sl_clk_set_parent(struct clk_hw *hw, u8 index)
+{
+	struct sl_clk *clk = to_sl_clk(hw);
+	unsigned long flags;
+	u32 val;
+
+	if (index >= clk_hw_get_num_parents(hw) || index >= SL_MAX_PARENTS)
+		return -EINVAL;
+
+	spin_lock_irqsave(clk->lock, flags);
+	val = readl_relaxed(clk->reg);
+	if (!index) {
+		val &= ~SL_CLK_PLL_SWITCH;
+	} else {
+		val &= ~SL_CLK_PLL_SEL;
+		val |= SL_CLK_PLL_SWITCH |
+			FIELD_PREP(SL_CLK_PLL_SEL, index - 1);
+	}
+	writel_relaxed(val, clk->reg);
+	spin_unlock_irqrestore(clk->lock, flags);
+
+	return 0;
+}
+
+static int sl_clk_enable(struct clk_hw *hw)
+{
+	struct sl_clk *clk = to_sl_clk(hw);
+	unsigned long flags;
+	u32 val;
+
+	spin_lock_irqsave(clk->lock, flags);
+	val = readl_relaxed(clk->reg);
+	writel_relaxed(val | SL_CLK_EN, clk->reg);
+	spin_unlock_irqrestore(clk->lock, flags);
+
+	return 0;
+}
+
+static void sl_clk_disable(struct clk_hw *hw)
+{
+	struct sl_clk *clk = to_sl_clk(hw);
+	unsigned long flags;
+	u32 val;
+
+	spin_lock_irqsave(clk->lock, flags);
+	val = readl_relaxed(clk->reg);
+	writel_relaxed(val & ~SL_CLK_EN, clk->reg);
+	spin_unlock_irqrestore(clk->lock, flags);
+}
+
+static int sl_clk_is_enabled(struct clk_hw *hw)
+{
+	struct sl_clk *clk = to_sl_clk(hw);
+
+	return !!(readl_relaxed(clk->reg) & SL_CLK_EN);
+}
+
+static const struct clk_ops sl_clk_ops = {
+	.get_parent = sl_clk_get_parent,
+	.set_parent = sl_clk_set_parent,
+	.recalc_rate = sl_clk_recalc_rate,
+	.determine_rate = sl_clk_determine_rate,
+	.set_rate = sl_clk_set_rate,
+	.enable = sl_clk_enable,
+	.disable = sl_clk_disable,
+	.is_enabled = sl_clk_is_enabled,
+};
+
+struct clk_hw *sl_clk_register(struct device *dev, void __iomem *reg,
+			       const char *name, const char * const *parent_names,
+			       unsigned int num_parents, unsigned long flags,
+			       spinlock_t *lock)
+{
+	struct clk_init_data init = {};
+	struct sl_clk *clk;
+	unsigned int i;
+	int ret;
+
+	if (!dev || !reg || !name || !parent_names || !num_parents ||
+	    num_parents > SL_MAX_PARENTS || !lock)
+		return ERR_PTR(-EINVAL);
+
+	for (i = 0; i < num_parents; i++)
+		if (!parent_names[i])
+			return ERR_PTR(-EINVAL);
+
+	clk = devm_kzalloc(dev, sizeof(*clk), GFP_KERNEL);
+	if (!clk)
+		return ERR_PTR(-ENOMEM);
+
+	clk->dev = dev;
+	clk->reg = reg;
+	clk->lock = lock;
+
+	init.name = name;
+	init.ops = &sl_clk_ops;
+	init.parent_names = parent_names;
+	init.num_parents = num_parents;
+	init.flags = flags;
+	clk->hw.init = &init;
+
+	ret = devm_clk_hw_register(dev, &clk->hw);
+	if (ret)
+		return ERR_PTR(ret);
+
+	return &clk->hw;
+}
+EXPORT_SYMBOL_GPL(sl_clk_register);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Synaptics SL261x clock divider support");
diff --git a/drivers/clk/berlin/sl-clk.h b/drivers/clk/berlin/sl-clk.h
new file mode 100644
index 000000000000..7489b26a5e8d
--- /dev/null
+++ b/drivers/clk/berlin/sl-clk.h
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __SL_CLK_H
+#define __SL_CLK_H
+
+#include <linux/compiler_types.h>
+#include <linux/spinlock_types.h>
+
+struct clk_hw;
+struct device;
+
+struct sl_clk_desc {
+	const char	*name;
+	u32		id;
+	u32		offset;
+	unsigned long	flags;
+};
+
+struct sl_gateclk_desc {
+	const char	*name;
+	const char	*parent_name;
+	u32		id;
+	u8		bit_idx;
+	unsigned long	flags;
+};
+
+struct clk_hw *sl_clk_register(struct device *dev, void __iomem *reg,
+			       const char *name, const char * const *parent_names,
+			       unsigned int num_parents, unsigned long flags,
+			       spinlock_t *lock);
+
+#endif /* __SL_CLK_H */
diff --git a/drivers/clk/berlin/sl-sysmgr-clk.c b/drivers/clk/berlin/sl-sysmgr-clk.c
new file mode 100644
index 000000000000..f3cf921fc3c1
--- /dev/null
+++ b/drivers/clk/berlin/sl-sysmgr-clk.c
@@ -0,0 +1,241 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2026 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <jszhang@kernel.org>
+ *
+ */
+
+#include <linux/clk-provider.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/slab.h>
+#include <linux/platform_device.h>
+#include <linux/version.h>
+
+#include "sl-sysmgr-clk.h"
+
+#define CLK_EN		BIT(0)
+#define DIV_CHNG_EN	BIT(1)
+
+struct sl_sysmgr_gateclk {
+	struct clk_hw hw;
+	void __iomem *base;
+	u8 bit_idx;
+};
+
+struct sl_sysmgr_clk {
+	struct clk_hw hw;
+	void __iomem *base;
+	u8 div_bits;
+};
+
+struct sl_sysmgr_clk_priv {
+	struct sl_sysmgr_gateclk *gclks;
+	struct sl_sysmgr_clk *clks;
+};
+
+static DEFINE_SPINLOCK(sl_sysmgr_gateclk_lock);
+
+#define to_sl_sysmgr_gateclk(hw)	container_of(hw, struct sl_sysmgr_gateclk, hw)
+#define to_sl_sysmgr_clk(hw)		container_of(hw, struct sl_sysmgr_clk, hw)
+
+static int sl_sysmgr_gateclk_enable(struct clk_hw *hw)
+{
+	u32 val;
+	struct sl_sysmgr_gateclk *clk = to_sl_sysmgr_gateclk(hw);
+
+	guard(spinlock)(&sl_sysmgr_gateclk_lock);
+
+	val = readl_relaxed(clk->base);
+	if (!(val & BIT(clk->bit_idx))) {
+		val |= BIT(clk->bit_idx);
+		writel_relaxed(val, clk->base);
+	}
+
+	return 0;
+}
+
+static int sl_sysmgr_gateclk_is_enabled(struct clk_hw *hw)
+{
+	u32 val;
+	struct sl_sysmgr_gateclk *clk = to_sl_sysmgr_gateclk(hw);
+
+	guard(spinlock)(&sl_sysmgr_gateclk_lock);
+
+	val = readl_relaxed(clk->base);
+	val &= BIT(clk->bit_idx);
+
+	return val ? 1 : 0;
+}
+
+static const struct clk_ops sl_sysmgr_gateclk_ops = {
+	.enable		= sl_sysmgr_gateclk_enable,
+	.is_enabled	= sl_sysmgr_gateclk_is_enabled,
+};
+
+static int
+sl_sysmgr_gateclk_register(struct device *dev, struct sl_sysmgr_gateclk *gclk,
+			   const char *name, const char *parent_names,
+			   u8 bit_idx, void __iomem *base)
+{
+	struct clk_init_data init;
+
+	init.name = name;
+	init.ops = &sl_sysmgr_gateclk_ops;
+	init.parent_names = &parent_names;
+	init.num_parents = 1;
+	init.flags = 0;
+
+	gclk->bit_idx = bit_idx;
+	gclk->base = base;
+	gclk->hw.init = &init;
+
+	return devm_clk_hw_register(dev, &gclk->hw);
+}
+
+static unsigned long
+sl_sysmgr_clk_recalc_rate(struct clk_hw *hw, unsigned long parent_rate)
+{
+	u32 val, div;
+	struct sl_sysmgr_clk *clk = to_sl_sysmgr_clk(hw);
+
+	val = readl_relaxed(clk->base);
+	div = (val >> 2) & ((1 << clk->div_bits) - 1);
+	++div;
+
+	return parent_rate / div;
+}
+
+static int sl_sysmgr_clk_enable(struct clk_hw *hw)
+{
+	u32 val;
+	struct sl_sysmgr_clk *clk = to_sl_sysmgr_clk(hw);
+
+	val = readl_relaxed(clk->base);
+	if (!(val & CLK_EN)) {
+		val |= CLK_EN;
+		writel_relaxed(val, clk->base);
+	}
+
+	return 0;
+}
+
+static int sl_sysmgr_clk_is_enabled(struct clk_hw *hw)
+{
+	u32 val;
+	struct sl_sysmgr_clk *clk = to_sl_sysmgr_clk(hw);
+
+	val = readl_relaxed(clk->base);
+	val &= CLK_EN;
+
+	return val ? 1 : 0;
+}
+
+static const struct clk_ops sl_sysmgr_clk_ops = {
+	.recalc_rate	= sl_sysmgr_clk_recalc_rate,
+	.enable		= sl_sysmgr_clk_enable,
+	.is_enabled	= sl_sysmgr_clk_is_enabled,
+};
+
+static int
+sl_sysmgr_clk_register(struct device *dev, struct sl_sysmgr_clk *sclk,
+		       const char *name, const char *parent_names,
+		       u8 div_bits, void __iomem *base)
+{
+	struct clk_init_data init;
+
+	init.name = name;
+	init.ops = &sl_sysmgr_clk_ops;
+	init.parent_names = &parent_names;
+	init.num_parents = 1;
+	init.flags = 0;
+
+	sclk->div_bits = div_bits;
+	sclk->base = base;
+	sclk->hw.init = &init;
+
+	return devm_clk_hw_register(dev, &sclk->hw);
+}
+
+int sl_sysmgr_clk_setup(struct platform_device *pdev,
+			const struct sl_sysmgr_fixedclk_desc *fdescs,
+			int fclk_n,
+			const struct sl_sysmgr_gateclk_desc *gdescs,
+			int gclk_n,
+			u32 gclk_offset,
+			const struct sl_sysmgr_clk_desc *descs,
+			int clk_n)
+{
+	struct device_node *parent_np = pdev->dev.parent->of_node;
+	int i, ret, num = fclk_n + gclk_n + clk_n;
+	struct clk_hw_onecell_data *clk_data;
+	struct sl_sysmgr_clk_priv *priv;
+	struct clk_hw *clk_hw;
+	void __iomem *base;
+	u32 id;
+
+	clk_data = devm_kzalloc(&pdev->dev, struct_size(clk_data, hws, num), GFP_KERNEL);
+	if (!clk_data)
+		return -ENOMEM;
+	clk_data->num = num;
+
+	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
+	if (!priv)
+		return -ENOMEM;
+
+	priv->gclks = devm_kcalloc(&pdev->dev, gclk_n, sizeof(*priv->gclks), GFP_KERNEL);
+	if (!priv->gclks)
+		return -ENOMEM;
+
+	priv->clks = devm_kcalloc(&pdev->dev, clk_n, sizeof(*priv->clks), GFP_KERNEL);
+	if (!priv->clks)
+		return -ENOMEM;
+
+	base = devm_of_iomap(&pdev->dev, parent_np, 0, NULL);
+	if (IS_ERR(base))
+		return PTR_ERR(base);
+
+	for (i = 0; i < fclk_n; i++) {
+		clk_hw = devm_clk_hw_register_fixed_rate(&pdev->dev, fdescs[i].name,
+							 NULL, 0,
+							 fdescs[i].rate);
+		if (IS_ERR(clk_hw))
+			return PTR_ERR(clk_hw);
+
+		id = fdescs[i].id;
+		clk_data->hws[id] = clk_hw;
+	}
+
+	for (i = 0; i < gclk_n; i++) {
+		ret = sl_sysmgr_gateclk_register(&pdev->dev, &priv->gclks[i],
+						 gdescs[i].name, gdescs[i].parent_name,
+						 gdescs[i].bit_idx, base + gclk_offset);
+		if (ret)
+			return ret;
+
+		id = gdescs[i].id;
+		clk_data->hws[id] = &priv->gclks[i].hw;
+	}
+
+	for (i = 0; i < clk_n; i++) {
+		ret = sl_sysmgr_clk_register(&pdev->dev, &priv->clks[i],
+					     descs[i].name, descs[i].parent_name,
+					     descs[i].div_bits, base + descs[i].offset);
+		if (ret)
+			return ret;
+
+		id = descs[i].id;
+		clk_data->hws[id] = &priv->clks[i].hw;
+	}
+
+	platform_set_drvdata(pdev, priv);
+
+	return devm_of_clk_add_hw_provider(&pdev->dev, of_clk_hw_onecell_get, clk_data);
+}
+EXPORT_SYMBOL_GPL(sl_sysmgr_clk_setup);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Jisheng Zhang <jszhang@kernel.org>");
+MODULE_DESCRIPTION("SysMgr domain clk driver for Synaptics SL SoCs");
diff --git a/drivers/clk/berlin/sl-sysmgr-clk.h b/drivers/clk/berlin/sl-sysmgr-clk.h
new file mode 100644
index 000000000000..5ccf388bcccb
--- /dev/null
+++ b/drivers/clk/berlin/sl-sysmgr-clk.h
@@ -0,0 +1,44 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2026 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <jszhang@kernel.org>
+ *
+ */
+
+#ifndef __SL_SYSMGR_CLK_H
+#define __SL_SYSMGR_CLK_H
+
+struct sl_sysmgr_clk_desc {
+	const char	*name;
+	const char	*parent_name;
+	u32		id;
+	u32		offset;
+	u8		div_bits;
+	unsigned long	flags;
+};
+
+struct sl_sysmgr_gateclk_desc {
+	const char	*name;
+	const char	*parent_name;
+	u32		id;
+	u8		bit_idx;
+	unsigned long	flags;
+};
+
+struct sl_sysmgr_fixedclk_desc {
+	const char	*name;
+	u32		id;
+	unsigned long	rate;
+};
+
+int sl_sysmgr_clk_setup(struct platform_device *pdev,
+			const struct sl_sysmgr_fixedclk_desc *fdescs,
+			int fclk_n,
+			const struct sl_sysmgr_gateclk_desc *gdescs,
+			int gclk_n,
+			u32 gclk_offset,
+			const struct sl_sysmgr_clk_desc *descs,
+			int clk_n);
+
+#endif
-- 
2.55.0


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

* [PATCH v4 10/13] clk: berlin: add Synaptics SL2610 clocks and PLLs
  2026-12-04 14:07 [PATCH v4 00/13] arm64: add Synaptics SL2610 SoCs and RDK boards Jisheng Zhang
                   ` (8 preceding siblings ...)
  2026-12-04 14:07 ` [PATCH v4 09/13] clk: berlin: add Synaptics clock controller helpers Jisheng Zhang
@ 2026-12-04 14:07 ` Jisheng Zhang
  2026-12-04 17:39   ` sashiko-bot
  2026-12-04 14:07 ` [PATCH v4 11/13] dt-bindings: arm: berlin: add Synaptics SL2610 SoCs and RDK boards Jisheng Zhang
                   ` (2 subsequent siblings)
  12 siblings, 1 reply; 24+ messages in thread
From: Jisheng Zhang @ 2026-12-04 14:07 UTC (permalink / raw)
  To: Rob Herring, Conor Dooley, Krzysztof Kozlowski, Catalin Marinas,
	Will Deacon, Mark Rutland, Sebastian Hesselbarth, Stephen Boyd,
	Brian Masney, Jerome Brunet, Linus Walleij, Philipp Zabel,
	Lee Jones
  Cc: devicetree, linux-kernel, linux-arm-kernel, linux-clk, linux-gpio,
	mfd, Richard GENOUD

Support the SL2610 SoC, CPU, AVIO and MCU clocks. Register the PLL
outputs and the divider, gate and fixed-factor clocks used by the CPU
and peripherals.

Match MFD platform devices and register clock providers on their parent
system controller nodes.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 drivers/clk/berlin/Kconfig      |  26 +++
 drivers/clk/berlin/Makefile     |   2 +
 drivers/clk/berlin/clk-sl2610.c | 360 ++++++++++++++++++++++++++++++++
 drivers/clk/berlin/sl2610-pll.c | 145 +++++++++++++
 drivers/clk/berlin/sl2610-pll.h |  14 ++
 5 files changed, 547 insertions(+)
 create mode 100644 drivers/clk/berlin/clk-sl2610.c
 create mode 100644 drivers/clk/berlin/sl2610-pll.c
 create mode 100644 drivers/clk/berlin/sl2610-pll.h

diff --git a/drivers/clk/berlin/Kconfig b/drivers/clk/berlin/Kconfig
index 8f71d4c7a478..88760ad0af5b 100644
--- a/drivers/clk/berlin/Kconfig
+++ b/drivers/clk/berlin/Kconfig
@@ -5,3 +5,29 @@ config SL_COMMON_CLK
 
 config SL_SYSMGR_CLK
 	bool
+
+config SL2610_PLL
+	tristate "Synaptics SL2610 PLL Driver"
+	depends on ARCH_BERLIN || COMPILE_TEST
+	default n
+	help
+	  Support the integer and fractional PLL outputs used by the SoC,
+	  CPU and audio clock controllers on Synaptics SL2610 SoCs.
+
+	  To compile this driver as a module, choose M here. The module will
+	  be called sl2610-pll.
+
+config SL2610_CLK
+	tristate "Synaptics SL2610 Clock Driver"
+	depends on ARCH_BERLIN || COMPILE_TEST
+	depends on OF && HAS_IOMEM
+	select SL2610_PLL
+	select SL_COMMON_CLK
+	select SL_SYSMGR_CLK
+	help
+	  This driver provides support for clock controller on Synaptics SL2610
+	  SoC. The clock controller generates and supplies clocks to various
+	  peripherals within the SoC.
+
+	  To compile this driver as a module, choose M here. The module will
+	  be called clk-sl2610.
diff --git a/drivers/clk/berlin/Makefile b/drivers/clk/berlin/Makefile
index 5dbd0fd264ad..ec87dbed7dd4 100644
--- a/drivers/clk/berlin/Makefile
+++ b/drivers/clk/berlin/Makefile
@@ -5,3 +5,5 @@ obj-$(CONFIG_MACH_BERLIN_BG2CD)	+= bg2.o
 obj-$(CONFIG_MACH_BERLIN_BG2Q)	+= bg2q.o
 obj-$(CONFIG_SL_COMMON_CLK)	+= sl-clk.o
 obj-$(CONFIG_SL_SYSMGR_CLK)	+= sl-sysmgr-clk.o
+obj-$(CONFIG_SL2610_PLL)	+= sl2610-pll.o
+obj-$(CONFIG_SL2610_CLK)	+= clk-sl2610.o
diff --git a/drivers/clk/berlin/clk-sl2610.c b/drivers/clk/berlin/clk-sl2610.c
new file mode 100644
index 000000000000..b51d3523028d
--- /dev/null
+++ b/drivers/clk/berlin/clk-sl2610.c
@@ -0,0 +1,360 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2025 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <jszhang@kernel.org>
+ *
+ */
+
+#include <linux/clk-provider.h>
+#include <linux/platform_device.h>
+#include <linux/of_address.h>
+#include <linux/module.h>
+
+#include <dt-bindings/clock/syna,sl2610.h>
+
+#include "sl2610-pll.h"
+#include "sl-clk.h"
+#include "sl-sysmgr-clk.h"
+
+#define REG_CLKENABLE		0x0420
+
+#define CLK_GATE_CTRL0		0x0600
+
+#define SYSPLL0_OFFSET		0x0200
+#define SYSPLL1_OFFSET		0x0220
+#define CPUPLL_OFFSET		0x2000
+#define APLL0_OFFSET		0x0008
+#define APLL1_OFFSET		0x0030
+
+static DEFINE_SPINLOCK(gate_lock);
+static DEFINE_SPINLOCK(lock);
+
+enum {
+	SYSPLL0_OUT, SYSPLL0_OUTF,
+	SYSPLL1_OUT, SYSPLL1_OUTF,
+	CPUPLL_OUT, CPUPLL_OUTF,
+	APLL0_OUT, APLL0_OUTF,
+	APLL1_OUT, APLL1_OUTF,
+};
+
+static const char * const clk_names[] = {
+	[SYSPLL0_OUT]		= "syspll0_out",
+	[SYSPLL0_OUTF]		= "syspll0_outf",
+	[SYSPLL1_OUT]		= "syspll1_out",
+	[SYSPLL1_OUTF]		= "syspll1_outf",
+	[CPUPLL_OUT]		= "cpupll_out",
+	[CPUPLL_OUTF]		= "cpupll_outf",
+	[APLL0_OUT]		= "apll0_out",
+	[APLL0_OUTF]		= "apll0_outf",
+	[APLL1_OUT]		= "apll1_out",
+	[APLL1_OUTF]		= "apll1_outf",
+};
+
+static const struct sl_gateclk_desc sl2610_gates[] = {
+	{ "usb0coreclk",	"perifsysclk",	CLK_USB0CORE,		0 },
+	{ "sdiosysclk",		"perifsysclk",	CLK_SDIOSYS,		1 },
+	{ "emmcsysclk",		"perifsysclk",	CLK_EMMCSYS,		2 },
+	{ "gpuaxiclk",		"hpcclk",	CLK_GPUAXI,		3 },
+	{ "gethrgmiisysclk",	"perifsysclk",	CLK_GETHRGMIISYS,	4 },
+	{ "sdio1sysclk",	"perifsysclk",	CLK_SDIO1SYS,		5 },
+	{ "usb1coreclk",	"perifsysclk",	CLK_USB1CORE,		6 },
+	{ "gethrgmii1sysclk",	"perifsysclk",	CLK_GETHRGMII1SYS,	7 },
+	{ "usb0phyrefclk",	"perifsysclk",	CLK_USB0PHYREF,		8 },
+	{ "usb1phyrefclk",	"perifsysclk",	CLK_USB1PHYREF,		9 },
+	{ "apbuart0clk",	"apbcoreclk",	CLK_APBUART0,		10 },
+	{ "apbuart1clk",	"apbcoreclk",	CLK_APBUART1,		11 },
+	{ "apbuart2clk",	"apbcoreclk",	CLK_APBUART2,		12 },
+	{ "apbuart3lck",	"apbcoreclk",	CLK_APBUART3,		13 },
+	{ "apbi2c0clk",		"apbcoreclk",	CLK_APBI2C0,		14 },
+	{ "apbi2c1lck",		"apbcoreclk",	CLK_APBI2C1,		15 },
+	{ "apbspi0clk",		"apbcoreclk",	CLK_APBSPI0,		16 },
+	{ "apbspi1clk",		"apbcoreclk",	CLK_APBSPI1,		17 },
+	{ "apbspi2clk",		"apbcoreclk",	CLK_APBSPI2,		18 },
+	{ "apbspi3clk",		"apbcoreclk",	CLK_APBSPI3,		19 },
+	{ "apbgpioclk",		"apbcoreclk",	CLK_APBGPIO,		20 },
+	{ "apbtimersclk",	"apbcoreclk",	CLK_APBTIMERS,		21 },
+	{ "apbsyscntclk",	"apbcoreclk",	CLK_APBSYSCNT,		22 },
+	{ "apbwdtclk",		"apbcoreclk",	CLK_APBWDT,		23 },
+	{ "apbdmaclk",		"apbcoreclk",	CLK_APBDMA,		24 },
+};
+
+static const struct sl_clk_desc sl2610_descs[] = {
+	{ "cpufastrefclk",	CLK_CPUFASTREF,		0x440, CLK_IS_CRITICAL },
+	{ "memfastrefclk",	CLK_MEMFASTREF,		0x444, CLK_IS_CRITICAL },
+	{ "cfgclk",		CLK_CFG,		0x448, CLK_IS_CRITICAL },
+	{ "sysclk",		CLK_SYS,		0x44c, CLK_IS_CRITICAL },
+	{ "perifsysclk",	CLK_PERIFSYS,		0x450, CLK_IS_CRITICAL },
+	{ "apbcoreclk",		CLK_APBCORE,		0x454, CLK_IS_CRITICAL },
+	{ "apbserclk",		CLK_APBSER,		0x458, CLK_IS_CRITICAL },
+	{ "atbclk",		CLK_ATB,		0x45c },
+	{ "hpcclk",		CLK_HPC,		0x460, CLK_IS_CRITICAL },
+	{ "emmcclk",		CLK_EMMC,		0x464 },
+	{ "sd0clk",		CLK_SD0,		0x468 },
+	{ "sd1clk",		CLK_SD1,		0x46c },
+	{ "gethrgmiiclk",	CLK_GETHRGMII,		0x470 },
+	{ "gethrgmii1clk",	CLK_GETHRGMII1,		0x474 },
+	{ "ge0_ptp_refclk",	CLK_GE0_PTP_REF,	0x478 },
+	{ "ge1_ptp_refclk",	CLK_GE1_PTP_REF,	0x47c },
+	{ "usb2testclk",	CLK_USB2TEST,		0x480 },
+	{ "usb2test480mg0clk",	CLK_USB2TEST480MG0,	0x484 },
+	{ "usb2test480mg1clk",	CLK_USB2TEST480MG1,	0x488 },
+	{ "usb2test480mg2clk",	CLK_USB2TEST480MG2,	0x48c },
+	{ "usb2test100mg0clk",	CLK_USB2TEST100MG0,	0x490 },
+	{ "usb2test100mg1clk",	CLK_USB2TEST100MG1,	0x494 },
+	{ "usb2test100mg2clk",	CLK_USB2TEST100MG2,	0x498 },
+	{ "usb2test100mg3clk",	CLK_USB2TEST100MG3,	0x49c },
+	{ "periftest125mg0clk",	CLK_PERIFTEST125MG0,	0x4a0 },
+	{ "periftest200mg0clk",	CLK_PERIFTEST200MG0,	0x4a4 },
+	{ "periftest200mg1clk",	CLK_PERIFTEST200MG1,	0x4a8 },
+	{ "gpuclk",		CLK_GPU,		0x4ac },
+	{ "npuclk",		CLK_NPU,		0x4b0 },
+	{ "aviosysclk",		CLK_AVIOSYS,		0x4b4, CLK_IS_CRITICAL },
+	{ "aiosysclk",		CLK_AIOSYS,		0x4b8, CLK_IS_CRITICAL },
+	{ "avio_lcdc2scanclk",	CLK_AVIO_LCDC2SCAN,	0x4bc },
+	{ "avio_ipiclk",	CLK_AVIO_IPI,		0x4c0 },
+	{ "avio_pclk",		CLK_AVIO_P,		0x4c4 },
+	{ "avio_dphyrxtxescclk", CLK_AVIO_DPHYRXTXESC,	0x4c8 },
+	{ "aviofpllclk",	CLK_AVIOFPLL,		0x4cc },
+	{ "avio_rx_scanbyteclk", CLK_AVIO_RX_SCANBYTE,	0x4d0 },
+	{ "avio_rx_scantestclk", CLK_AVIO_RX_SCANTEST,	0x4d4 },
+};
+
+static const char * const default_parent_names[] = {
+	"syspll0_out",
+	"apll0_out",
+	"syspll0_outf",
+	"apll0_outf",
+	"syspll1_out",
+	"syspll1_outf",
+};
+
+static const char * const ge_ptp_refclk_parent_names[] = {
+	"osc",
+	"apll0_outf",
+	"syspll1_out",
+	"syspll0_out",
+	"clk_mcu_axi",
+};
+
+static int sl2610_soc_clk_setup(struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+	struct device_node *parent_np = dev->parent->of_node;
+	struct clk_hw_onecell_data *clk_data;
+	const char * const *parent_names;
+	int num_parents;
+	void __iomem *base;
+	struct clk_hw **hws;
+	int n, ret;
+	u32 id;
+
+	base = devm_of_iomap(dev, parent_np, 0, NULL);
+	if (IS_ERR(base))
+		return PTR_ERR(base);
+
+	clk_data = devm_kzalloc(dev, struct_size(clk_data, hws, SL2610_CLK_MAX), GFP_KERNEL);
+	if (!clk_data)
+		return -ENOMEM;
+	clk_data->num = SL2610_CLK_MAX;
+	hws = clk_data->hws;
+
+	/* sysplls */
+	ret = sl2610_pll_register(dev, base + SYSPLL0_OFFSET,
+				  clk_names[SYSPLL0_OUT], clk_names[SYSPLL0_OUTF]);
+	if (ret)
+		return ret;
+	ret = sl2610_pll_register(dev, base + SYSPLL1_OFFSET,
+				  clk_names[SYSPLL1_OUT], clk_names[SYSPLL1_OUTF]);
+	if (ret)
+		return ret;
+
+	/* normal clocks */
+	for (n = 0; n < ARRAY_SIZE(sl2610_descs); n++) {
+		const struct sl_clk_desc *cd = &sl2610_descs[n];
+
+		id = cd->id;
+		if (id == CLK_GE0_PTP_REF || id == CLK_GE1_PTP_REF) {
+			parent_names = ge_ptp_refclk_parent_names;
+			num_parents = ARRAY_SIZE(ge_ptp_refclk_parent_names);
+		} else {
+			parent_names = default_parent_names;
+			num_parents = ARRAY_SIZE(default_parent_names);
+		}
+		hws[id] = sl_clk_register(dev, base + cd->offset, cd->name,
+					  parent_names, num_parents, cd->flags, &lock);
+		if (IS_ERR(hws[id]))
+			return PTR_ERR(hws[id]);
+	}
+
+	/* gate clocks */
+	for (n = 0; n < ARRAY_SIZE(sl2610_gates); n++) {
+		const struct sl_gateclk_desc *gd = &sl2610_gates[n];
+
+		id = gd->id;
+		hws[id] = devm_clk_hw_register_gate(dev, gd->name, gd->parent_name,
+						    gd->flags, base + REG_CLKENABLE,
+						    gd->bit_idx, 0, &gate_lock);
+		if (IS_ERR(hws[id]))
+			return PTR_ERR(hws[id]);
+	}
+
+	return devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, clk_data);
+}
+
+static int sl2610_cpu_clk_setup(struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+	struct device_node *parent_np = dev->parent->of_node;
+	struct clk_hw_onecell_data *clk_data;
+	struct clk_hw **hws;
+	void __iomem *base;
+	int ret;
+
+	base = devm_of_iomap(dev, parent_np, 0, NULL);
+	if (IS_ERR(base))
+		return PTR_ERR(base);
+
+	clk_data = devm_kzalloc(dev, struct_size(clk_data, hws, SL2610_CPU_CLK_MAX), GFP_KERNEL);
+	if (!clk_data)
+		return -ENOMEM;
+	clk_data->num = SL2610_CPU_CLK_MAX;
+	hws = clk_data->hws;
+
+	/* cpupll */
+	ret = sl2610_pll_register(dev, base + CPUPLL_OFFSET,
+				  clk_names[CPUPLL_OUT], clk_names[CPUPLL_OUTF]);
+	if (ret)
+		return ret;
+
+	/* TODO: support cpupll bypass */
+	hws[CLK_CPU0] =
+		devm_clk_hw_register_fixed_factor(dev, "cpu0", clk_names[CPUPLL_OUTF], 0, 1, 1);
+	if (IS_ERR(hws[CLK_CPU0]))
+		return PTR_ERR(hws[CLK_CPU0]);
+	hws[CLK_CPU1] =
+		devm_clk_hw_register_fixed_factor(dev, "cpu1", clk_names[CPUPLL_OUTF], 0, 1, 1);
+	if (IS_ERR(hws[CLK_CPU1]))
+		return PTR_ERR(hws[CLK_CPU1]);
+	hws[CLK_DSU] =
+		devm_clk_hw_register_fixed_factor(dev, "dsu", clk_names[CPUPLL_OUT], 0, 1, 1);
+	if (IS_ERR(hws[CLK_DSU]))
+		return PTR_ERR(hws[CLK_DSU]);
+
+	return devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, clk_data);
+}
+
+static int sl2610_aio_clk_setup(struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+	struct device_node *parent_np = dev->parent->of_node;
+	void __iomem *base;
+	int ret;
+
+	base = devm_of_iomap(dev, parent_np, 0, NULL);
+	if (IS_ERR(base))
+		return PTR_ERR(base);
+
+	/* aplls */
+	ret = sl2610_pll_register(dev, base + APLL0_OFFSET,
+				  clk_names[APLL0_OUT], clk_names[APLL0_OUTF]);
+	if (ret)
+		return ret;
+	ret = sl2610_pll_register(dev, base + APLL1_OFFSET,
+				  clk_names[APLL1_OUT], clk_names[APLL1_OUTF]);
+	if (ret)
+		return ret;
+
+	/* TODO aio clks */
+
+	return 0;
+}
+
+static const struct sl_sysmgr_fixedclk_desc sl2610_sysmgr_fixeds[] = {
+	{ "clk_mcu_ref",	CLK_MCU_REF,	25000000 },
+	{ "clk_mcu_pll",	CLK_MCU_PLL,	400000000 },
+	{ "clk_mcu_io_pll",	CLK_MCU_IO_PLL,	300000000 },
+	{ "clk_mcu_apb",	CLK_MCU_APB,	100000000 },
+	{ "clk_mcu_axi",	CLK_MCU_AXI,	200000000 },
+};
+
+static const struct sl_sysmgr_gateclk_desc sl2610_sysmgr_gates[] = {
+	{ "clk_cfg_uart0",	"clk_mcu_apb",	CLK_CFG_UART0,	0 },
+	{ "clk_ser_uart0",	"clk_mcu_ref",	CLK_SER_UART0,	1 },
+	{ "clk_cfg_uart1",	"clk_mcu_apb",	CLK_CFG_UART1,	2 },
+	{ "clk_cfg_uart2",	"clk_mcu_apb",	CLK_CFG_UART2,	3 },
+	{ "clk_cfg_uart3",	"clk_mcu_apb",	CLK_CFG_UART3,	4 },
+	{ "clk_cfg_gpio",	"clk_mcu_apb",	CLK_CFG_GPIO,	5 },
+	{ "clk_cfg_i2cm0",	"clk_mcu_apb",	CLK_CFG_I2CM0,	6 },
+	{ "clk_cfg_i2cm1",	"clk_mcu_apb",	CLK_CFG_I2CM1,	7 },
+	{ "clk_cfg_spim",	"clk_mcu_apb",	CLK_CFG_SPIM,	8 },
+	{ "clk_cfg_spis",	"clk_mcu_apb",	CLK_CFG_SPIS,	9 },
+	{ "clk_cfg_i3c",	"clk_mcu_apb",	CLK_CFG_I3C,	10 },
+	{ "clk_cfg_xspi",	"clk_mcu_apb",	CLK_CFG_XSPI,	11 },
+	{ "clk_axi_xspi",	"clk_mcu_axi",	CLK_AXI_XSPI,	12 },
+	{ "clk_cfg_pvt",	"clk_mcu_apb",	CLK_CFG_PVT,	13 },
+	{ "clk_cfg_adc",	"clk_mcu_apb",	CLK_CFG_ADC,	14 },
+	{ "clk_cfg_pwm",	"clk_mcu_apb",	CLK_CFG_PWM,	15 },
+	{ "clk_bus_can0",	"clk_mcu_axi",	CLK_BUS_CAN0,	16 },
+	{ "clk_bus_can1",	"clk_mcu_axi",	CLK_BUS_CAN1,	17 },
+	{ "clk_cfg_pdm",	"clk_mcu_apb",	CLK_CFG_PDM,	18 },
+};
+
+static const struct sl_sysmgr_clk_desc sl2610_sysmgr_clks[] = {
+	{ "clk_ser_uart1",	"clk_mcu_pll",	CLK_SER_UART1,	0x604,	4 },
+	{ "clk_ser_uart2",	"clk_mcu_pll",	CLK_SER_UART2,	0x608,	4 },
+	{ "clk_ser_uart3",	"clk_mcu_pll",	CLK_SER_UART3,	0x60c,	4 },
+	{ "clk_deb_gpio",	"clk_mcu_pll",	CLK_DEB_GPIO,	0x610,	4 },
+	{ "clk_ser_i2cm0",	"clk_mcu_pll",	CLK_SER_I2CM0,	0x614,	4 },
+	{ "clk_ser_i2cm1",	"clk_mcu_pll",	CLK_SER_I2CM1,	0x618,	4 },
+	{ "clk_ser_spim",	"clk_mcu_pll",	CLK_SER_SPIM,	0x61c,	4 },
+	{ "clk_ser_spis",	"clk_mcu_pll",	CLK_SER_SPIS,	0x620,	4 },
+	{ "clk_ser_i3c",	"clk_mcu_pll",	CLK_SER_I3C,	0x624,	4 },
+	{ "clk_ser_xspi",	"clk_mcu_io_pll", CLK_SER_XSPI,	0x628,	4 },
+	{ "clk_hs_pvt",		"clk_mcu_pll",	CLK_HS_PVT,	0x62c,	4 },
+	{ "clk_core_adc",	"clk_mcu_pll",	CLK_CORE_ADC,	0x630,	8 },
+	{ "clk_ser_pwm",	"clk_mcu_pll",	CLK_SER_PWM,	0x634,	4 },
+	{ "clk_ser_can0",	"clk_mcu_pll",	CLK_SER_CAN0,	0x638,	4 },
+	{ "clk_ser_can1",	"clk_mcu_pll",	CLK_SER_CAN1,	0x63c,	4 },
+	{ "clk_ser_pdm",	"clk_mcu_pll",	CLK_SER_PDM,	0x640,	8 },
+	{ "clk_ref_calib",	"clk_mcu_pll",	CLK_REF_CALIB,	0x644,	8 },
+};
+
+static int sl2610_sysmgr_clk_setup(struct platform_device *pdev)
+{
+	return sl_sysmgr_clk_setup(pdev, sl2610_sysmgr_fixeds, ARRAY_SIZE(sl2610_sysmgr_fixeds),
+				   sl2610_sysmgr_gates, ARRAY_SIZE(sl2610_sysmgr_gates),
+				   CLK_GATE_CTRL0,
+				   sl2610_sysmgr_clks, ARRAY_SIZE(sl2610_sysmgr_clks));
+}
+
+static const struct platform_device_id sl2610_clks_ids[] = {
+	{ "sl2610-soc-clk", (kernel_ulong_t)sl2610_soc_clk_setup },
+	{ "sl2610-cpu-clk", (kernel_ulong_t)sl2610_cpu_clk_setup },
+	{ "sl2610-avio-clk", (kernel_ulong_t)sl2610_aio_clk_setup },
+	{ "sl2610-mcu-clk", (kernel_ulong_t)sl2610_sysmgr_clk_setup },
+	{ }
+};
+MODULE_DEVICE_TABLE(platform, sl2610_clks_ids);
+
+static int sl2610_clks_probe(struct platform_device *pdev)
+{
+	int (*clk_setup)(struct platform_device *pdev);
+
+	clk_setup = (void *)platform_get_device_id(pdev)->driver_data;
+
+	return clk_setup(pdev);
+}
+
+static struct platform_driver sl2610_clks_driver = {
+	.probe = sl2610_clks_probe,
+	.id_table = sl2610_clks_ids,
+	.driver = {
+		.name = "sl2610-clk",
+	},
+};
+module_platform_driver(sl2610_clks_driver);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Jisheng Zhang <jszhang@kernel.org>");
+MODULE_DESCRIPTION("Synaptics SL2610 clock driver");
diff --git a/drivers/clk/berlin/sl2610-pll.c b/drivers/clk/berlin/sl2610-pll.c
new file mode 100644
index 000000000000..62c5d2d19c36
--- /dev/null
+++ b/drivers/clk/berlin/sl2610-pll.c
@@ -0,0 +1,145 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2019-2021 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <jszhang@kernel.org>
+ */
+
+#include <linux/bitops.h>
+#include <linux/clk-provider.h>
+#include <linux/clk.h>
+#include <linux/container_of.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/math64.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_clk.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+
+#include "sl2610-pll.h"
+
+#define FRAC_BITS		24
+
+#define CTRLC			0x08
+#define DIVR_MASK		GENMASK(8, 0)
+#define CTRLD			0x0c
+#define DIVF_MASK		GENMASK(8, 0)
+#define CTRLE			0x10
+#define DIVFF_MASK		GENMASK(23, 0)
+#define CTRLF			0x14
+#define DIVQ_MASK		GENMASK(4, 0)
+#define CTRLG			0x18
+#define DIVQF_MASK		GENMASK(2, 0)
+
+#define SL2610_APLL
+struct sl2610_pll {
+	void __iomem *ctrl;
+	struct clk_hw pllout;
+	struct clk_hw plloutf;
+};
+
+#define to_pllout(_hw) container_of(_hw, struct sl2610_pll, pllout)
+#define to_plloutf(_hw) container_of(_hw, struct sl2610_pll, plloutf)
+
+static unsigned long sl2610_pll_recalc_rate(struct sl2610_pll *pll,
+					    unsigned long parent_rate, bool fractional_output)
+{
+	u32 dm, dn, frac, dp;
+	u64 rate;
+
+	dm = (readl_relaxed(pll->ctrl + CTRLC) & DIVR_MASK) + 1;
+	dn = (readl_relaxed(pll->ctrl + CTRLD) & DIVF_MASK) + 1;
+	frac = readl_relaxed(pll->ctrl + CTRLE) & DIVFF_MASK;
+
+	if (fractional_output)
+		dp = (readl_relaxed(pll->ctrl + CTRLG) & DIVQF_MASK) + 1;
+	else
+		dp = ((readl_relaxed(pll->ctrl + CTRLF) & DIVQ_MASK) + 1) * 2;
+
+	rate = (u64)parent_rate * dn;
+	rate += ((u64)parent_rate * frac + BIT_ULL(FRAC_BITS - 1)) >> FRAC_BITS;
+	rate = DIV_ROUND_CLOSEST_ULL(rate * 4, dm * dp);
+
+	return rate;
+}
+
+static unsigned long sl2610_pllout_recalc_rate(struct clk_hw *hw,
+					       unsigned long parent_rate)
+{
+	return sl2610_pll_recalc_rate(to_pllout(hw), parent_rate, false);
+}
+
+static unsigned long sl2610_plloutf_recalc_rate(struct clk_hw *hw,
+						unsigned long parent_rate)
+{
+	return sl2610_pll_recalc_rate(to_plloutf(hw), parent_rate, true);
+}
+
+static const struct clk_ops sl2610_pllout_ops = {
+	.recalc_rate = sl2610_pllout_recalc_rate,
+};
+
+static const struct clk_ops sl2610_plloutf_ops = {
+	.recalc_rate = sl2610_plloutf_recalc_rate,
+};
+
+static void sl2610_pll_put_clk(void *data)
+{
+	clk_put(data);
+}
+
+int sl2610_pll_register(struct device *dev, void __iomem *ctrl,
+			const char *out, const char *outf)
+{
+	struct device_node *np = dev->parent->of_node;
+	struct clk_parent_data parent = {};
+	struct clk_init_data init = {};
+	struct sl2610_pll *pll;
+	struct clk *input;
+	int ret;
+
+	if (!dev || !ctrl || !out || !outf)
+		return -EINVAL;
+
+	input = of_clk_get(np, 0);
+	if (IS_ERR(input))
+		return dev_err_probe(dev, PTR_ERR(input),
+				     "failed to get PLL reference clock\n");
+	parent.hw = __clk_get_hw(input);
+	ret = devm_add_action_or_reset(dev, sl2610_pll_put_clk, input);
+	if (ret)
+		return ret;
+
+	pll = devm_kzalloc(dev, sizeof(*pll), GFP_KERNEL);
+	if (!pll)
+		return -ENOMEM;
+	pll->ctrl = ctrl;
+
+	init.name = out;
+	init.ops = &sl2610_pllout_ops;
+	init.parent_data = &parent;
+	init.num_parents = 1;
+	init.flags = CLK_GET_RATE_NOCACHE;
+	pll->pllout.init = &init;
+
+	ret = devm_clk_hw_register(dev, &pll->pllout);
+	if (ret)
+		return dev_err_probe(dev, ret, "failed to register pllout\n");
+
+	init.name = outf;
+	init.ops = &sl2610_plloutf_ops;
+	pll->plloutf.init = &init;
+
+	ret = devm_clk_hw_register(dev, &pll->plloutf);
+	if (ret)
+		return dev_err_probe(dev, ret, "failed to register plloutf\n");
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(sl2610_pll_register);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Synaptics SL2610 PLL clock driver");
diff --git a/drivers/clk/berlin/sl2610-pll.h b/drivers/clk/berlin/sl2610-pll.h
new file mode 100644
index 000000000000..b61a93b28610
--- /dev/null
+++ b/drivers/clk/berlin/sl2610-pll.h
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __SL2610_PLL_H
+#define __SL2610_PLL_H
+
+#include <linux/io.h>
+
+struct clk_hw_onecell_data;
+struct device;
+struct device_node;
+
+int sl2610_pll_register(struct device *dev, void __iomem *ctrl,
+			const char *out, const char *outf);
+
+#endif /* __SL2610_PLL_H */
-- 
2.55.0


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

* [PATCH v4 11/13] dt-bindings: arm: berlin: add Synaptics SL2610 SoCs and RDK boards
  2026-12-04 14:07 [PATCH v4 00/13] arm64: add Synaptics SL2610 SoCs and RDK boards Jisheng Zhang
                   ` (9 preceding siblings ...)
  2026-12-04 14:07 ` [PATCH v4 10/13] clk: berlin: add Synaptics SL2610 clocks and PLLs Jisheng Zhang
@ 2026-12-04 14:07 ` Jisheng Zhang
  2026-12-04 14:07 ` [PATCH v4 12/13] arm64: dts: synaptics: add SL2610 family SoCs Jisheng Zhang
  2026-12-04 14:07 ` [PATCH v4 13/13] arm64: dts: synaptics: add SL2610 family RDK boards Jisheng Zhang
  12 siblings, 0 replies; 24+ messages in thread
From: Jisheng Zhang @ 2026-12-04 14:07 UTC (permalink / raw)
  To: Rob Herring, Conor Dooley, Krzysztof Kozlowski, Catalin Marinas,
	Will Deacon, Mark Rutland, Sebastian Hesselbarth, Stephen Boyd,
	Brian Masney, Jerome Brunet, Linus Walleij, Philipp Zabel,
	Lee Jones
  Cc: devicetree, linux-kernel, linux-arm-kernel, linux-clk, linux-gpio,
	mfd, Richard GENOUD

Add devicetree binding for the Synaptics SL2610 SoCs and corresponding
RDK boards.

The SL2610 family includes five pin-to-pin compatible SoCs: SL2611,
SL2613, SL2615, SL2617, and SL2619.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
---
 .../bindings/arm/marvell,berlin.yaml          | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/marvell,berlin.yaml b/Documentation/devicetree/bindings/arm/marvell,berlin.yaml
index 4e8442980dcb..30d94059e2f2 100644
--- a/Documentation/devicetree/bindings/arm/marvell,berlin.yaml
+++ b/Documentation/devicetree/bindings/arm/marvell,berlin.yaml
@@ -41,5 +41,25 @@ properties:
               - marvell,berlin4ct-stb
           - const: marvell,berlin4ct
           - const: marvell,berlin
+      - items:
+          - enum:
+              - syna,sl2611-rdk
+          - const: syna,sl2611
+      - items:
+          - enum:
+              - syna,sl2613-rdk
+          - const: syna,sl2613
+      - items:
+          - enum:
+              - syna,sl2615-rdk
+          - const: syna,sl2615
+      - items:
+          - enum:
+              - syna,sl2617-rdk
+          - const: syna,sl2617
+      - items:
+          - enum:
+              - syna,sl2619-rdk
+          - const: syna,sl2619
 
 additionalProperties: true
-- 
2.55.0


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

* [PATCH v4 12/13] arm64: dts: synaptics: add SL2610 family SoCs
  2026-12-04 14:07 [PATCH v4 00/13] arm64: add Synaptics SL2610 SoCs and RDK boards Jisheng Zhang
                   ` (10 preceding siblings ...)
  2026-12-04 14:07 ` [PATCH v4 11/13] dt-bindings: arm: berlin: add Synaptics SL2610 SoCs and RDK boards Jisheng Zhang
@ 2026-12-04 14:07 ` Jisheng Zhang
  2026-12-04 18:05   ` sashiko-bot
  2026-12-04 14:07 ` [PATCH v4 13/13] arm64: dts: synaptics: add SL2610 family RDK boards Jisheng Zhang
  12 siblings, 1 reply; 24+ messages in thread
From: Jisheng Zhang @ 2026-12-04 14:07 UTC (permalink / raw)
  To: Rob Herring, Conor Dooley, Krzysztof Kozlowski, Catalin Marinas,
	Will Deacon, Mark Rutland, Sebastian Hesselbarth, Stephen Boyd,
	Brian Masney, Jerome Brunet, Linus Walleij, Philipp Zabel,
	Lee Jones
  Cc: devicetree, linux-kernel, linux-arm-kernel, linux-clk, linux-gpio,
	mfd, Richard GENOUD

Describe the CPUs, interrupt controller, system controllers and supported
serial, I2C, I3C, SPI and GPIO peripherals for the SL2610 family.

Use the SL2610 peripheral compatibles already documented in the upstream
bindings and share clock, reset and pin configuration providers through
the system controller nodes.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 arch/arm64/boot/dts/synaptics/sl2611.dtsi | 466 ++++++++++++++++++++++
 arch/arm64/boot/dts/synaptics/sl2613.dtsi |  12 +
 arch/arm64/boot/dts/synaptics/sl2615.dtsi |  46 +++
 arch/arm64/boot/dts/synaptics/sl2617.dtsi |  46 +++
 arch/arm64/boot/dts/synaptics/sl2619.dtsi |  44 ++
 5 files changed, 614 insertions(+)
 create mode 100644 arch/arm64/boot/dts/synaptics/sl2611.dtsi
 create mode 100644 arch/arm64/boot/dts/synaptics/sl2613.dtsi
 create mode 100644 arch/arm64/boot/dts/synaptics/sl2615.dtsi
 create mode 100644 arch/arm64/boot/dts/synaptics/sl2617.dtsi
 create mode 100644 arch/arm64/boot/dts/synaptics/sl2619.dtsi

diff --git a/arch/arm64/boot/dts/synaptics/sl2611.dtsi b/arch/arm64/boot/dts/synaptics/sl2611.dtsi
new file mode 100644
index 000000000000..03859bae07bd
--- /dev/null
+++ b/arch/arm64/boot/dts/synaptics/sl2611.dtsi
@@ -0,0 +1,466 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2024 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <jszhang@kernel.org>
+ */
+
+#include <dt-bindings/clock/syna,sl2610.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/reset/syna,sl2610-reset.h>
+
+/ {
+	compatible = "syna,sl2611";
+	#address-cells = <2>;
+	#size-cells = <2>;
+	interrupt-parent = <&gic>;
+
+	osc: clock-osc {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+	};
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu0: cpu@0 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a55";
+			reg = <0x0>;
+			cpu-idle-states = <&cpu_sleep_0>;
+			d-cache-line-size = <64>;
+			d-cache-sets = <128>;
+			d-cache-size = <32768>;
+			enable-method = "psci";
+			i-cache-line-size = <64>;
+			i-cache-sets = <128>;
+			i-cache-size = <32768>;
+			next-level-cache = <&l2_0>;
+
+			l2_0: l2-cache {
+				compatible = "cache";
+				cache-level = <2>;
+				cache-line-size = <64>;
+				cache-sets = <256>;
+				cache-size = <65536>;
+				cache-unified;
+				next-level-cache = <&l3>;
+			};
+		};
+
+		idle-states {
+			entry-method = "psci";
+
+			cpu_sleep_0: cpu-sleep-0 {
+				compatible = "arm,idle-state";
+				entry-latency-us = <75>;
+				exit-latency-us = <155>;
+				local-timer-stop;
+				min-residency-us = <50000>;
+				arm,psci-suspend-param = <0x0010000>;
+			};
+		};
+
+		l3: l3-cache0 {
+			compatible = "cache";
+			cache-level = <3>;
+			cache-line-size = <64>;
+			cache-sets = <256>;
+			cache-size = <262144>;
+			cache-unified;
+		};
+	};
+
+	optee {
+		compatible = "linaro,optee-tz";
+		method = "smc";
+	};
+
+	pmu {
+		compatible = "arm,cortex-a55-pmu";
+		interrupt-affinity = <&cpu0>;
+		interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
+	};
+
+	psci {
+		compatible = "arm,psci-1.0";
+		method = "smc";
+	};
+
+	soc {
+		compatible = "simple-bus";
+		ranges = <0 0 0 0xffffffff>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		sm-bus {
+			compatible = "simple-bus";
+			ranges;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			dma-ranges = <0xa0000000 0x00000000 0x10000000>;
+
+			sm_clk: sm_pinctrl: sm_rst: sm_chip: syscon@e5025000 {
+				compatible = "syna,sl2610-mcu-syscon", "syscon";
+				reg = <0xe5025000 0x1000>;
+				#clock-cells = <1>;
+				#reset-cells = <1>;
+				clocks = <&osc>;
+			};
+
+			sm_uart0: serial@e5030000 {
+				compatible = "syna,sl2610-uart", "snps,dw-apb-uart";
+				reg = <0xe5030000 0x100>;
+				clocks = <&sm_clk CLK_SER_UART0>, <&sm_clk CLK_CFG_UART0>;
+				clock-names = "baudclk", "apb_pclk";
+				interrupts = <GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>;
+				reg-shift = <2>;
+
+				status = "disabled";
+			};
+
+			sm_uart1: serial@e5031000 {
+				compatible = "syna,sl2610-uart", "snps,dw-apb-uart";
+				reg = <0xe5031000 0x100>;
+				clocks = <&sm_clk CLK_SER_UART1>, <&sm_clk CLK_CFG_UART1>;
+				clock-names = "baudclk", "apb_pclk";
+				interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>;
+				reg-shift = <2>;
+
+				status = "disabled";
+			};
+
+			sm_uart2: serial@e5032000 {
+				compatible = "syna,sl2610-uart", "snps,dw-apb-uart";
+				reg = <0xe5032000 0x100>;
+				clocks = <&sm_clk CLK_SER_UART2>, <&sm_clk CLK_CFG_UART2>;
+				clock-names = "baudclk", "apb_pclk";
+				interrupts = <GIC_SPI 132 IRQ_TYPE_LEVEL_HIGH>;
+				reg-shift = <2>;
+
+				status = "disabled";
+			};
+
+			sm_uart3: serial@e5033000 {
+				compatible = "syna,sl2610-uart", "snps,dw-apb-uart";
+				reg = <0xe5033000 0x100>;
+				clocks = <&sm_clk CLK_SER_UART3>, <&sm_clk CLK_CFG_UART3>;
+				clock-names = "baudclk", "apb_pclk";
+				interrupts = <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>;
+				reg-shift = <2>;
+
+				status = "disabled";
+			};
+
+			sm_spi1: spi@e5034000 {
+				compatible = "syna,sl2610-spi", "snps,dw-apb-ssi";
+				reg = <0xe5034000 0x100>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+				clocks = <&sm_clk CLK_SER_SPIM>, <&sm_clk CLK_CFG_SPIM>;
+				clock-names = "ssi_clk", "pclk";
+				interrupts = <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>;
+				num-cs = <4>;
+
+				status = "disabled";
+			};
+
+			sm_i2c0: i2c@e5035000 {
+				compatible = "syna,sl2610-i2c", "snps,designware-i2c";
+				reg = <0xe5035000 0x100>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+				clocks = <&sm_clk CLK_SER_I2CM0>, <&sm_clk CLK_CFG_I2CM0>;
+				clock-names = "ref", "pclk";
+				interrupts = <GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>;
+
+				status = "disabled";
+			};
+
+			sm_i2c1: i2c@e5036000 {
+				compatible = "syna,sl2610-i2c", "snps,designware-i2c";
+				reg = <0xe5036000 0x100>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+				clocks = <&sm_clk CLK_SER_I2CM1>, <&sm_clk CLK_CFG_I2CM1>;
+				clock-names = "ref", "pclk";
+				interrupts = <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>;
+
+				status = "disabled";
+			};
+
+			sm_i3c0: i3c@e5037000 {
+				compatible = "syna,sl2610-i3c", "snps,dw-i3c-master-1.00a";
+				reg = <0xe5037000 0x1000>;
+				#address-cells = <3>;
+				#size-cells = <0>;
+				clocks = <&sm_clk CLK_SER_I3C>, <&sm_clk CLK_CFG_I3C>;
+				clock-names = "core", "apb";
+				interrupts = <GIC_SPI 129 IRQ_TYPE_LEVEL_HIGH>;
+				resets = <&sm_rst RST_SM_I3CSRST>, <&sm_rst RST_SM_I3CPRST>;
+
+				status = "disabled";
+			};
+
+			sm_gpio0: gpio@e5038000 {
+				compatible = "snps,dw-apb-gpio";
+				reg = <0xe5038000 0x400>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+				clocks = <&sm_clk CLK_CFG_GPIO>, <&sm_clk CLK_DEB_GPIO>;
+				clock-names = "bus", "db";
+
+				portc: gpio-port@0 {
+					compatible = "snps,dw-apb-gpio-port";
+					reg = <0>;
+					#gpio-cells = <2>;
+					gpio-controller;
+					ngpios = <16>;
+				};
+			};
+
+			sm_gpio1: gpio@e5039000 {
+				compatible = "snps,dw-apb-gpio";
+				reg = <0xe5039000 0x400>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+				clocks = <&sm_clk CLK_CFG_GPIO>, <&sm_clk CLK_DEB_GPIO>;
+				clock-names = "bus", "db";
+
+				portd: gpio-port@0 {
+					compatible = "snps,dw-apb-gpio-port";
+					reg = <0>;
+					#gpio-cells = <2>;
+					gpio-controller;
+					ngpios = <8>;
+				};
+			};
+
+			sm_gpio2: gpio@e503a000 {
+				compatible = "snps,dw-apb-gpio";
+				reg = <0xe503a000 0x400>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+				clocks = <&sm_clk CLK_CFG_GPIO>, <&sm_clk CLK_DEB_GPIO>;
+				clock-names = "bus", "db";
+
+				porte: gpio-port@0 {
+					compatible = "snps,dw-apb-gpio-port";
+					reg = <0>;
+					#gpio-cells = <2>;
+					gpio-controller;
+					ngpios = <8>;
+				};
+			};
+
+			sm_gpio3: gpio@e503b000 {
+				compatible = "snps,dw-apb-gpio";
+				reg = <0xe503b000 0x400>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+				clocks = <&sm_clk CLK_CFG_GPIO>, <&sm_clk CLK_DEB_GPIO>;
+				clock-names = "bus", "db";
+
+				portf: gpio-port@0 {
+					compatible = "snps,dw-apb-gpio-port";
+					reg = <0>;
+					#gpio-cells = <2>;
+					gpio-controller;
+					ngpios = <8>;
+				};
+			};
+		};
+
+		aioclk: aviogbl: syscon@f7490000 {
+			compatible = "syna,sl2610-avio-syscon", "syscon";
+			reg = <0xf7490000 0x4000>;
+			clocks = <&osc>;
+		};
+
+		clk: pinctrl: rst: chip: syscon@f7e10000 {
+			compatible = "syna,sl2610-soc-syscon", "syscon";
+			reg = <0xf7e10000 0x10000>;
+			#clock-cells = <1>;
+			#reset-cells = <1>;
+			clocks = <&osc>;
+		};
+
+		cpuclk: cpu_wrap: syscon@f7e30000 {
+			compatible = "syna,sl2610-cpu-syscon", "syscon";
+			reg = <0xf7e30000 0x4000>;
+			#clock-cells = <1>;
+			clocks = <&osc>;
+			syna,gbl-syscon = <&chip>;
+		};
+
+		gic: interrupt-controller@f7e59000 {
+			compatible = "arm,gic-400";
+			reg = <0xf7e59000 0x1000>,
+			      <0xf7e5a000 0x2000>,
+			      <0xf7e5c000 0x2000>,
+			      <0xf7e5e000 0x2000>;
+			#interrupt-cells = <3>;
+			interrupt-controller;
+			interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
+		};
+
+		soc_uart0: serial@f7f00000 {
+			compatible = "syna,sl2610-uart", "snps,dw-apb-uart";
+			reg = <0xf7f00000 0x100>;
+			clocks = <&clk CLK_APBUART0>;
+			interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
+			reg-shift = <2>;
+
+			status = "disabled";
+		};
+
+		soc_uart1: serial@f7f01000 {
+			compatible = "syna,sl2610-uart", "snps,dw-apb-uart";
+			reg = <0xf7f01000 0x100>;
+			clocks = <&clk CLK_APBUART1>;
+			interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
+			reg-shift = <2>;
+
+			status = "disabled";
+		};
+
+		soc_uart2: serial@f7f02000 {
+			compatible = "syna,sl2610-uart", "snps,dw-apb-uart";
+			reg = <0xf7f02000 0x100>;
+			clocks = <&clk CLK_APBUART2>;
+			interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
+			reg-shift = <2>;
+
+			status = "disabled";
+		};
+
+		soc_uart3: serial@f7f03000 {
+			compatible = "syna,sl2610-uart", "snps,dw-apb-uart";
+			reg = <0xf7f03000 0x100>;
+			clocks = <&clk CLK_APBUART3>;
+			interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
+			reg-shift = <2>;
+
+			status = "disabled";
+		};
+
+		soc_spi0: spi@f7f04000 {
+			compatible = "syna,sl2610-spi", "snps,dw-apb-ssi";
+			reg = <0xf7f04000 0x100>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			clocks = <&clk CLK_APBSPI0>;
+			interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
+			num-cs = <4>;
+
+			status = "disabled";
+		};
+
+		soc_i2c0: i2c@f7f05000 {
+			compatible = "syna,sl2610-i2c", "snps,designware-i2c";
+			reg = <0xf7f05000 0x100>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			clocks = <&clk CLK_APBI2C0>;
+			interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>;
+
+			status = "disabled";
+		};
+
+		soc_i2c1: i2c@f7f06000 {
+			compatible = "syna,sl2610-i2c", "snps,designware-i2c";
+			reg = <0xf7f06000 0x100>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			clocks = <&clk CLK_APBI2C1>;
+			interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
+
+			status = "disabled";
+		};
+
+		soc_gpio0: gpio@f7f07000 {
+			compatible = "snps,dw-apb-gpio";
+			reg = <0xf7f07000 0x400>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			clocks = <&clk CLK_APBGPIO>;
+			clock-names = "bus";
+
+			porta: gpio-port@0 {
+				compatible = "snps,dw-apb-gpio-port";
+				reg = <0>;
+				#gpio-cells = <2>;
+				#interrupt-cells = <2>;
+				gpio-controller;
+				interrupt-controller;
+				interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
+				ngpios = <32>;
+			};
+		};
+
+		soc_spi1: spi@f7f0b000 {
+			compatible = "syna,sl2610-spi", "snps,dw-apb-ssi";
+			reg = <0xf7f0b000 0x100>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			clocks = <&clk CLK_APBSPI1>;
+			interrupts = <GIC_SPI 199 IRQ_TYPE_LEVEL_HIGH>;
+			num-cs = <4>;
+
+			status = "disabled";
+		};
+
+		soc_spi2: spi@f7f0c000 {
+			compatible = "syna,sl2610-spi", "snps,dw-apb-ssi";
+			reg = <0xf7f0c000 0x100>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			clocks = <&clk CLK_APBSPI2>;
+			interrupts = <GIC_SPI 200 IRQ_TYPE_LEVEL_HIGH>;
+			num-cs = <4>;
+
+			status = "disabled";
+		};
+
+		soc_spi3: spi@f7f0d000 {
+			compatible = "syna,sl2610-spi", "snps,dw-apb-ssi";
+			reg = <0xf7f0d000 0x100>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			clocks = <&clk CLK_APBSPI3>;
+			interrupts = <GIC_SPI 201 IRQ_TYPE_LEVEL_HIGH>;
+			num-cs = <4>;
+
+			status = "disabled";
+		};
+
+		soc_gpio1: gpio@f7f0e000 {
+			compatible = "snps,dw-apb-gpio";
+			reg = <0xf7f0e000 0x400>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			clocks = <&clk CLK_APBGPIO>;
+			clock-names = "bus";
+
+			portb: gpio-port@0 {
+				compatible = "snps,dw-apb-gpio-port";
+				reg = <0>;
+				#gpio-cells = <2>;
+				#interrupt-cells = <2>;
+				gpio-controller;
+				interrupt-controller;
+				interrupts = <GIC_SPI 206 IRQ_TYPE_LEVEL_HIGH>;
+				ngpios = <32>;
+			};
+		};
+	};
+
+	timer {
+		compatible = "arm,armv8-timer";
+		interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
+	};
+};
diff --git a/arch/arm64/boot/dts/synaptics/sl2613.dtsi b/arch/arm64/boot/dts/synaptics/sl2613.dtsi
new file mode 100644
index 000000000000..379809901677
--- /dev/null
+++ b/arch/arm64/boot/dts/synaptics/sl2613.dtsi
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2025 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <jszhang@kernel.org>
+ */
+
+#include "sl2611.dtsi"
+
+/ {
+	compatible = "syna,sl2613";
+};
diff --git a/arch/arm64/boot/dts/synaptics/sl2615.dtsi b/arch/arm64/boot/dts/synaptics/sl2615.dtsi
new file mode 100644
index 000000000000..ee34bacfdeb1
--- /dev/null
+++ b/arch/arm64/boot/dts/synaptics/sl2615.dtsi
@@ -0,0 +1,46 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2025 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <jszhang@kernel.org>
+ */
+
+#include "sl2613.dtsi"
+
+/ {
+	compatible = "syna,sl2615";
+
+	cpus {
+		cpu1: cpu@100 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a55";
+			reg = <0x100>;
+			cpu-idle-states = <&cpu_sleep_0>;
+			d-cache-line-size = <64>;
+			d-cache-sets = <128>;
+			d-cache-size = <32768>;
+			enable-method = "psci";
+			i-cache-line-size = <64>;
+			i-cache-sets = <128>;
+			i-cache-size = <32768>;
+			next-level-cache = <&l2_1>;
+
+			l2_1: l2-cache {
+				compatible = "cache";
+				cache-level = <2>;
+				cache-line-size = <64>;
+				cache-sets = <256>;
+				cache-size = <65536>;
+				cache-unified;
+				next-level-cache = <&l3>;
+			};
+		};
+	};
+
+	pmu {
+		interrupt-affinity = <&cpu0>,
+				     <&cpu1>;
+		interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>;
+	};
+};
diff --git a/arch/arm64/boot/dts/synaptics/sl2617.dtsi b/arch/arm64/boot/dts/synaptics/sl2617.dtsi
new file mode 100644
index 000000000000..17f8ea9f2a44
--- /dev/null
+++ b/arch/arm64/boot/dts/synaptics/sl2617.dtsi
@@ -0,0 +1,46 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2025 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <jszhang@kernel.org>
+ */
+
+#include "sl2613.dtsi"
+
+/ {
+	compatible = "syna,sl2617";
+
+	cpus {
+		cpu1: cpu@100 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a55";
+			reg = <0x100>;
+			cpu-idle-states = <&cpu_sleep_0>;
+			d-cache-line-size = <64>;
+			d-cache-sets = <128>;
+			d-cache-size = <32768>;
+			enable-method = "psci";
+			i-cache-line-size = <64>;
+			i-cache-sets = <128>;
+			i-cache-size = <32768>;
+			next-level-cache = <&l2_1>;
+
+			l2_1: l2-cache {
+				compatible = "cache";
+				cache-level = <2>;
+				cache-line-size = <64>;
+				cache-sets = <256>;
+				cache-size = <65536>;
+				cache-unified;
+				next-level-cache = <&l3>;
+			};
+		};
+	};
+
+	pmu {
+		interrupt-affinity = <&cpu0>,
+				     <&cpu1>;
+		interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>;
+	};
+};
diff --git a/arch/arm64/boot/dts/synaptics/sl2619.dtsi b/arch/arm64/boot/dts/synaptics/sl2619.dtsi
new file mode 100644
index 000000000000..6539c5a3dce0
--- /dev/null
+++ b/arch/arm64/boot/dts/synaptics/sl2619.dtsi
@@ -0,0 +1,44 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2025 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <jszhang@kernel.org>
+ */
+
+#include "sl2613.dtsi"
+
+/ {
+	cpus {
+		cpu1: cpu@100 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a55";
+			reg = <0x100>;
+			cpu-idle-states = <&cpu_sleep_0>;
+			d-cache-line-size = <64>;
+			d-cache-sets = <128>;
+			d-cache-size = <32768>;
+			enable-method = "psci";
+			i-cache-line-size = <64>;
+			i-cache-sets = <128>;
+			i-cache-size = <32768>;
+			next-level-cache = <&l2_1>;
+
+			l2_1: l2-cache {
+				compatible = "cache";
+				cache-level = <2>;
+				cache-line-size = <64>;
+				cache-sets = <256>;
+				cache-size = <65536>;
+				cache-unified;
+				next-level-cache = <&l3>;
+			};
+		};
+	};
+
+	pmu {
+		interrupt-affinity = <&cpu0>,
+				     <&cpu1>;
+		interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>;
+	};
+};
-- 
2.55.0


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

* [PATCH v4 13/13] arm64: dts: synaptics: add SL2610 family RDK boards
  2026-12-04 14:07 [PATCH v4 00/13] arm64: add Synaptics SL2610 SoCs and RDK boards Jisheng Zhang
                   ` (11 preceding siblings ...)
  2026-12-04 14:07 ` [PATCH v4 12/13] arm64: dts: synaptics: add SL2610 family SoCs Jisheng Zhang
@ 2026-12-04 14:07 ` Jisheng Zhang
  2026-12-04 18:19   ` sashiko-bot
  12 siblings, 1 reply; 24+ messages in thread
From: Jisheng Zhang @ 2026-12-04 14:07 UTC (permalink / raw)
  To: Rob Herring, Conor Dooley, Krzysztof Kozlowski, Catalin Marinas,
	Will Deacon, Mark Rutland, Sebastian Hesselbarth, Stephen Boyd,
	Brian Masney, Jerome Brunet, Linus Walleij, Philipp Zabel,
	Lee Jones
  Cc: devicetree, linux-kernel, linux-arm-kernel, linux-clk, linux-gpio,
	mfd, Richard GENOUD

Add device trees for the SL2611, SL2613, SL2615, SL2617 and SL2619
reference development kits. Share their common console, memory, pin
configuration and regulator descriptions and enable the populated
peripherals.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 arch/arm64/boot/dts/synaptics/Makefile        |   5 +
 arch/arm64/boot/dts/synaptics/sl2611-rdk.dts  |  16 ++
 arch/arm64/boot/dts/synaptics/sl2613-rdk.dts  |  16 ++
 arch/arm64/boot/dts/synaptics/sl2615-rdk.dts  |  16 ++
 arch/arm64/boot/dts/synaptics/sl2617-rdk.dts  |  16 ++
 arch/arm64/boot/dts/synaptics/sl2619-rdk.dts  |  16 ++
 .../boot/dts/synaptics/sl261x-rdk-common.dtsi | 150 ++++++++++++++++++
 7 files changed, 235 insertions(+)
 create mode 100644 arch/arm64/boot/dts/synaptics/sl2611-rdk.dts
 create mode 100644 arch/arm64/boot/dts/synaptics/sl2613-rdk.dts
 create mode 100644 arch/arm64/boot/dts/synaptics/sl2615-rdk.dts
 create mode 100644 arch/arm64/boot/dts/synaptics/sl2617-rdk.dts
 create mode 100644 arch/arm64/boot/dts/synaptics/sl2619-rdk.dts
 create mode 100644 arch/arm64/boot/dts/synaptics/sl261x-rdk-common.dtsi

diff --git a/arch/arm64/boot/dts/synaptics/Makefile b/arch/arm64/boot/dts/synaptics/Makefile
index de71ddda6835..810d0d08c2de 100644
--- a/arch/arm64/boot/dts/synaptics/Makefile
+++ b/arch/arm64/boot/dts/synaptics/Makefile
@@ -2,3 +2,8 @@
 # Berlin SoC Family
 dtb-$(CONFIG_ARCH_BERLIN) += berlin4ct-dmp.dtb
 dtb-$(CONFIG_ARCH_BERLIN) += berlin4ct-stb.dtb
+dtb-$(CONFIG_ARCH_BERLIN) += sl2611-rdk.dtb
+dtb-$(CONFIG_ARCH_BERLIN) += sl2613-rdk.dtb
+dtb-$(CONFIG_ARCH_BERLIN) += sl2615-rdk.dtb
+dtb-$(CONFIG_ARCH_BERLIN) += sl2617-rdk.dtb
+dtb-$(CONFIG_ARCH_BERLIN) += sl2619-rdk.dtb
diff --git a/arch/arm64/boot/dts/synaptics/sl2611-rdk.dts b/arch/arm64/boot/dts/synaptics/sl2611-rdk.dts
new file mode 100644
index 000000000000..585872307834
--- /dev/null
+++ b/arch/arm64/boot/dts/synaptics/sl2611-rdk.dts
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2025 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <jszhang@kernel.org>
+ */
+
+/dts-v1/;
+
+#include "sl2611.dtsi"
+#include "sl261x-rdk-common.dtsi"
+
+/ {
+	model = "Synaptics SL2611 RDK";
+	compatible = "syna,sl2611-rdk", "syna,sl2611";
+};
diff --git a/arch/arm64/boot/dts/synaptics/sl2613-rdk.dts b/arch/arm64/boot/dts/synaptics/sl2613-rdk.dts
new file mode 100644
index 000000000000..de75c9fab6a2
--- /dev/null
+++ b/arch/arm64/boot/dts/synaptics/sl2613-rdk.dts
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2025 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <jszhang@kernel.org>
+ */
+
+/dts-v1/;
+
+#include "sl2613.dtsi"
+#include "sl261x-rdk-common.dtsi"
+
+/ {
+	model = "Synaptics SL2613 RDK";
+	compatible = "syna,sl2613-rdk", "syna,sl2613";
+};
diff --git a/arch/arm64/boot/dts/synaptics/sl2615-rdk.dts b/arch/arm64/boot/dts/synaptics/sl2615-rdk.dts
new file mode 100644
index 000000000000..ae03638a3a53
--- /dev/null
+++ b/arch/arm64/boot/dts/synaptics/sl2615-rdk.dts
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2025 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <jszhang@kernel.org>
+ */
+
+/dts-v1/;
+
+#include "sl2615.dtsi"
+#include "sl261x-rdk-common.dtsi"
+
+/ {
+	model = "Synaptics SL2615 RDK";
+	compatible = "syna,sl2615-rdk", "syna,sl2615";
+};
diff --git a/arch/arm64/boot/dts/synaptics/sl2617-rdk.dts b/arch/arm64/boot/dts/synaptics/sl2617-rdk.dts
new file mode 100644
index 000000000000..ba4ea21ac505
--- /dev/null
+++ b/arch/arm64/boot/dts/synaptics/sl2617-rdk.dts
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2025 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <jszhang@kernel.org>
+ */
+
+/dts-v1/;
+
+#include "sl2617.dtsi"
+#include "sl261x-rdk-common.dtsi"
+
+/ {
+	model = "Synaptics SL2617 RDK";
+	compatible = "syna,sl2617-rdk", "syna,sl2617";
+};
diff --git a/arch/arm64/boot/dts/synaptics/sl2619-rdk.dts b/arch/arm64/boot/dts/synaptics/sl2619-rdk.dts
new file mode 100644
index 000000000000..58901ac2a050
--- /dev/null
+++ b/arch/arm64/boot/dts/synaptics/sl2619-rdk.dts
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2025 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <jszhang@kernel.org>
+ */
+
+/dts-v1/;
+
+#include "sl2619.dtsi"
+#include "sl261x-rdk-common.dtsi"
+
+/ {
+	model = "Synaptics SL2619 RDK";
+	compatible = "syna,sl2619-rdk", "syna,sl2619";
+};
diff --git a/arch/arm64/boot/dts/synaptics/sl261x-rdk-common.dtsi b/arch/arm64/boot/dts/synaptics/sl261x-rdk-common.dtsi
new file mode 100644
index 000000000000..bad11a9066cc
--- /dev/null
+++ b/arch/arm64/boot/dts/synaptics/sl261x-rdk-common.dtsi
@@ -0,0 +1,150 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2025 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <jszhang@kernel.org>
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/linux-event-codes.h>
+
+/ {
+	aliases {
+		i2c0 = &sm_i2c0;
+		i2c1 = &sm_i2c1;
+		i2c2 = &soc_i2c0;
+		i2c3 = &soc_i2c1;
+		serial0 = &sm_uart0;
+		serial1 = &sm_uart1;
+		serial2 = &sm_uart2;
+		serial3 = &sm_uart3;
+		serial4 = &soc_uart0;
+		serial5 = &soc_uart1;
+		serial6 = &soc_uart2;
+		serial7 = &soc_uart3;
+		spi1 = &sm_spi1;
+		spi2 = &soc_spi0;
+		spi3 = &soc_spi1;
+		spi4 = &soc_spi2;
+		spi5 = &soc_spi3;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	cpus {
+		cpu@0 {
+			cpu0-supply = <&vcore>;
+		};
+	};
+
+	memory@0 {
+		device_type = "memory";
+		reg = <0x0 0x00000000 0x0 0x80000000>;
+	};
+};
+
+&osc {
+	clock-frequency = <25000000>;
+};
+
+&pinctrl {
+	soc_i2c0_pmux: soc-i2c0-pmux {
+		drive-strength = <7>;
+		function = "tw2";
+		groups = "GPIO23", "GPIO24";
+	};
+};
+
+&sm_i2c0 {
+	clock-frequency = <100000>;
+	i2c-scl-falling-time-ns = <510>;
+	i2c-sda-falling-time-ns = <510>;
+	pinctrl-0 = <&sm_i2c0_pmux>;
+	pinctrl-names = "default";
+
+	status = "okay";
+
+	expander0: gpio@43 {
+		compatible = "fcs,fxl6408";
+		reg = <0x43>;
+		#gpio-cells = <2>;
+		gpio-controller;
+	};
+
+	expander1: gpio@44 {
+		compatible = "fcs,fxl6408";
+		reg = <0x44>;
+		#gpio-cells = <2>;
+		gpio-controller;
+	};
+};
+
+&sm_i2c1 {
+	clock-frequency = <100000>;
+	i2c-scl-falling-time-ns = <510>;
+	i2c-sda-falling-time-ns = <510>;
+	pinctrl-0 = <&sm_i2c1_pmux>;
+	pinctrl-names = "default";
+
+	status = "okay";
+
+	vcore: regulator@60 {
+		compatible = "silergy,sy8827n";
+		reg = <0x60>;
+		enable-gpios = <&portc 5 GPIO_ACTIVE_LOW>;
+		pinctrl-0 = <&vcore_gpio_pmux>;
+		pinctrl-names = "default";
+		regulator-active-discharge = <0>;
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-max-microvolt = <987500>;
+		regulator-min-microvolt = <700000>;
+		regulator-name = "vcore";
+	};
+};
+
+&sm_pinctrl {
+	sm_i2c0_pmux: i2c0-pmux {
+		drive-strength = <7>;
+		function = "tw0";
+		groups = "SM_GPIO12", "SM_GPIO13";
+	};
+
+	sm_i2c1_pmux: i2c1-pmux {
+		drive-strength = <7>;
+		function = "tw1";
+		groups = "SM_GPIO3", "SM_GPIO4";
+	};
+
+	vcore_gpio_pmux: vcore-gpio-pmux {
+		function = "gpio";
+		groups = "SM_GPIO5";
+	};
+};
+
+&sm_uart0 {
+	status = "okay";
+};
+
+&sm_uart1 {
+	status = "okay";
+};
+
+&soc_i2c0 {
+	clock-frequency = <100000>;
+	i2c-scl-falling-time-ns = <205>;
+	i2c-sda-falling-time-ns = <425>;
+	i2c-sda-hold-time-ns = <449>;
+	pinctrl-0 = <&soc_i2c0_pmux>;
+	pinctrl-names = "default";
+
+	status = "okay";
+};
+
+&soc_i2c1 {
+	i2c-scl-falling-time-ns = <205>;
+	i2c-sda-falling-time-ns = <425>;
+	i2c-sda-hold-time-ns = <449>;
+};
-- 
2.55.0


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

* Re: [PATCH v4 03/13] pinctrl: berlin: enable module build support
  2026-12-04 14:07 ` [PATCH v4 03/13] pinctrl: berlin: enable module build support Jisheng Zhang
@ 2026-12-04 15:03   ` sashiko-bot
  0 siblings, 0 replies; 24+ messages in thread
From: sashiko-bot @ 2026-12-04 15:03 UTC (permalink / raw)
  To: Jisheng Zhang; +Cc: devicetree, linux-clk, linux-gpio, mfd, robh, conor+dt, lee

Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [Medium] pinctrl: berlin: PINCTRL_BERLIN remains bool and built via
  obj-y
- [Low] pinctrl: berlin: unrelated pinconf changes mixed into module
  build commit
- [Low] pinctrl: berlin: pinctrl patches not split out as requested by
  maintainer
--

commit 3e5d5d3d1e00faf42d4508d236eb2eb377780414
Author: Jisheng Zhang <jszhang@kernel.org>

pinctrl: berlin: enable module build support

This commit converts berlin_pinctrl_build_state() allocations to devm_*
helpers, exports berlin_pinctrl_probe() and berlin_pinctrl_probe_regmap(),
and adds module metadata to drivers/pinctrl/berlin/berlin.c.

> diff --git a/drivers/pinctrl/berlin/berlin.c b/drivers/pinctrl/berlin/berlin.c
> index 8a612ce2d1d36..9337de1973af9 100644
> --- a/drivers/pinctrl/berlin/berlin.c
> +++ b/drivers/pinctrl/berlin/berlin.c

[ ... ]

> @@ -326,6 +322,7 @@ int berlin_pinctrl_probe_regmap(struct platform_device *pdev,
>  
>  	return 0;
>  }
> +EXPORT_SYMBOL_GPL(berlin_pinctrl_probe_regmap);

[Severity: Low]
As reported by Linus Walleij on v2 [1], should the pinctrl patches be split
out and sent separately for the pinctrl tree?

The core Berlin pinctrl patches have no build-time dependencies on the rest
of the series, and commit "pinctrl: berlin: add Synaptics SL2610 pin
controller support" only references MFD_SL2610_SYSCON in Kconfig.

>  int berlin_pinctrl_probe(struct platform_device *pdev,
>  			 const struct berlin_pinctrl_desc *desc)
> @@ -340,3 +337,7 @@ int berlin_pinctrl_probe(struct platform_device *pdev,
>  
>  	return berlin_pinctrl_probe_regmap(pdev, desc, regmap);
>  }
> +EXPORT_SYMBOL_GPL(berlin_pinctrl_probe);
> +
> +MODULE_LICENSE("GPL");
> +MODULE_DESCRIPTION("pinctrl library for Synaptics SoCs");

[Severity: Medium]
Can berlin.c actually be built as a loadable module with these changes?

PINCTRL_BERLIN in drivers/pinctrl/berlin/Kconfig is still bool, so selecting
it from a modular SoC driver such as PINCTRL_SL2610 forces berlin.o into
vmlinux instead of building berlin.ko.

In addition, drivers/pinctrl/berlin/Makefile still uses obj-y += berlin.o
instead of obj-$(CONFIG_PINCTRL_BERLIN) += berlin.o.  When PINCTRL_BERLIN is
tristate, drivers/pinctrl/Makefile descends via obj-m and drops obj-y, so
berlin.ko is never built and modular SoC drivers fail to link.

> diff --git a/drivers/pinctrl/berlin/berlin.h b/drivers/pinctrl/berlin/berlin.h
> index 7e7096842eda0..8ff70d682593a 100644
> --- a/drivers/pinctrl/berlin/berlin.h
> +++ b/drivers/pinctrl/berlin/berlin.h
> @@ -20,6 +20,8 @@ struct berlin_desc_group {
>  	u16				offset;
>  	u8				bit_width;
>  	u8				lsb;
> +	u16				conf_offset;
> +	u8				conf_bits;
>  	struct berlin_desc_function	*functions;
>  };
>  
> @@ -28,6 +30,19 @@ struct berlin_pinctrl_desc {
>  	unsigned			ngroups;
>  };
>  
> +#define BERLIN_PINCTRLCONF_GROUP(_name, _offset, _width, _lsb,		\
> +		_conf_offset, _conf_bits, ...)				\
> +	{								\
> +		.name = _name,						\
> +		.offset = _offset,					\
> +		.bit_width = _width,					\
> +		.lsb = _lsb,						\
> +		.conf_offset = _conf_offset,				\
> +		.conf_bits = _conf_bits,				\
> +		.functions = (struct berlin_desc_function[]){		\
> +			__VA_ARGS__, { } },				\
> +	}
> +
>  #define BERLIN_PINCTRL_GROUP(_name, _offset, _width, _lsb, ...)		\
>  	{								\
>  		.name = _name,						\

[Severity: Low]
Do these pinconf additions belong in commit "pinctrl: berlin: add optional
pinconf support" instead?  conf_offset, conf_bits, and
BERLIN_PINCTRLCONF_GROUP are unrelated to module build support and are not
mentioned in the commit message.

[1] https://lore.kernel.org/r/CAD++jL=TE0pF60vR-Y==z2LDfs4n2rvfZ5FMOuEoFsD2PwMXhw@mail.gmail.com

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204140732.31223-1-jszhang@kernel.org?part=3

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

* Re: [PATCH v4 04/13] pinctrl: berlin: add optional pinconf support
  2026-12-04 14:07 ` [PATCH v4 04/13] pinctrl: berlin: add optional pinconf support Jisheng Zhang
@ 2026-12-04 15:22   ` sashiko-bot
  0 siblings, 0 replies; 24+ messages in thread
From: sashiko-bot @ 2026-12-04 15:22 UTC (permalink / raw)
  To: Jisheng Zhang; +Cc: devicetree, linux-clk, linux-gpio, mfd, robh, conor+dt, lee

Thank you for your contribution! Sashiko AI review found 6 potential
issues to consider:
- [Medium] pinctrl: berlin: wrong errno -EOPNOTSUPP in
  berlin_pinconf_group_get()
- [Medium] pinctrl: berlin: map memory leak on error in
  berlin_pinctrl_dt_node_to_map()
- [Medium] pinctrl: berlin: raw DS register values used for
  PIN_CONFIG_DRIVE_STRENGTH
- [Low] pinctrl: berlin: map over-allocation in
  berlin_pinctrl_dt_node_to_map()
- [Low] pinctrl: berlin: berlin_pinctrl_dt_node_to_map() duplicates core
  helper
- [Low] pinctrl: berlin: berlin_pinconf_group_get() ignores
  PINCFG_SPU_10BIT
--

commit feaf1efaaaf2673c7dd44e0c2079579524261efa
Author: Jisheng Zhang <jszhang@kernel.org>

pinctrl: berlin: add optional pinconf support

This commit adds optional generic pinconf support to the Berlin pinctrl
driver, extending DT node-to-map parsing and adding group get/set callbacks
for 8-bit and 10-bit pad configuration registers.

> diff --git a/drivers/pinctrl/berlin/berlin.c b/drivers/pinctrl/berlin/berlin.c
> index 9337de1973af9..82215c36b856a 100644
> --- a/drivers/pinctrl/berlin/berlin.c
> +++ b/drivers/pinctrl/berlin/berlin.c

[ ... ]

> @@ -75,11 +95,19 @@ static int berlin_pinctrl_dt_node_to_map(struct pinctrl_dev *pctrl_dev,
>  		return -EINVAL;
>  	}
>  
> +	ret = pinconf_generic_parse_dt_config(node, pctrl_dev, &configs,
> +					      &num_configs);
> +	if (ret < 0) {
> +		dev_err(pctrl->dev, "%s: could not parse node property\n",
> +			node->name);
> +		return ret;
> +	}
> +
>  	ret = pinctrl_utils_reserve_map(pctrl_dev, map, &reserved_maps,
> -					num_maps, ngroups);
> +					num_maps, ngroups * (num_configs + 1));

[Severity: Low]
Does this over-allocate the pinctrl_map array when a node has more than one
pinconf property?

pinctrl_utils_add_map_configs() stores all num_configs items in a single
struct pinctrl_map entry per group, so each group needs at most two slots
(ngroups * (num_configs ? 2 : 1)). Because dt_remember_or_free_map() keeps
the allocated array without shrinking it, the excess slots remain allocated
for the lifetime of the mapping.

[ ... ]

> @@ -88,11 +116,22 @@ static int berlin_pinctrl_dt_node_to_map(struct pinctrl_dev *pctrl_dev,
>  						function_name);
>  		if (ret) {
>  			dev_err(pctrl->dev, "can't add map: %d\n", ret);
> -			return ret;
> +			goto exit;
> +		}
> +
> +		if (num_configs) {
> +			ret = pinctrl_utils_add_map_configs(pctrl_dev, map,
> +					&reserved_maps, num_maps, group_name,
> +					configs, num_configs,
> +					PIN_MAP_TYPE_CONFIGS_GROUP);
> +			if (ret < 0)
> +				goto exit;
>  		}
>  	}
>  
> -	return 0;
> +exit:
> +	kfree(configs);
> +	return ret;
>  }

[Severity: Medium]
Does the error path leak *map and any previously duplicated per-group
configs?

If pinctrl_utils_add_map_configs() fails with -ENOMEM in kmemdup_array() (or
pinctrl_utils_add_map_mux() fails), jumping to exit frees only the temporary
configs buffer. dt_to_map_one_config() does not call dt_free_map() when
dt_node_to_map() returns a negative error, so pinctrl_utils_free_map() is
needed on the error path.

>  static const struct pinctrl_ops berlin_pinctrl_ops = {

[Severity: Low]
Now that PINCTRL_BERLIN selects GENERIC_PINCONF, can
berlin_pinctrl_ops.dt_node_to_map use pinconf_generic_dt_node_to_map_group()
directly instead of maintaining berlin_pinctrl_dt_node_to_map()?

The core helper already handles group-based mux and generic pinconf mapping
with exact map reservation and pinctrl_utils_free_map() cleanup on failure.

[ ... ]

> @@ -177,6 +216,186 @@ static const struct pinmux_ops berlin_pinmux_ops = {
>  	.set_mux		= &berlin_pinmux_set,
>  };
>  
> +static int berlin_pinconf_group_get(struct pinctrl_dev *pctrl_dev,
> +				    unsigned int group, unsigned long *configs)
> +{
> +	enum pin_config_param param = pinconf_to_config_param(*configs);
> +	struct berlin_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctrl_dev);
> +	const struct berlin_desc_group *group_desc = pctrl->desc->groups + group;
> +	bool enabled;
> +	u32 val;
> +	int ret;
> +	u8 conf_bits = group_desc->conf_bits;
> +
> +	if (!conf_bits)
> +		return -EOPNOTSUPP;

[Severity: Medium]
Should berlin_pinconf_group_get() and berlin_pinconf_group_set() return
-ENOTSUPP instead of -EOPNOTSUPP here and in their default branches?

struct pinconf_ops requires -ENOTSUPP for unsupported configurations, and
pinconf_generic_dump_one() only treats -EINVAL and -ENOTSUPP as legal
errors. Because berlin_confops is registered unconditionally with
is_generic = true, reading debugfs pinconf-groups prints
"ERROR READING CONFIG SETTING" for unsupported parameters and for every
group on older Berlin/AS370 SoCs where conf_bits is 0.

[ ... ]

> +	case PIN_CONFIG_BIAS_DISABLE:
> +		if (conf_bits == 10)
> +			enabled = !(val & PINCFG_PE_10BIT);
> +		else
> +			enabled = !(val & (PINCFG_PD_8BIT | PINCFG_PU_8BIT));
> +		val = 0;
> +		break;
> +	case PIN_CONFIG_BIAS_PULL_DOWN:
> +		if (conf_bits == 10)
> +			enabled = (val & (PINCFG_PE_10BIT | PINCFG_PS_10BIT)) == PINCFG_PE_10BIT;
> +		else
> +			enabled = val & PINCFG_PD_8BIT;
> +		val = enabled ? 1 : 0;
> +		break;
> +	case PIN_CONFIG_BIAS_PULL_UP:
> +		if (conf_bits == 10)
> +			enabled = (val & (PINCFG_PE_10BIT | PINCFG_PS_10BIT)) ==
> +				  (PINCFG_PE_10BIT | PINCFG_PS_10BIT);
> +		else
> +			enabled = val & PINCFG_PU_8BIT;
> +		val = enabled ? 1 : 0;
> +		break;

[Severity: Low]
Should these 10-bit bias cases also check PINCFG_SPU_10BIT?

berlin_pinconf_group_set() includes and clears PINCFG_SPU_10BIT alongside
PINCFG_PE_10BIT and PINCFG_PS_10BIT on bias writes, but
berlin_pinconf_group_get() ignores it. If reset defaults or firmware leave
PINCFG_SPU_10BIT set before a kernel write, reading pinconf-groups can
misreport the pad as bias-disabled or pull-down instead of pull-up.

> +	case PIN_CONFIG_DRIVE_STRENGTH:
> +		enabled = true;
> +		if (conf_bits == 10)
> +			val = FIELD_GET(PINCFG_DS_10BIT, val);
> +		else
> +			val = FIELD_GET(PINCFG_DS_8BIT, val);
> +		break;

[Severity: Medium]
Does PIN_CONFIG_DRIVE_STRENGTH need conversion between milliamps and the raw
3-bit/4-bit DS register field in berlin_pinconf_group_get() and
berlin_pinconf_group_set()?

Both PIN_CONFIG_DRIVE_STRENGTH and pincfg-node.yaml define drive-strength in
mA, and pinconf_generic_dump_one() prints the returned value with an mA
unit. Passing the raw selector through directly reports values like 0 mA in
debugfs, rejects valid mA values above 15 (or 7 for 8-bit pads) with
-EINVAL, and risks locking raw register selectors into the SL2610 DT ABI.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204140732.31223-1-jszhang@kernel.org?part=4

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

* Re: [PATCH v4 05/13] dt-bindings: soc: synaptics: add SL2610 system controllers
  2026-12-04 14:07 ` [PATCH v4 05/13] dt-bindings: soc: synaptics: add SL2610 system controllers Jisheng Zhang
@ 2026-12-04 15:41   ` sashiko-bot
  0 siblings, 0 replies; 24+ messages in thread
From: sashiko-bot @ 2026-12-04 15:41 UTC (permalink / raw)
  To: Jisheng Zhang; +Cc: devicetree, linux-clk, linux-gpio, mfd, robh, conor+dt, lee

Thank you for your contribution! Sashiko AI review found 5 potential
issues to consider:
- [Medium] dt-bindings: soc: synaptics: omit #clock-cells in
  syna,sl2610-avio-syscon
- [Medium] dt-bindings: soc: synaptics: overly permissive pinconf
  subnode schemas
- [Medium] dt-bindings: synaptics: redefine bias-pull-up/down Ohm arg as
  0/1 toggle
- [Low] dt-bindings: clock: sl2610: driver-internal MAX count macros in
  ABI header
- [Low] dt-bindings: soc: synaptics: place CPU and AVIO clock bindings
  under clock/
--

commit ee4f371b16e854cca706c6c17171162fafc77e8d
Author: Jisheng Zhang <jszhang@kernel.org>

dt-bindings: soc: synaptics: add SL2610 system controllers

This commit adds Device Tree binding schemas for the Synaptics SL2610 AVIO,
CPU, MCU, and SoC system control blocks, along with their clock and reset ID
headers.

> diff --git a/Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-avio-syscon.yaml b/Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-avio-syscon.yaml
> new file mode 100644
> index 0000000000000..92e64f53524cc
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-avio-syscon.yaml
> @@ -0,0 +1,44 @@

[ ... ]

> +description: |
> +  The SL2610 AVIO system control block contains the audio PLLs. The
> +  external reference clock supplies the PLL input. This binding does not
> +  expose clock specifiers for this block.

[ ... ]

> +additionalProperties: false

[Severity: Medium]
Should this binding expose #clock-cells for the audio PLL outputs?

This block takes an external reference clock and provides audio PLLs, yet
#clock-cells is omitted and forbidden by additionalProperties: false.
Without it, DT consumers cannot reference the PLLs via clocks phandles,
which forces hardcoded clock names and creates DT ABI churn later.

> diff --git a/Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-cpu-syscon.yaml b/Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-cpu-syscon.yaml
> new file mode 100644
> index 0000000000000..25af41f158e0e
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-cpu-syscon.yaml
> @@ -0,0 +1,58 @@

[ ... ]

> +$id: http://devicetree.org/schemas/soc/synaptics/syna,sl2610-cpu-syscon.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Synaptics SL2610 CPU clock controller

[Severity: Low]
As reported by Krzysztof Kozlowski on v2 [1], should
syna,sl2610-cpu-syscon.yaml and syna,sl2610-avio-syscon.yaml be placed
under Documentation/devicetree/bindings/clock/ instead of bindings/soc/?

Unlike the multi-function SoC and MCU syscon bindings, both schemas describe
dedicated clock/PLL controllers.  Moving them to bindings/clock/ (or
documenting any non-clock syscon roles in their titles and descriptions)
avoids path and $id churn later.

> diff --git a/Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-mcu-syscon.yaml b/Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-mcu-syscon.yaml
> new file mode 100644
> index 0000000000000..9902908a57988
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-mcu-syscon.yaml
> @@ -0,0 +1,97 @@

[ ... ]

> +patternProperties:
> +  '-(pmux|pins)$':
> +    type: object
> +    description: Pin group mux and electrical configuration.
> +    allOf:
> +      - $ref: /schemas/pinctrl/pinmux-node.yaml#
> +      - $ref: /schemas/pinctrl/pincfg-node.yaml#
> +    properties:
> +      groups:
> +        $ref: /schemas/types.yaml#/definitions/string-array
> +      function:
> +        $ref: /schemas/types.yaml#/definitions/string
> +      bias-pull-up:
> +        description: |
> +          Enable the default pull-up with a boolean or 1, or disable it with 0.
> +          Pull resistance is not selectable.
> +        oneOf:
> +          - type: boolean
> +          - $ref: /schemas/types.yaml#/definitions/uint32
> +            enum: [0, 1]
> +      bias-pull-down:
> +        description: |
> +          Enable the default pull-down with a boolean or 1, or disable it with 0.
> +          Pull resistance is not selectable.
> +        oneOf:
> +          - type: boolean
> +          - $ref: /schemas/types.yaml#/definitions/uint32
> +            enum: [0, 1]

[Severity: Medium]
Should bias-pull-up and bias-pull-down be restricted to type: boolean here
and in syna,sl2610-soc-syscon.yaml (including dropping bias-pull-up = <1>
from its example)?

In pincfg-node.yaml, the optional uint32 argument specifies pull resistance
in Ohms on hardware that supports selectable resistance, while disabling
bias uses bias-disable.

Both pincfg-node.yaml and parse_fw_cfg() also treat all bias properties as
mutually exclusive regardless of value, so redefining 0/1 as a toggle
conflicts with generic DT semantics and fails if combined with another bias
property.

> +    required:
> +      - groups
> +      - function
> +    unevaluatedProperties: false

[Severity: Medium]
Can this pin configuration subnode (and the identical one in
syna,sl2610-soc-syscon.yaml) list only the supported properties with
additionalProperties: false instead of unevaluatedProperties: false?

Using unevaluatedProperties: false against pinmux-node.yaml and
pincfg-node.yaml lets dtbs_check silently accept unsupported properties that
berlin_pinconf_group_set() rejects with -EOPNOTSUPP, while leaving supported
pad properties like drive-strength and slew-rate unconstrained.

Also, groups and function redundantly restate $ref types already inherited
from pinmux-node.yaml.

[ ... ]

> diff --git a/include/dt-bindings/clock/syna,sl2610.h b/include/dt-bindings/clock/syna,sl2610.h
> new file mode 100644
> index 0000000000000..c563a2b5ed064
> --- /dev/null
> +++ b/include/dt-bindings/clock/syna,sl2610.h
> @@ -0,0 +1,131 @@

[ ... ]

> +#define CLK_APBDMA		62
> +#define SL2610_CLK_MAX		63
> +
> +/* cpuss */
> +#define CLK_CPU0		0
> +#define CLK_CPU1		1
> +#define CLK_DSU			2
> +#define SL2610_CPU_CLK_MAX	3

[Severity: Low]
Should SL2610_CLK_MAX and SL2610_CPU_CLK_MAX be dropped from this DT binding
header and kept internal to the clock driver?

Neither macro is a hardware clock specifier ID, and exposing driver array
sizes in the binding header means adding any clock ID later breaks the
stable DT ABI.

[1] https://lore.kernel.org/r/20261123-bold-neat-albatross-e92a2b@quoll

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204140732.31223-1-jszhang@kernel.org?part=5

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

* Re: [PATCH v4 06/13] mfd: synaptics: add SL2610 system controller support
  2026-12-04 14:07 ` [PATCH v4 06/13] mfd: synaptics: add SL2610 system controller support Jisheng Zhang
@ 2026-12-04 15:58   ` sashiko-bot
  0 siblings, 0 replies; 24+ messages in thread
From: sashiko-bot @ 2026-12-04 15:58 UTC (permalink / raw)
  To: Jisheng Zhang; +Cc: devicetree, linux-clk, linux-gpio, mfd, robh, conor+dt, lee

Thank you for your contribution! Sashiko AI review found 5 potential
issues to consider:
- [Medium] mfd: sl2610-syscon: unchecked NULL from
  device_get_match_data() in probe
- [Low] mfd: sl2610-syscon: single-function AVIO and CPU blocks wrapped
  in MFD
- [Low] mfd: sl2610-syscon: pass enum ID instead of mfd_cell arrays in
  match data
- [Low] mfd: sl2610-syscon: commit subject violates MFD prefix and
  capitalization
- [Low] mfd: sl2610-syscon: mfd_cell arrays in match data and unchecked
  dereference
--

commit 7c12564f7c07b048184bd552b6f9d7507c32b275
Author: Jisheng Zhang <jszhang@kernel.org>

mfd: synaptics: add SL2610 system controller support

This patch adds an MFD driver for Synaptics SL2610 system controller
blocks to register platform devices for their clock, reset and pin
controller sub-functions.

> mfd: synaptics: add SL2610 system controller support

[Severity: Low]
MFD commit subjects follow the "mfd: <driver>: <Capitalized description>"
format.  For this driver, that would be "mfd: sl2610-syscon: Add Synaptics
SL2610 system controller support".

> diff --git a/drivers/mfd/sl2610-syscon.c b/drivers/mfd/sl2610-syscon.c
> new file mode 100644
> index 0000000000000..c6fc2955ac0de
> --- /dev/null
> +++ b/drivers/mfd/sl2610-syscon.c
> @@ -0,0 +1,84 @@

[ ... ]

> +struct sl2610_syscon_data {
> +	const struct mfd_cell *cells;
> +	unsigned int num_cells;
> +};

[Severity: Low]
Is this wrapper struct needed?  New MFD drivers avoid passing mfd_cell
arrays via match-table .data; storing a non-zero enum ID in .data and
switching in sl2610_syscon_probe() avoids both these wrappers and the
unchecked match-data dereference on non-OF binds.

[ ... ]

> +static const struct mfd_cell sl2610_avio_cells[] = {
> +	MFD_CELL_NAME("sl2610-avio-clk"),
> +};
> +
> +static const struct mfd_cell sl2610_cpu_cells[] = {
> +	MFD_CELL_NAME("sl2610-cpu-clk"),
> +};

[Severity: Low]
Should the AVIO and CPU blocks be handled by this MFD driver at all?

Both blocks only instantiate a single clock child, and their DT bindings
describe single-function clock controllers rather than multi-function
devices.  The clock driver can match syna,sl2610-avio-syscon and
syna,sl2610-cpu-syscon directly while keeping generic syscon access.

The commit message also states that each block implements clock, reset and
pin controller devices, which does not hold for AVIO and CPU.

[ ... ]

> +static int sl2610_syscon_probe(struct platform_device *pdev)
> +{
> +	const struct sl2610_syscon_data *data = device_get_match_data(&pdev->dev);
> +
> +	return devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO,
> +				    data->cells, data->num_cells, NULL, 0, NULL);
> +}

[Severity: Medium]
Can device_get_match_data() return NULL here and cause a NULL pointer
dereference on data->cells?

sl2610_syscon_driver does not set suppress_bind_attrs, so binding a
non-OF platform device via sysfs driver_override and bind invokes
sl2610_syscon_probe() without an OF match.  Checking if (!data) and
returning -ENODEV prevents the oops.

> +
> +static const struct of_device_id sl2610_syscon_of_match[] = {
> +	{ .compatible = "syna,sl2610-soc-syscon", .data = &sl2610_soc_data },
> +	{ .compatible = "syna,sl2610-mcu-syscon", .data = &sl2610_mcu_data },
> +	{ .compatible = "syna,sl2610-avio-syscon", .data = &sl2610_avio_data },
> +	{ .compatible = "syna,sl2610-cpu-syscon", .data = &sl2610_cpu_data },
> +	{ }
> +};

[Severity: Low]
Should sl2610_syscon_of_match store enum or integer IDs in .data instead
of pointers to mfd_cell wrapper structs?  MFD convention for new drivers
is to put an ID in .data and pick the static const mfd_cell array with a
switch in probe.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204140732.31223-1-jszhang@kernel.org?part=6

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

* Re: [PATCH v4 07/13] reset: add Synaptics SL2610 reset controller support
  2026-12-04 14:07 ` [PATCH v4 07/13] reset: add Synaptics SL2610 reset " Jisheng Zhang
@ 2026-12-04 16:24   ` sashiko-bot
  0 siblings, 0 replies; 24+ messages in thread
From: sashiko-bot @ 2026-12-04 16:24 UTC (permalink / raw)
  To: Jisheng Zhang; +Cc: devicetree, linux-clk, linux-gpio, mfd, robh, conor+dt, lee

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] reset: sl2610_reset_reset() uses regmap_set_bits() RMW on
  pulse reset bits
- [Medium] reset: sl2610_reset_probe() dereferences NULL
  platform_get_device_id()
--

commit ce7199e60b6a12fd2ab39a73fe98cf4ce93b1945
Author: Jisheng Zhang <jszhang@kernel.org>

reset: add Synaptics SL2610 reset controller support

This commit adds a reset controller driver for the Synaptics SL2610 SoC and
MCU system controllers, handling both pulse and sticky reset lines via the
parent syscon regmap.

> diff --git a/drivers/reset/reset-sl2610.c b/drivers/reset/reset-sl2610.c
> new file mode 100644
> index 0000000000000..dc55a05d29d89
> --- /dev/null
> +++ b/drivers/reset/reset-sl2610.c
> @@ -0,0 +1,224 @@

[ ... ]

> +static int sl2610_reset_reset(struct reset_controller_dev *rcdev,
> +			      unsigned long id)
> +{
> +	struct sl2610_reset_priv *priv = to_sl2610_reset_priv(rcdev);
> +	const struct sl2610_reset_cfg *cfg = &priv->cfgs[id];
> +
> +	if (cfg->sticky)
> +		return -ENOTSUPP;
> +
> +	return regmap_set_bits(priv->regmap, cfg->reg, cfg->bit);
> +}

[Severity: Medium]
Can regmap_set_bits() skip the pulse reset or reset sibling peripherals here?

regmap_set_bits() calls regmap_update_bits_base() with force = false, so
_regmap_update_bits() skips the write when cfg->bit already reads as 1 and
returns 0 without pulsing the reset.

It also writes back orig | cfg->bit, which re-triggers any sibling peripheral
bit in SL2610_GBL_PERIFRESET or SL2610_GBL_APBPERIFRESET that currently reads
as 1.  Using regmap_write() with cfg->bit (as in berlin_reset_reset()), or
regmap_write_bits() if other bits must be preserved, avoids both issues.

[ ... ]

> +static int sl2610_reset_probe(struct platform_device *pdev)
> +{
> +	struct device_node *parent_np = pdev->dev.parent->of_node;
> +	struct sl2610_reset_priv *priv;
> +	const struct sl2610_reset_data *data =
> +		(void *)platform_get_device_id(pdev)->driver_data;

[Severity: Medium]
Could platform_get_device_id(pdev) return NULL here?

When a platform device is bound via sysfs driver_override, platform_match()
returns early via device_match_driver_override() without calling
platform_match_id(), leaving pdev->id_entry NULL and causing a NULL pointer
dereference.  Check platform_get_device_id(pdev) for NULL and return -ENODEV.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204140732.31223-1-jszhang@kernel.org?part=7

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

* Re: [PATCH v4 08/13] pinctrl: berlin: add Synaptics SL2610 pin controller support
  2026-12-04 14:07 ` [PATCH v4 08/13] pinctrl: berlin: add Synaptics SL2610 pin " Jisheng Zhang
@ 2026-12-04 16:51   ` sashiko-bot
  0 siblings, 0 replies; 24+ messages in thread
From: sashiko-bot @ 2026-12-04 16:51 UTC (permalink / raw)
  To: Jisheng Zhang; +Cc: devicetree, linux-clk, linux-gpio, mfd, robh, conor+dt, lee

Thank you for your contribution! Sashiko AI review found 5 potential
issues to consider:
- [High] pinctrl: berlin: UAF on sl2610-pinctrl unbind or module unload
- [Medium] pinctrl: berlin: memory leak on error in
  berlin_pinctrl_dt_node_to_map()
- [Medium] pinctrl: berlin: unsafe parent node reuse in
  sl2610_pinctrl_probe()
- [Low] pinctrl: berlin: berlin_pinconf_group_get() returns wrong
  unsupported errno
- [Low] pinctrl: berlin: PINCTRL_SL2610 Kconfig blocks isolated pinctrl
  tree builds
--

commit 4f61b6f2c7486fb1374b1521f40ce612d38b00ad
Author: Jisheng Zhang <jszhang@kernel.org>

pinctrl: berlin: add Synaptics SL2610 pin controller support

This commit adds the Synaptics SL2610 SoC and MCU pin controller driver,
defining their pin groups, mux functions, and pad configuration registers,
and binding to the platform devices created by the parent system controller.

> diff --git a/drivers/pinctrl/berlin/Kconfig b/drivers/pinctrl/berlin/Kconfig
> index abb1c912b9ba0..0ed25151caf41 100644
> --- a/drivers/pinctrl/berlin/Kconfig
> +++ b/drivers/pinctrl/berlin/Kconfig
> @@ -32,4 +32,19 @@ config PINCTRL_BERLIN_BG4CT
>  	depends on OF
>  	select PINCTRL_BERLIN
>  
> +config PINCTRL_SL2610
> +	tristate "Synaptics SL2610 pin controller driver"
> +	depends on MFD_SL2610_SYSCON

[Severity: Low]
As reported by Linus Walleij on v2 [1], does this hard dependency on
MFD_SL2610_SYSCON prevent PINCTRL_SL2610 from being enabled or
compile-tested when the pinctrl patches are applied in isolation?

MFD_SL2610_SYSCON is added by commit "mfd: synaptics: add SL2610 system
controller support", while pinctrl-sl2610.c has no build-time dependency on
it beyond syscon_node_to_regmap() and platform_device_id matching.  Allowing
COMPILE_TEST here (for example, depends on MFD_SL2610_SYSCON || COMPILE_TEST)
and splitting the pinctrl changes into a standalone series would let the
pinctrl tree take them independently.

[ ... ]

> diff --git a/drivers/pinctrl/berlin/pinctrl-sl2610.c b/drivers/pinctrl/berlin/pinctrl-sl2610.c
> new file mode 100644
> index 0000000000000..90b2538597cc7
> --- /dev/null
> +++ b/drivers/pinctrl/berlin/pinctrl-sl2610.c

[ ... ]

> +static void sl2610_pinctrl_clear_node(void *data)
> +{
> +	device_set_node(data, NULL);
> +}
> +
> +static int sl2610_pinctrl_probe(struct platform_device *pdev)
> +{
> +	struct device *dev = &pdev->dev;
> +	const struct berlin_pinctrl_desc *desc =
> +		(void *)platform_get_device_id(pdev)->driver_data;
> +	struct regmap *regmap;
> +	int ret;
> +
> +	regmap = syscon_node_to_regmap(dev->parent->of_node);
> +	if (IS_ERR(regmap))
> +		return dev_err_probe(dev, PTR_ERR(regmap), "Failed to get syscon regmap\n");
> +
> +	device_set_node(dev, dev_fwnode(dev->parent));
> +	ret = devm_add_action_or_reset(dev, sl2610_pinctrl_clear_node, dev);
> +	if (ret)
> +		return ret;

[Severity: Medium]
Can reusing the parent syscon node with device_set_node() and clearing it
in sl2610_pinctrl_clear_node() misreport the device modalias and race with
driver binding to cause a NULL pointer dereference?

Because device_set_node() leaves dev_of_node_reused(dev) false,
of_device_modalias() and of_device_uevent_modalias() report the parent
syscon OF modalias instead of platform:sl2610-soc-pinctrl on probe, and
clearing dev->of_node on a live device during unbind can emit "(null)" in
lockless sysfs modalias/uevent reads.

In addition, of_match_device() matches sl2610_syscon_driver against the
child pinctrl device while dev_of_node_reused(dev) is false.  Because
bind_store() calls driver_match_device() without device_lock(dev) and then
attaches without re-matching, racing sysfs bind on sl2610-syscon against
unbinding sl2610-pinctrl hits a NULL dereference:

CPU0                              CPU1
bind_store() [sl2610-syscon]
  driver_match_device()
    of_match_device() -> match
                                  unbind [sl2610-pinctrl]
                                    devres_release_all()
                                      sl2610_pinctrl_clear_node()
                                        dev->of_node = NULL
                                    device_set_driver(dev, NULL)
  device_driver_attach()
    sl2610_syscon_probe()
      data = device_get_match_data() -> NULL
      data->cells  <-- NULL pointer dereference

Calling platform_device_set_of_node_from_dev(pdev, dev->parent) instead of
device_set_node() and sl2610_pinctrl_clear_node() sets
dev_set_of_node_reused(dev), takes a balanced OF node reference, and avoids
clearing dev->of_node on a live device.

> +
> +	return berlin_pinctrl_probe_regmap(pdev, desc, regmap);

[Severity: Medium]
When pinconf map allocation fails for these BERLIN_PINCTRLCONF_GROUP
controllers, does berlin_pinctrl_dt_node_to_map() leak the reserved
pinctrl_map array and any previously duplicated config arrays?

In commit "pinctrl: berlin: add optional pinconf support", the error path
frees only the temporary configs buffer:

drivers/pinctrl/berlin/berlin.c:berlin_pinctrl_dt_node_to_map() {
    ...
		if (num_configs) {
			ret = pinctrl_utils_add_map_configs(pctrl_dev, map,
					&reserved_maps, num_maps, group_name,
					configs, num_configs,
					PIN_MAP_TYPE_CONFIGS_GROUP);
			if (ret < 0)
				goto exit;
		}
	}

exit:
	kfree(configs);
	return ret;
}

When pinctrl_utils_add_map_configs() returns -ENOMEM (or
pinctrl_utils_add_map_mux() fails), dt_to_map_one_config() returns
immediately without calling dt_free_map(), so *map and earlier per-group
config copies leak unless the error path calls
pinctrl_utils_free_map(pctrl_dev, *map, *num_maps).

[Severity: Low]
Does berlin_pinconf_group_get() return -EOPNOTSUPP instead of -ENOTSUPP for
unsupported pinconf parameters or groups without pinconf registers?

In commit "pinctrl: berlin: add optional pinconf support",
berlin_pinconf_group_get() returns -EOPNOTSUPP when conf_bits is zero and
in the default switch case, but pinconf_generic_dump_one() only skips
-EINVAL and -ENOTSUPP:

drivers/pinctrl/pinconf-generic.c:pinconf_generic_dump_one() {
    ...
		if (ret == -EINVAL || ret == -ENOTSUPP)
			continue;
		if (ret) {
			seq_printf(s, "ERROR READING CONFIG SETTING %d ", i);
			continue;
		}
    ...
}

Reading the pinconf-groups debugfs file will therefore print error messages
for every unsupported generic parameter on SL2610 groups and for all
parameters on legacy Berlin SoCs.

> +}
> +
> +static struct platform_driver sl2610_pinctrl_driver = {
> +	.probe = sl2610_pinctrl_probe,
> +	.id_table = sl2610_pinctrl_ids,
> +	.driver = {
> +		.name = "sl2610-pinctrl",
> +	},
> +};
> +module_platform_driver(sl2610_pinctrl_driver);

[Severity: High]
Can unloading pinctrl-sl2610 or unbinding its platform device via sysfs
cause a use-after-free in bound pinctrl consumers?

Because sl2610_pinctrl_probe() borrows the parent syscon fwnode after the
parent has already claimed fwnode->dev, fw_devlink links DT consumers to
sl2610-syscon rather than to the child pinctrl devices.  In
drivers/pinctrl/berlin/berlin.c, berlin_pctrl_desc leaves link_consumers
false so pinctrl_link_add() adds no consumer device links, and omits
pins/get_group_pins so pin_request() never takes a module reference (and
berlin_pctrl_desc.owner is built-in berlin.c's THIS_MODULE).

Running rmmod pinctrl-sl2610 or unbinding via sysfs therefore runs
pinctrl_unregister() -> kfree(pctldev) and unmaps the module data while
consumers remain bound with dangling setting->pctldev and dt_map->pctldev
pointers.  A subsequent consumer unbind (pinmux_disable_setting() or
dt_free_map()) or pinctrl state change deterministically dereferences the
freed pctldev and unmapped module memory.

Setting link_consumers = true in berlin_pctrl_desc ensures consumer device
links unbind consumers before pinctrl_unregister() runs.

[1] https://lore.kernel.org/r/CAD++jL=TE0pF60vR-Y==z2LDfs4n2rvfZ5FMOuEoFsD2PwMXhw@mail.gmail.com

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204140732.31223-1-jszhang@kernel.org?part=8

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

* Re: [PATCH v4 09/13] clk: berlin: add Synaptics clock controller helpers
  2026-12-04 14:07 ` [PATCH v4 09/13] clk: berlin: add Synaptics clock controller helpers Jisheng Zhang
@ 2026-12-04 17:13   ` sashiko-bot
  0 siblings, 0 replies; 24+ messages in thread
From: sashiko-bot @ 2026-12-04 17:13 UTC (permalink / raw)
  To: Jisheng Zhang; +Cc: devicetree, linux-clk, linux-gpio, mfd, robh, conor+dt, lee

Thank you for your contribution! Sashiko AI review found 8 potential
issues to consider:
- [High] clk: berlin: IRQ-unsafe spinlock in sl_sysmgr_gateclk_ops
- [Medium] clk: berlin: uninitialized struct clk_init_data in
  sl-sysmgr-clk.c
- [Medium] clk: berlin: sl_clk_determine_rate() ignores min_rate and
  max_rate
- [Medium] clk: berlin: sl_clk_get_parent() returns 0 on unsupported
  selector
- [Medium] clk: berlin: sl_sysmgr_clk_ops and gateclk ops omit .disable
  callback
- [Medium] clk: berlin: sl_sysmgr_clk_setup() ignores descriptor flags
- [Medium] clk: berlin: sl_clk_value() maps DIV_SEL 0, 6, 7 to 0 instead
  of 1
- [Low] clk: berlin: sl-sysmgr-clk.h is not self-contained and has
  unused items
--

commit 7ae4f8ba2e3b37f62f72f67fa5bfa73fb4501645
Author: Jisheng Zhang <jszhang@kernel.org>

clk: berlin: add Synaptics clock controller helpers

This commit adds the shared configurable divider/gate clock driver
(sl-clk.c) and the MCU system manager clock helper (sl-sysmgr-clk.c) for
Synaptics SL SoCs.

> diff --git a/drivers/clk/berlin/sl-clk.c b/drivers/clk/berlin/sl-clk.c
> new file mode 100644
> index 0000000000000..e212320a0637d
> --- /dev/null
> +++ b/drivers/clk/berlin/sl-clk.c
> @@ -0,0 +1,279 @@

[ ... ]

> +static unsigned int sl_clk_value(u32 val)
> +{
> +	static const u8 div_table[] = { 0, 2, 4, 6, 8, 12, 0, 0 };
> +
> +	if (val & SL_CLK_DIV3_SWITCH)
> +		return 3;
> +	if (!(val & SL_CLK_DIV_SWITCH))
> +		return 1;
> +
> +	return div_table[FIELD_GET(SL_CLK_DIV_SEL, val)];
> +}
> +
> +static unsigned long sl_clk_recalc_rate(struct clk_hw *hw,
> +					unsigned long parent_rate)
> +{
> +	struct sl_clk *clk = to_sl_clk(hw);
> +	unsigned int divisor = sl_clk_value(readl_relaxed(clk->reg));
> +
> +	if (WARN_ON_ONCE(!divisor))
> +		return 0;
> +
> +	return parent_rate / divisor;
> +}

[Severity: Medium]
Should div_table[] map SL_CLK_DIV_SEL encodings 0, 6, and 7 to 1 rather
than 0?

This register layout matches BERLIN2_SINGLE_DIV in berlin2-div.h, where
berlin2-div.c maps those encodings to divide-by-1 in clk_div[].  If reset
or firmware leaves SL_CLK_DIV_SWITCH set with SL_CLK_DIV_SEL in {0, 6, 7},
sl_clk_recalc_rate() triggers WARN_ON_ONCE(!divisor) and reports 0 Hz for
the clock and its children.

> +
> +static unsigned int sl_clk_best(unsigned long parent_rate,
> +				unsigned long rate)
> +{
> +	unsigned long best_diff = ULONG_MAX;
> +	unsigned int best = 1, i;
> +
> +	for (i = 0; i < ARRAY_SIZE(sl_clk_values); i++) {
> +		unsigned long candidate = parent_rate / sl_clk_values[i];
> +		unsigned long diff = candidate > rate ? candidate - rate :
> +							     rate - candidate;
> +
> +		if (diff < best_diff) {
> +			best_diff = diff;
> +			best = sl_clk_values[i];
> +		}
> +	}
> +
> +	return best;
> +}
> +
> +static int sl_clk_determine_rate(struct clk_hw *hw,
> +				 struct clk_rate_request *req)
> +{
> +	struct clk_hw *parent = clk_hw_get_parent(hw);
> +
> +	if (!parent)
> +		return -EINVAL;
> +
> +	req->best_parent_hw = parent;
> +	req->best_parent_rate = clk_hw_get_rate(parent);
> +	req->rate = req->best_parent_rate /
> +		    sl_clk_best(req->best_parent_rate, req->rate);
> +
> +	return 0;
> +}

[Severity: Medium]
Does sl_clk_determine_rate() need to respect req->min_rate and
req->max_rate?

sl_clk_best() picks the closest divisor across sl_clk_values[] without
checking rate bounds.  For example, with a 1200 MHz parent and
req->max_rate = 360 MHz, it selects divisor 3 (400 MHz) instead of
divisor 4 (300 MHz), causing clk_calc_new_rates() to reject the rate and
fail clk_set_rate() with -EINVAL even though a valid in-range divisor
exists.

Filtering candidates to [req->min_rate, req->max_rate] and returning
-EINVAL if none fits avoids this.

[ ... ]

> +static u8 sl_clk_get_parent(struct clk_hw *hw)
> +{
> +	struct sl_clk *clk = to_sl_clk(hw);
> +	u32 val = readl_relaxed(clk->reg);
> +	u8 selector;
> +	unsigned int index;
> +
> +	if (!(val & SL_CLK_PLL_SWITCH))
> +		return 0;
> +
> +	selector = FIELD_GET(SL_CLK_PLL_SEL, val);
> +	index = selector + 1;
> +	if (index < clk_hw_get_num_parents(hw))
> +		return index;
> +
> +	dev_warn(clk->dev, "%s: unsupported parent selector %u\n",
> +		 clk_hw_get_name(hw), selector);
> +	return 0;
> +}

[Severity: Medium]
Should sl_clk_get_parent() return an out-of-range index instead of 0 when
hardware has an unsupported parent selector?

Returning 0 makes __clk_init_parent() attach the clock to parent 0 even
though SL_CLK_PLL_SWITCH is still set to the invalid selector.  Any later
clk_set_parent() targeting parent 0 then short-circuits in
clk_core_set_parent_nolock() because core->parent already matches, leaving
hardware stuck on the unsupported selector.

Returning index (or clk_hw_get_num_parents(hw)) lets
clk_core_get_parent_by_index() treat the clock as orphaned until
reparented.

[ ... ]

> diff --git a/drivers/clk/berlin/sl-sysmgr-clk.c b/drivers/clk/berlin/sl-sysmgr-clk.c
> new file mode 100644
> index 0000000000000..f3cf921fc3c1a
> --- /dev/null
> +++ b/drivers/clk/berlin/sl-sysmgr-clk.c
> @@ -0,0 +1,241 @@

[ ... ]

> +static DEFINE_SPINLOCK(sl_sysmgr_gateclk_lock);
> +
> +#define to_sl_sysmgr_gateclk(hw)	container_of(hw, struct sl_sysmgr_gateclk, hw)
> +#define to_sl_sysmgr_clk(hw)		container_of(hw, struct sl_sysmgr_clk, hw)
> +
> +static int sl_sysmgr_gateclk_enable(struct clk_hw *hw)
> +{
> +	u32 val;
> +	struct sl_sysmgr_gateclk *clk = to_sl_sysmgr_gateclk(hw);
> +
> +	guard(spinlock)(&sl_sysmgr_gateclk_lock);
> +
> +	val = readl_relaxed(clk->base);
> +	if (!(val & BIT(clk->bit_idx))) {
> +		val |= BIT(clk->bit_idx);
> +		writel_relaxed(val, clk->base);
> +	}
> +
> +	return 0;
> +}
> +
> +static int sl_sysmgr_gateclk_is_enabled(struct clk_hw *hw)
> +{
> +	u32 val;
> +	struct sl_sysmgr_gateclk *clk = to_sl_sysmgr_gateclk(hw);
> +
> +	guard(spinlock)(&sl_sysmgr_gateclk_lock);
> +
> +	val = readl_relaxed(clk->base);
> +	val &= BIT(clk->bit_idx);
> +
> +	return val ? 1 : 0;
> +}

[Severity: High]
Can acquiring sl_sysmgr_gateclk_lock without disabling interrupts cause a
hardirq deadlock?

clk_core_enable() calls sl_sysmgr_gateclk_enable() while holding CCF's
hardirq-safe enable_lock, whereas clk_summary_show_one() calls
sl_sysmgr_gateclk_is_enabled() in process context with interrupts enabled
and without enable_lock:

CPU0                              CPU1
----                              ----
lock(&sl_sysmgr_gateclk_lock)
                                  lock(&enable_lock)
                                  lock(&sl_sysmgr_gateclk_lock)
<hardirq>
  lock(&enable_lock)

 *** DEADLOCK ***

CPU0: clk_summary_show_one() -> clk_core_is_enabled() ->
      sl_sysmgr_gateclk_is_enabled()
      <hardirq> clk_enable() -> clk_core_enable_lock()
CPU1: clk_enable() -> clk_core_enable_lock() ->
      sl_sysmgr_gateclk_enable()

A hardirq enabling a SysMgr gate clock on the same CPU also self-deadlocks
on sl_sysmgr_gateclk_lock.  Since sl_sysmgr_gateclk_is_enabled() only
performs a single 32-bit readl_relaxed(), dropping the lock there and
using guard(spinlock_irqsave) on the write path avoids both the deadlock
and unnecessary global contention.

> +
> +static const struct clk_ops sl_sysmgr_gateclk_ops = {
> +	.enable		= sl_sysmgr_gateclk_enable,
> +	.is_enabled	= sl_sysmgr_gateclk_is_enabled,
> +};

[Severity: Medium]
Why do sl_sysmgr_gateclk_ops and sl_sysmgr_clk_ops omit .disable?

Without .disable, clk_disable() and clk_disable_unused() cannot gate
these clocks off in hardware once enabled.  In addition,
clk_is_enabled_when_prepared() checks !(ops->enable && ops->disable) and
falsely returns true, causing pm_clk_acquire() to misclassify these
clocks as enabled when prepared.

Separately, sl_sysmgr_gateclk duplicates devm_clk_hw_register_gate(), and
struct sl_sysmgr_gateclk_desc duplicates struct sl_gateclk_desc in
sl-clk.h.

> +
> +static int
> +sl_sysmgr_gateclk_register(struct device *dev, struct sl_sysmgr_gateclk *gclk,
> +			   const char *name, const char *parent_names,
> +			   u8 bit_idx, void __iomem *base)
> +{
> +	struct clk_init_data init;
> +
> +	init.name = name;
> +	init.ops = &sl_sysmgr_gateclk_ops;
> +	init.parent_names = &parent_names;
> +	init.num_parents = 1;
> +	init.flags = 0;

[Severity: Medium]
Does leaving init uninitialized here and in sl_sysmgr_clk_register() pass
uninitialized stack memory into clk_core_populate_parent_map()?

Neither function initializes init.parent_data or init.parent_hws, which
clk_core_populate_parent_map() reads unconditionally during clock
registration, triggering KMSAN warnings.  Zero-initializing with
struct clk_init_data init = {}; (as sl_clk_register() does) avoids this.

[ ... ]

> +	for (i = 0; i < gclk_n; i++) {
> +		ret = sl_sysmgr_gateclk_register(&pdev->dev, &priv->gclks[i],
> +						 gdescs[i].name, gdescs[i].parent_name,
> +						 gdescs[i].bit_idx, base + gclk_offset);
> +		if (ret)
> +			return ret;
> +
> +		id = gdescs[i].id;
> +		clk_data->hws[id] = &priv->gclks[i].hw;
> +	}
> +
> +	for (i = 0; i < clk_n; i++) {
> +		ret = sl_sysmgr_clk_register(&pdev->dev, &priv->clks[i],
> +					     descs[i].name, descs[i].parent_name,
> +					     descs[i].div_bits, base + descs[i].offset);

[Severity: Medium]
Should sl_sysmgr_clk_setup() pass gdescs[i].flags and descs[i].flags to
the registration helpers?

Both struct sl_sysmgr_gateclk_desc and struct sl_sysmgr_clk_desc expose a
flags field, but sl_sysmgr_gateclk_register() and sl_sysmgr_clk_register()
hardcode init.flags = 0, silently discarding flags such as
CLK_IS_CRITICAL or CLK_IGNORE_UNUSED.

[ ... ]

> diff --git a/drivers/clk/berlin/sl-sysmgr-clk.h b/drivers/clk/berlin/sl-sysmgr-clk.h
> new file mode 100644
> index 0000000000000..5ccf388bcccbd
> --- /dev/null
> +++ b/drivers/clk/berlin/sl-sysmgr-clk.h
> @@ -0,0 +1,44 @@

[ ... ]

> +#ifndef __SL_SYSMGR_CLK_H
> +#define __SL_SYSMGR_CLK_H
> +
> +struct sl_sysmgr_clk_desc {
> +	const char	*name;
> +	const char	*parent_name;
> +	u32		id;
> +	u32		offset;
> +	u8		div_bits;
> +	unsigned long	flags;
> +};

[ ... ]

> +int sl_sysmgr_clk_setup(struct platform_device *pdev,

[Severity: Low]
Can sl-sysmgr-clk.h be included standalone?  It uses u32, u8, and struct
platform_device without including linux/types.h or forward-declaring
struct platform_device, which fails to build if included before those
headers.

In sl-sysmgr-clk.c, linux/version.h and DIV_CHNG_EN are also unused.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204140732.31223-1-jszhang@kernel.org?part=9

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

* Re: [PATCH v4 10/13] clk: berlin: add Synaptics SL2610 clocks and PLLs
  2026-12-04 14:07 ` [PATCH v4 10/13] clk: berlin: add Synaptics SL2610 clocks and PLLs Jisheng Zhang
@ 2026-12-04 17:39   ` sashiko-bot
  0 siblings, 0 replies; 24+ messages in thread
From: sashiko-bot @ 2026-12-04 17:39 UTC (permalink / raw)
  To: Jisheng Zhang; +Cc: devicetree, linux-clk, linux-gpio, mfd, robh, conor+dt, lee

Thank you for your contribution! Sashiko AI review found 8 potential
issues to consider:
- [Medium] clk: berlin: hardcoded osc parent breaks ge0 and ge1 ptp
  refclks
- [Medium] clk: berlin: IRQ-unsafe sl_sysmgr_gateclk_lock risks hardirq
  deadlock
- [Medium] clk: berlin: external clk_hw stored in clk_parent_data.hw
- [Medium] clk: berlin: unchecked platform_get_device_id() in
  sl2610_clks_probe()
- [Low] clk: berlin: misspelled gate clock names apbuart3lck and
  apbi2c1lck
- [Low] clk: berlin: unused SL2610_APLL macro and struct forward
  declarations
- [Low] clk: berlin: ARCH_BERLIN gate in drivers/clk/Makefile breaks
  COMPILE_TEST
- [Low] clk: berlin: dereference of dev before NULL check in
  sl2610_pll_register()
--

commit b1f80cb9b6c334b2a4faa23585bae12adc210391
Author: Jisheng Zhang <jszhang@kernel.org>

clk: berlin: add Synaptics SL2610 clocks and PLLs

This commit adds the Synaptics SL2610 PLL and clock controller drivers,
registering the SoC, CPU, AVIO, and MCU clocks via MFD platform devices.

> diff --git a/drivers/clk/berlin/Kconfig b/drivers/clk/berlin/Kconfig
> index 8f71d4c7a478b..88760ad0af5b9 100644
> --- a/drivers/clk/berlin/Kconfig
> +++ b/drivers/clk/berlin/Kconfig
> @@ -5,3 +5,29 @@ config SL_COMMON_CLK
>  
>  config SL_SYSMGR_CLK
>  	bool
> +
> +config SL2610_PLL
> +	tristate "Synaptics SL2610 PLL Driver"
> +	depends on ARCH_BERLIN || COMPILE_TEST
> +	default n
> +	help
> +	  Support the integer and fractional PLL outputs used by the SoC,
> +	  CPU and audio clock controllers on Synaptics SL2610 SoCs.
> +
> +	  To compile this driver as a module, choose M here. The module will
> +	  be called sl2610-pll.
> +
> +config SL2610_CLK
> +	tristate "Synaptics SL2610 Clock Driver"
> +	depends on ARCH_BERLIN || COMPILE_TEST
> +	depends on OF && HAS_IOMEM

[Severity: Low]
Will SL2610_PLL and SL2610_CLK actually be built when COMPILE_TEST is
enabled without ARCH_BERLIN?

drivers/clk/Makefile still gates descent into the directory on
obj-$(CONFIG_ARCH_BERLIN) += berlin/, so Kbuild silently skips
drivers/clk/berlin/ when ARCH_BERLIN is disabled.  Switching that entry to
obj-y += berlin/ would also require gating the unconditional berlin2-*.o
objects in drivers/clk/berlin/Makefile.

> diff --git a/drivers/clk/berlin/clk-sl2610.c b/drivers/clk/berlin/clk-sl2610.c
> new file mode 100644
> index 0000000000000..b51d3523028de
> --- /dev/null
> +++ b/drivers/clk/berlin/clk-sl2610.c

[ ... ]

> +	{ "apbuart3lck",	"apbcoreclk",	CLK_APBUART3,		13 },
> +	{ "apbi2c0clk",		"apbcoreclk",	CLK_APBI2C0,		14 },
> +	{ "apbi2c1lck",		"apbcoreclk",	CLK_APBI2C1,		15 },

[Severity: Low]
apbuart3lck and apbi2c1lck appear to be typos for apbuart3clk and
apbi2c1clk, which exposes misspelled names in debugfs and breaks any
name-based lookup for those clocks.

[ ... ]

> +static const char * const ge_ptp_refclk_parent_names[] = {
> +	"osc",
> +	"apll0_outf",
> +	"syspll1_out",
> +	"syspll0_out",
> +	"clk_mcu_axi",
> +};

[Severity: Medium]
Can ge0_ptp_refclk and ge1_ptp_refclk end up orphaned at 0 Hz when parent
index 0 is selected?

The DT binding passes the external reference clock by phandle without
requiring it to be globally named "osc".  In sl2611.dtsi, the fixed-clock
node is named clock-osc without clock-output-names, so
_of_fixed_clk_setup() registers it as "clock-osc" rather than "osc".
Resolving the reference clock from dev->parent->of_node or using
clk_parent_data would avoid the mismatch.

[ ... ]

> +static int sl2610_sysmgr_clk_setup(struct platform_device *pdev)
> +{
> +	return sl_sysmgr_clk_setup(pdev, sl2610_sysmgr_fixeds, ARRAY_SIZE(sl2610_sysmgr_fixeds),
> +				   sl2610_sysmgr_gates, ARRAY_SIZE(sl2610_sysmgr_gates),
> +				   CLK_GATE_CTRL0,
> +				   sl2610_sysmgr_clks, ARRAY_SIZE(sl2610_sysmgr_clks));
> +}

[Severity: Medium]
Can registering these MCU gate clocks trigger a hardirq deadlock on
sl_sysmgr_gateclk_lock?

In drivers/clk/berlin/sl-sysmgr-clk.c, both sl_sysmgr_gateclk_enable() and
sl_sysmgr_gateclk_is_enabled() acquire sl_sysmgr_gateclk_lock with plain
guard(spinlock) without disabling interrupts.  Reading
/sys/kernel/debug/clk/clk_summary calls sl_sysmgr_gateclk_is_enabled() in
process context with IRQs enabled, which can deadlock if a hardirq enables
a gate clock on the same CPU:

clk_summary_show_one()
  clk_core_is_enabled()
    sl_sysmgr_gateclk_is_enabled()
      guard(spinlock)(&sl_sysmgr_gateclk_lock)
      <hardirq>
        clk_enable()
          sl_sysmgr_gateclk_enable()
            guard(spinlock)(&sl_sysmgr_gateclk_lock)  <-- spins forever

It also creates an ABBA lock inversion with CCF's global enable_lock across
CPUs.  Using guard(spinlock_irqsave) in sl_sysmgr_gateclk_enable() (and
either guard(spinlock_irqsave) or a lockless readl_relaxed() in
sl_sysmgr_gateclk_is_enabled()) avoids the inversion.

[ ... ]

> +static int sl2610_clks_probe(struct platform_device *pdev)
> +{
> +	int (*clk_setup)(struct platform_device *pdev);
> +
> +	clk_setup = (void *)platform_get_device_id(pdev)->driver_data;
> +
> +	return clk_setup(pdev);
> +}

[Severity: Medium]
Can platform_get_device_id(pdev) return NULL and cause a NULL pointer
dereference here?

If an unbound platform device is bound to sl2610-clk via sysfs
driver_override, platform_match() returns early on
device_match_driver_override() without calling platform_match_id(), leaving
pdev->id_entry NULL.  Checking for a NULL id and returning -ENODEV prevents
the oops.

> diff --git a/drivers/clk/berlin/sl2610-pll.c b/drivers/clk/berlin/sl2610-pll.c
> new file mode 100644
> index 0000000000000..62c5d2d19c362
> --- /dev/null
> +++ b/drivers/clk/berlin/sl2610-pll.c

[ ... ]

> +#define SL2610_APLL
> +struct sl2610_pll {

[Severity: Low]
SL2610_APLL is an unused leftover macro.  In addition, sl2610-pll.h
contains unused forward declarations for struct clk_hw_onecell_data and
struct device_node.

[ ... ]

> +int sl2610_pll_register(struct device *dev, void __iomem *ctrl,
> +			const char *out, const char *outf)
> +{
> +	struct device_node *np = dev->parent->of_node;
> +	struct clk_parent_data parent = {};
> +	struct clk_init_data init = {};
> +	struct sl2610_pll *pll;
> +	struct clk *input;
> +	int ret;
> +
> +	if (!dev || !ctrl || !out || !outf)
> +		return -EINVAL;

[Severity: Low]
Does the initializer for np dereference dev before the !dev check?

Initializing np after validating dev (and dev->parent and np if defensive
checking is intended) avoids the dead NULL check and prevents an oops if a
caller ever passes a NULL dev.

> +	input = of_clk_get(np, 0);
> +	if (IS_ERR(input))
> +		return dev_err_probe(dev, PTR_ERR(input),
> +				     "failed to get PLL reference clock\n");
> +	parent.hw = __clk_get_hw(input);
> +	ret = devm_add_action_or_reset(dev, sl2610_pll_put_clk, input);
> +	if (ret)
> +		return ret;
> +
> +	pll = devm_kzalloc(dev, sizeof(*pll), GFP_KERNEL);
> +	if (!pll)
> +		return -ENOMEM;
> +	pll->ctrl = ctrl;
> +
> +	init.name = out;
> +	init.ops = &sl2610_pllout_ops;
> +	init.parent_data = &parent;
> +	init.num_parents = 1;
> +	init.flags = CLK_GET_RATE_NOCACHE;
> +	pll->pllout.init = &init;
> +
> +	ret = devm_clk_hw_register(dev, &pll->pllout);

[Severity: Medium]
Can storing __clk_get_hw(input) in parent.hw cause a use-after-free if the
external reference clock provider is unregistered?

clk_parent_data.hw is only valid for provider-internal clocks, and holding
the struct clk from of_clk_get() does not prevent an external provider from
unregistering and freeing its struct clk_hw.  On unregistration,
clk_core_evict_parent_cache() clears entry->core while leaving entry->hw
set, so a later clk_core_fill_parent_index() dereferences entry->hw->core
on the freed clk_hw.  Since clk_hw_register() already attaches
dev->parent->of_node, initializing parent with { .index = 0 } lets CCF
resolve the DT parent directly without of_clk_get() or storing an external
clk_hw pointer.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204140732.31223-1-jszhang@kernel.org?part=10

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

* Re: [PATCH v4 12/13] arm64: dts: synaptics: add SL2610 family SoCs
  2026-12-04 14:07 ` [PATCH v4 12/13] arm64: dts: synaptics: add SL2610 family SoCs Jisheng Zhang
@ 2026-12-04 18:05   ` sashiko-bot
  0 siblings, 0 replies; 24+ messages in thread
From: sashiko-bot @ 2026-12-04 18:05 UTC (permalink / raw)
  To: Jisheng Zhang; +Cc: devicetree, linux-clk, linux-gpio, mfd, robh, conor+dt, lee

Thank you for your contribution! Sashiko AI review found 7 potential
issues to consider:
- [Medium] arm64: dts: synaptics: missing clock-output-names on
  clock-osc node
- [Medium] arm64: dts: synaptics: missing sticky resets on SL2610 MCU
  UART nodes
- [Low] arm64: dts: synaptics: optee node placed under root instead of
  /firmware
- [Low] arm64: dts: synaptics: 4-CPU PPI mask used on 1-core and 2-core
  SL2610 SoCs
- [Low] arm64: dts: synaptics: non-generic sm-bus node name in
  sl2611.dtsi
- [Low] arm64: dts: synaptics: duplicated cpu1 and pmu nodes in
  sl2615/17/19.dtsi
- [Low] arm64: dts: synaptics: missing root compatible property in
  sl2619.dtsi
--

commit 9e9c29c7ff9d5fff145a2b154951b9695d30488a
Author: Jisheng Zhang <jszhang@kernel.org>

arm64: dts: synaptics: add SL2610 family SoCs

This commit adds Devicetree source files for the Synaptics SL2610 family
SoCs (SL2611, SL2613, SL2615, SL2617, and SL2619), describing their
CPUs, GIC, system controllers, and on-chip peripherals.

> diff --git a/arch/arm64/boot/dts/synaptics/sl2611.dtsi b/arch/arm64/boot/dts/synaptics/sl2611.dtsi
> new file mode 100644
> index 0000000000000..03859bae07bda
> --- /dev/null
> +++ b/arch/arm64/boot/dts/synaptics/sl2611.dtsi
> @@ -0,0 +1,466 @@

[ ... ]

> +	osc: clock-osc {
> +		compatible = "fixed-clock";
> +		#clock-cells = <0>;
> +	};

[Severity: Medium]
Does this node need clock-output-names = "osc"?

Without clock-output-names, _of_fixed_clk_setup() registers the clock
under the node name ("clock-osc"), because the DTS label is discarded by
dtc.

In drivers/clk/berlin/clk-sl2610.c, ge_ptp_refclk_parent_names[] looks
up parent index 0 by the literal name "osc".  Without a matching clock
name, CLK_GE0_PTP_REF and CLK_GE1_PTP_REF remain orphaned at 0 Hz and
sl_clk_determine_rate() returns -EINVAL when parent 0 is selected.

[ ... ]

> +	optee {
> +		compatible = "linaro,optee-tz";
> +		method = "smc";
> +	};

[Severity: Low]
Should this optee node live under a /firmware container node instead of
directly under the root node?

Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml
places optee under /firmware, and of_platform_default_populate_init()
populates /firmware children ahead of general root devices.

[ ... ]

> +		sm-bus {
> +			compatible = "simple-bus";
> +			ranges;
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +			dma-ranges = <0xa0000000 0x00000000 0x10000000>;

[Severity: Low]
This isn't a bug, but Devicetree convention prefers generic node names
such as bus (for example sm_bus: bus) rather than subsystem-prefixed
names like sm-bus.

[ ... ]

> +			sm_uart0: serial@e5030000 {
> +				compatible = "syna,sl2610-uart", "snps,dw-apb-uart";
> +				reg = <0xe5030000 0x100>;
> +				clocks = <&sm_clk CLK_SER_UART0>, <&sm_clk CLK_CFG_UART0>;
> +				clock-names = "baudclk", "apb_pclk";
> +				interrupts = <GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>;
> +				reg-shift = <2>;
> +
> +				status = "disabled";
> +			};

[Severity: Medium]
Are sm_uart0 through sm_uart3 missing their resets properties for the
sticky PRST and SRST lines in sm_rst?

drivers/reset/reset-sl2610.c defines RST_SM_UART{0..3}PRST and SRST in
SL2610_SMGBL_STICKYRST0, and commit ac04a6daa030 ("dt-bindings: serial:
snps-dw-apb-uart: Add Synaptics sl2610 uart") allowed two resets for
syna,sl2610-uart.  Sibling sm_i3c0 also declares its pair from sm_rst.

Without resets, dw8250_probe() cannot deassert them, so any MCU UART
left asserted in reset by hardware defaults or firmware (such as
non-console ports like sm_uart1) will fail to operate or fault on
register access.

[ ... ]

> +		gic: interrupt-controller@f7e59000 {
> +			compatible = "arm,gic-400";
> +			reg = <0xf7e59000 0x1000>,
> +			      <0xf7e5a000 0x2000>,
> +			      <0xf7e5c000 0x2000>,
> +			      <0xf7e5e000 0x2000>;
> +			#interrupt-cells = <3>;
> +			interrupt-controller;
> +			interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
> +		};

[ ... ]

> +	timer {
> +		compatible = "arm,armv8-timer";
> +		interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
> +			     <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
> +			     <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
> +			     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
> +	};

[Severity: Low]
Should these PPI interrupts use GIC_CPU_MASK_SIMPLE(1) here and
GIC_CPU_MASK_SIMPLE(2) in the dual-core SoC files instead of a 4-CPU
mask?

sl2611 and sl2613 are single-core SoCs and sl2615, sl2617, and sl2619
are dual-core.  While Linux masks off bits [15:8] in
gic_irq_domain_translate(), other DT consumers receive an inaccurate
4-CPU PPI mask.

[ ... ]

> diff --git a/arch/arm64/boot/dts/synaptics/sl2617.dtsi b/arch/arm64/boot/dts/synaptics/sl2617.dtsi
> new file mode 100644
> index 0000000000000..17f8ea9f2a44b
> --- /dev/null
> +++ b/arch/arm64/boot/dts/synaptics/sl2617.dtsi
> @@ -0,0 +1,46 @@

[ ... ]

> +	cpus {
> +		cpu1: cpu@100 {
> +			device_type = "cpu";
> +			compatible = "arm,cortex-a55";
> +			reg = <0x100>;
> +			cpu-idle-states = <&cpu_sleep_0>;
> +			d-cache-line-size = <64>;
> +			d-cache-sets = <128>;
> +			d-cache-size = <32768>;
> +			enable-method = "psci";
> +			i-cache-line-size = <64>;
> +			i-cache-sets = <128>;
> +			i-cache-size = <32768>;
> +			next-level-cache = <&l2_1>;
> +
> +			l2_1: l2-cache {
> +				compatible = "cache";
> +				cache-level = <2>;
> +				cache-line-size = <64>;
> +				cache-sets = <256>;
> +				cache-size = <65536>;
> +				cache-unified;
> +				next-level-cache = <&l3>;
> +			};
> +		};
> +	};
> +
> +	pmu {
> +		interrupt-affinity = <&cpu0>,
> +				     <&cpu1>;
> +		interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>,
> +			     <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>;
> +	};

[Severity: Low]
Can sl2617.dtsi and sl2619.dtsi include sl2615.dtsi (or a shared
dual-core dtsi) and override only the root compatible property, the way
sl2613.dtsi includes sl2611.dtsi?

Right now the same cpu1, l2_1, and pmu definitions are duplicated
verbatim across sl2615.dtsi, sl2617.dtsi, and sl2619.dtsi.

> diff --git a/arch/arm64/boot/dts/synaptics/sl2619.dtsi b/arch/arm64/boot/dts/synaptics/sl2619.dtsi
> new file mode 100644
> index 0000000000000..6539c5a3dce04
> --- /dev/null
> +++ b/arch/arm64/boot/dts/synaptics/sl2619.dtsi
> @@ -0,0 +1,44 @@

[ ... ]

> +#include "sl2613.dtsi"
> +
> +/ {
> +	cpus {

[Severity: Low]
Is compatible = "syna,sl2619" missing from the root node here?

Because sl2619.dtsi includes sl2613.dtsi without overriding compatible,
it inherits "syna,sl2613" instead of "syna,sl2619", unlike sl2615.dtsi
and sl2617.dtsi.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204140732.31223-1-jszhang@kernel.org?part=12

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

* Re: [PATCH v4 13/13] arm64: dts: synaptics: add SL2610 family RDK boards
  2026-12-04 14:07 ` [PATCH v4 13/13] arm64: dts: synaptics: add SL2610 family RDK boards Jisheng Zhang
@ 2026-12-04 18:19   ` sashiko-bot
  0 siblings, 0 replies; 24+ messages in thread
From: sashiko-bot @ 2026-12-04 18:19 UTC (permalink / raw)
  To: Jisheng Zhang; +Cc: devicetree, linux-clk, linux-gpio, mfd, robh, conor+dt, lee

Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [Medium] arm64: dts: synaptics: sl261x-rdk omits reserved-memory for
  TrustZone RAM
- [Low] arm64: dts: synaptics: deprecated cpu0-supply used in
  sl261x-rdk-common.dtsi
- [Low] arm64: dts: synaptics: unused linux-event-codes.h include in
  sl261x-rdk-common.dtsi
--

commit e756e60b82640c39699865a0df9714da4784bfde
Author: Jisheng Zhang <jszhang@kernel.org>

arm64: dts: synaptics: add SL2610 family RDK boards

This commit adds devicetree files for the SL2611, SL2613, SL2615, SL2617
and SL2619 RDK boards along with a shared sl261x-rdk-common.dtsi describing
their common memory, console, pinctrl, regulator and peripheral setup.

> diff --git a/arch/arm64/boot/dts/synaptics/sl261x-rdk-common.dtsi b/arch/arm64/boot/dts/synaptics/sl261x-rdk-common.dtsi
> new file mode 100644
> index 0000000000000..bad11a9066ccb
> --- /dev/null
> +++ b/arch/arm64/boot/dts/synaptics/sl261x-rdk-common.dtsi
> @@ -0,0 +1,150 @@
> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> +/*
> + * Copyright (C) 2025 Synaptics Incorporated
> + *
> + * Author: Jisheng Zhang <jszhang@kernel.org>
> + */
> +
> +#include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/input/linux-event-codes.h>

[Severity: Low]
Is dt-bindings/input/linux-event-codes.h needed here?  Neither
sl261x-rdk-common.dtsi nor any of the board dts files that include it
defines input devices or uses symbols from this header.

[ ... ]

> +	cpus {
> +		cpu@0 {
> +			cpu0-supply = <&vcore>;
> +		};
> +	};

[Severity: Low]
Should this use cpu-supply instead of cpu0-supply?

Documentation/devicetree/bindings/arm/cpus.yaml marks cpu0-supply as
deprecated in favor of cpu-supply.  drivers/cpufreq/cpufreq-dt.c only
checks cpu0-supply on CPU 0 as a legacy fallback, and dual-core variants
(SL2615, SL2617, SL2619) define cpu1 where only cpu-supply is recognized.

> +
> +	memory@0 {
> +		device_type = "memory";
> +		reg = <0x0 0x00000000 0x0 0x80000000>;
> +	};

[Severity: Medium]
As reported by Richard GENOUD on v2 [1], should TrustZone secure RAM be
excluded here via a reserved-memory no-map node, or is the bootloader
expected to fix up memory@0 at runtime?

sl2611.dtsi declares an optee node (linaro,optee-tz), and existing
Synaptics boards like berlin4ct-dmp.dts statically exclude firmware memory.
If the bootloader passes this DTB without trimming memory@0 or adding a
reserved-memory no-map node, Linux can map secure RAM and abort at boot.

[1] https://lore.kernel.org/r/53f65c05-1c09-410d-8f49-9175f46a0609@bootlin.com

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204140732.31223-1-jszhang@kernel.org?part=13

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

end of thread, other threads:[~2026-12-04 18:19 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 14:07 [PATCH v4 00/13] arm64: add Synaptics SL2610 SoCs and RDK boards Jisheng Zhang
2026-12-04 14:07 ` [PATCH v4 01/13] arm64: kconfig: let ARCH_BERLIN cover Synaptics arm64 SoCs Jisheng Zhang
2026-12-04 14:07 ` [PATCH v4 02/13] pinctrl: berlin: use u16 instead of u8 for the offset Jisheng Zhang
2026-12-04 14:07 ` [PATCH v4 03/13] pinctrl: berlin: enable module build support Jisheng Zhang
2026-12-04 15:03   ` sashiko-bot
2026-12-04 14:07 ` [PATCH v4 04/13] pinctrl: berlin: add optional pinconf support Jisheng Zhang
2026-12-04 15:22   ` sashiko-bot
2026-12-04 14:07 ` [PATCH v4 05/13] dt-bindings: soc: synaptics: add SL2610 system controllers Jisheng Zhang
2026-12-04 15:41   ` sashiko-bot
2026-12-04 14:07 ` [PATCH v4 06/13] mfd: synaptics: add SL2610 system controller support Jisheng Zhang
2026-12-04 15:58   ` sashiko-bot
2026-12-04 14:07 ` [PATCH v4 07/13] reset: add Synaptics SL2610 reset " Jisheng Zhang
2026-12-04 16:24   ` sashiko-bot
2026-12-04 14:07 ` [PATCH v4 08/13] pinctrl: berlin: add Synaptics SL2610 pin " Jisheng Zhang
2026-12-04 16:51   ` sashiko-bot
2026-12-04 14:07 ` [PATCH v4 09/13] clk: berlin: add Synaptics clock controller helpers Jisheng Zhang
2026-12-04 17:13   ` sashiko-bot
2026-12-04 14:07 ` [PATCH v4 10/13] clk: berlin: add Synaptics SL2610 clocks and PLLs Jisheng Zhang
2026-12-04 17:39   ` sashiko-bot
2026-12-04 14:07 ` [PATCH v4 11/13] dt-bindings: arm: berlin: add Synaptics SL2610 SoCs and RDK boards Jisheng Zhang
2026-12-04 14:07 ` [PATCH v4 12/13] arm64: dts: synaptics: add SL2610 family SoCs Jisheng Zhang
2026-12-04 18:05   ` sashiko-bot
2026-12-04 14:07 ` [PATCH v4 13/13] arm64: dts: synaptics: add SL2610 family RDK boards Jisheng Zhang
2026-12-04 18:19   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox