Skip to contentSkip to conversation

arm64: add Synaptics SL2610 SoCs and RDK boards

PATCH New Jisheng Zhang 2 participants 24 messages Nov 15

Subsystems (7)
lore
Share & tools
lore

Jisheng Zhang

author maintainer
#0 lore raw

v2 cover arm64: add Synaptics SL2610 SoCs and RDK boards

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 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
soc: 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 +
 .../soc/synaptics/syna,sl2610-soc-syscon.yaml | 178 ++++
 MAINTAINERS                                   |   8 +
 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     | 457 +++++++++++
 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 | 135 ++++
 drivers/clk/Kconfig                           |   1 +
 drivers/clk/berlin/Kconfig                    |  34 +
 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/pinctrl/berlin/Kconfig                |  16 +
 drivers/pinctrl/berlin/Makefile               |   1 +
 drivers/pinctrl/berlin/berlin.c               | 259 +++++-
 drivers/pinctrl/berlin/berlin.h               |  17 +-
 drivers/pinctrl/berlin/pinctrl-sl2610.c       | 759 ++++++++++++++++++
 drivers/reset/Kconfig                         |  13 +
 drivers/reset/Makefile                        |   1 +
 drivers/reset/reset-sl2610.c                  | 224 ++++++
 drivers/soc/Kconfig                           |   1 +
 drivers/soc/Makefile                          |   1 +
 drivers/soc/synaptics/Kconfig                 |  14 +
 drivers/soc/synaptics/Makefile                |   2 +
 drivers/soc/synaptics/sl2610-syscon.c         |  84 ++
 include/dt-bindings/clock/syna,sl2610.h       | 131 +++
 include/dt-bindings/reset/syna,sl2610-reset.h |  80 ++
 41 files changed, 3771 insertions(+), 20 deletions(-)
 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/pinctrl/berlin/pinctrl-sl2610.c
 create mode 100644 drivers/reset/reset-sl2610.c
 create mode 100644 drivers/soc/synaptics/Kconfig
 create mode 100644 drivers/soc/synaptics/Makefile
 create mode 100644 drivers/soc/synaptics/sl2610-syscon.c
 create mode 100644 include/dt-bindings/clock/syna,sl2610.h
 create mode 100644 include/dt-bindings/reset/syna,sl2610-reset.h
Signature · 1 line
2.55.0
author maintainer
#1 lore raw

PATCH v2 1/13 arm64: kconfig: let ARCH_BERLIN cover Synaptics arm64 SoCs

Extend ARCH_BERLIN to cover Synaptics arm64 SoCs.

---
 arch/arm64/Kconfig.platforms | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/Kconfig.platforms +2 -2
index 49dcd7be82ce..b830161fe68b 100644
@@ -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"
Signature · 1 line
2.55.0
author maintainer
#2 lore raw

PATCH v2 2/13 pinctrl: berlin: use u16 instead of u8 for the offset

In reply to Jisheng Zhang

The u8 may not be enough for newer Synaptics SoCs.

---
 drivers/pinctrl/berlin/berlin.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/berlin/berlin.h +1 -1
index 231aab61d415..7e7096842eda 100644
@@ -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;
Signature · 1 line
2.55.0
author maintainer
#3 lore raw

PATCH v2 3/13 pinctrl: berlin: enable module build support

In reply to Jisheng Zhang

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

---
 drivers/pinctrl/berlin/berlin.c | 27 ++++++++++++++-------------
 drivers/pinctrl/berlin/berlin.h | 15 +++++++++++++++
 2 files changed, 29 insertions(+), 13 deletions(-)
drivers/pinctrl/berlin/berlin.c +14 -13
index 8a612ce2d1d3..a0ae75b1d705 100644
@@ -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 v2");
+MODULE_DESCRIPTION("pinctrl library for Synaptics SoCs");
drivers/pinctrl/berlin/berlin.h +15 -0
index 7e7096842eda..8ff70d682593 100644
@@ -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,						\
Signature · 1 line
2.55.0
#4 lore raw

Re: [PATCH v2 03/13] pinctrl: berlin: enable module build support

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] pinctrl: berlin: PINCTRL_BERLIN remains bool and built via obj-y --

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Medium] pinctrl: berlin: PINCTRL_BERLIN remains bool and built via obj-y
--

commit 74a8c9f28b8b05de9543f2486bac3805aa5dc526
Author: Jisheng Zhang <[email protected]>

pinctrl: berlin: enable module build support

This commit converts allocations in the Berlin pinctrl core to devm APIs, exports the probe helpers, and adds module metadata to support building the driver as a module.

Quoted 4 lines
drivers/pinctrl/berlin/berlin.c +0 -0
index 8a612ce2d1d36..a0ae75b1d705d 100644

[ ... ]

drivers/pinctrl/berlin/berlin.c int berlin_pinctrl_probe(struct platform_device *pdev, · line 343

Quoted 8 lines
drivers/pinctrl/berlin/berlin.c +4 -0
@@ -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 v2");
+MODULE_DESCRIPTION("pinctrl library for Synaptics SoCs");

[Severity: Medium]
Can berlin.c actually be built as a loadable module when drivers/pinctrl/berlin/Kconfig still defines the symbol as bool and drivers/pinctrl/berlin/Makefile builds berlin.o with obj-y?

drivers/pinctrl/berlin/Kconfig:
config PINCTRL_BERLIN
bool

drivers/pinctrl/berlin/Makefile:

	obj-y					+= berlin.o

Even when a downstream SoC pinctrl driver is configured as a module, selecting this symbol forces berlin.o into vmlinux instead of building a loadable module for vendor_dlkm.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
author maintainer
#5 lore raw

PATCH v2 4/13 pinctrl: berlin: add optional pinconf support

In reply to Jisheng Zhang

Add pin configuration support for newer Synaptics SoCs.

---
 drivers/pinctrl/berlin/Kconfig  |   1 +
 drivers/pinctrl/berlin/berlin.c | 234 +++++++++++++++++++++++++++++++-
 2 files changed, 230 insertions(+), 5 deletions(-)
drivers/pinctrl/berlin/Kconfig +1 -0
index 9b1644d1d4ea..abb1c912b9ba 100644
@@ -3,6 +3,7 @@ if (ARCH_BERLIN || COMPILE_TEST)
 
 config PINCTRL_BERLIN
 	bool
+	select GENERIC_PINCONF
 	select PINMUX
 	select REGMAP_MMIO
 
drivers/pinctrl/berlin/berlin.c +229 -5

295 lines not on this page · raw message

Signature · 1 line
2.55.0
#6 lore raw

Re: [PATCH v2 04/13] pinctrl: berlin: add optional pinconf support

Thank you for your contribution! Sashiko AI review found 4 potential issues to consider: - [Medium] pinctrl: berlin: memory leak on error in berlin_pinctrl_dt_node_to_map() - [Medium] pinctrl…

Thank you for your contribution! Sashiko AI review found 4 potential issues to consider:
- [Medium] pinctrl: berlin: memory leak on error in berlin_pinctrl_dt_node_to_map()
- [Medium] pinctrl: berlin: wrong errno -EOPNOTSUPP in berlin_pinconf_group_get()
- [Low] pinctrl: berlin: map over-allocation in berlin_pinctrl_dt_node_to_map()
- [Low] pinctrl: berlin: berlin_pinconf_group_get() fails when slew rate is 0
--

commit 8d9a060e7649872ae247085353d00ffa248ae051
Author: Jisheng Zhang <[email protected]>

pinctrl: berlin: add optional pinconf support

This commit adds generic pin configuration support (bias, drive strength, input enable, Schmitt trigger, and slew rate) to the Berlin pinctrl driver for 8-bit and 10-bit group configuration registers.

Quoted 4 lines
drivers/pinctrl/berlin/berlin.c +0 -0
index a0ae75b1d705d..0edf9d5a2a7b7 100644

[ ... ]

Quoted 5 lines
drivers/pinctrl/berlin/berlin.c +1 -0
@@ -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,

drivers/pinctrl/berlin/berlin.c static int berlin_pinctrl_dt_node_to_map(struct pinctrl_dev *pctrl_dev, · line 107

Quoted 10 lines
drivers/pinctrl/berlin/berlin.c +8 -1
+					      &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 *map when num_configs > 1? pinctrl_utils_add_map_configs() packs all num_configs entries for a group into a single PIN_MAP_TYPE_CONFIGS_GROUP map slot, so each group uses at most two map entries (ngroups * (!!num_configs + 1) in total), leaving ngroups * (num_configs - 1) reserved entries unused.

Quoted 20 lines
drivers/pinctrl/berlin/berlin.c +9 -2
 	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);

drivers/pinctrl/berlin/berlin.c static int berlin_pinctrl_dt_node_to_map(struct pinctrl_dev *pctrl_dev, · line 135

Quoted 10 lines
drivers/pinctrl/berlin/berlin.c +5 -1
+			if (ret < 0)
+				goto exit;
 		}
 	}
 
-	return 0;
+exit:
+	kfree(configs);
+	return ret;
 }

[Severity: Medium]
Does the error path leak *map and any per-group config arrays already duplicated by pinctrl_utils_add_map_configs()?

When ops->dt_node_to_map() returns a negative error code, the caller dt_to_map_one_config() in drivers/pinctrl/devicetree.c returns immediately without freeing the partially constructed map. If pinctrl_utils_add_map_mux() or pinctrl_utils_add_map_configs() fails in the loop after pinctrl_utils_reserve_map() allocated *map, jumping to exit only frees the temporary configs array and leaks *map along with any configs duplicated for earlier groups. Calling pinctrl_utils_free_map(pctrl_dev, *map, *num_maps) when ret < 0 would clean these up.

Quoted 17 lines
drivers/pinctrl/berlin/berlin.c +13 -0
@@ -177,6 +216,190 @@ 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;

[ ... ]

Quoted 4 lines
drivers/pinctrl/berlin/berlin.c +4 -0
+	case PIN_CONFIG_SLEW_RATE:
+		if (conf_bits == 10)
+			enabled = val & PINCFG_SL_10BIT;
+		else

drivers/pinctrl/berlin/berlin.c static const struct pinmux_ops berlin_pinmux_ops = { · line 296

Quoted 10 lines
drivers/pinctrl/berlin/berlin.c +10 -0
+			enabled = val & PINCFG_SL_8BIT;
+		val = enabled ? 1 : 0;
+		break;
+	default:
+		return -EOPNOTSUPP;
+	}
+
+	*configs = pinconf_to_config_packed(param, val);
+	return enabled ? 0 : -EINVAL;
+}

[Severity: Low]
Does querying PIN_CONFIG_SLEW_RATE fail with -EINVAL whenever the slew rate bit is 0?

berlin_pinconf_group_set() accepts 0 as a valid slew-rate argument to clear PINCFG_SL_10BIT or PINCFG_SL_8BIT, but berlin_pinconf_group_get() sets enabled from that bit and returns -EINVAL when enabled is false, so a slew rate of 0 cannot be read back (for example via debugfs pinconf-groups). Setting enabled = true as in the PIN_CONFIG_DRIVE_STRENGTH case would allow both 0 and 1 to be reported.

Quoted 13 lines
drivers/pinctrl/berlin/berlin.c +13 -0
+
+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;

[ ... ]

drivers/pinctrl/berlin/berlin.c static const struct pinmux_ops berlin_pinmux_ops = { · line 296

Quoted 4 lines
drivers/pinctrl/berlin/berlin.c +4 -0
+		default:
+			return -EOPNOTSUPP;
+		}
+	}

[Severity: Medium]
Should berlin_pinconf_group_get() and berlin_pinconf_group_set() return -ENOTSUPP instead of -EOPNOTSUPP when !conf_bits or when param is not supported?

With .is_generic = true, reading debugfs pinconf-groups calls pinconf_generic_dump_one(), which queries every generic parameter in conf_items[] and only treats -EINVAL and -ENOTSUPP as legal responses:

drivers/pinctrl/pinconf-generic.c:pinconf_generic_dump_one() {
	...
		ret = pin_config_group_get(dev_name(pctldev->dev),
					   pindesc->name, &config);
		/* These are legal errors */
		if (ret == -EINVAL || ret == -ENOTSUPP)
			continue;
		if (ret) {
			seq_printf(s, "ERROR READING CONFIG SETTING %d ", i);
			continue;
		}
	...
}

Returning -EOPNOTSUPP causes debugfs pinconf-groups to print "ERROR READING CONFIG SETTING" for every unsupported parameter and for any group with conf_bits == 0.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
author maintainer
#7 lore raw

PATCH v2 5/13 dt-bindings: soc: synaptics: add SL2610 system controllers

In reply to Jisheng Zhang

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.

---
 .../soc/synaptics/syna,sl2610-soc-syscon.yaml | 178 ++++++++++++++++++
 MAINTAINERS                                   |   3 +
 include/dt-bindings/clock/syna,sl2610.h       | 131 +++++++++++++
 include/dt-bindings/reset/syna,sl2610-reset.h |  80 ++++++++
 4 files changed, 392 insertions(+)
 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
Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-soc-syscon.yaml new file +178 -0
new file mode 100644
index 000000000000..cdf947cb3e0f
@@ -0,0 +1,178 @@
+# 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 system control registers
+
+maintainers:
+  - Jisheng Zhang <[email protected]>
+
+description: |
+  The SL2610 family has separate SoC, MCU, AVIO, and CPU system control
+  register blocks. The SoC and MCU blocks provide clocks, resets, and pin
+  control. The CPU block provides clocks. The AVIO block contains audio PLLs.
+
+  Clock and reset specifiers refer directly to the system control node.
+  Pin group configurations are direct children of the SoC or MCU node.
+  There are no separate clock, reset, or pin controller child nodes.
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - syna,sl2610-soc-syscon
+          - syna,sl2610-mcu-syscon
+          - syna,sl2610-avio-syscon
+          - syna,sl2610-cpu-syscon
+      - const: syscon
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+    description: External reference clock input.
+
+  '#clock-cells':
+    const: 1
+
+  '#reset-cells':
+    const: 1
+
+  syna,gbl-syscon:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: Phandle to the SoC system control registers for CPU PLL bypass.
+
+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 pull-up bias and select its strength. A value of 0 selects
+          normal pull-up and 1 selects strong pull-up. The boolean form is
+          equivalent to 1 and selects strong pull-up. Use bias-disable to
+          disable pull bias. Values are mode selectors, not resistance in Ohms.
+        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
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - syna,sl2610-soc-syscon
+              - syna,sl2610-mcu-syscon
+    then:
+      required:
+        - '#clock-cells'
+        - '#reset-cells'
+    else:
+      properties:
+        '#reset-cells': false
+      patternProperties:
+        '-(pmux|pins)$': false
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: syna,sl2610-cpu-syscon
+    then:
+      required:
+        - '#clock-cells'
+        - syna,gbl-syscon
+    else:
+      properties:
+        syna,gbl-syscon: false
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: syna,sl2610-avio-syscon
+    then:
+      properties:
+        '#clock-cells': false
+
+additionalProperties: false
+
+examples:
+  - |
+    soc_syscon: syscon@f7e10000 {
+        compatible = "syna,sl2610-soc-syscon", "syscon";
+        reg = <0xf7e10000 0x10000>;
+        clocks = <&osc>;
+        #clock-cells = <1>;
+        #reset-cells = <1>;
+
+        i2c2-pmux {
+            groups = "GPIO23", "GPIO24";
+            function = "tw2";
+            bias-pull-up = <0>;
+        };
+
+        i2c3-pmux {
+            groups = "GPIO27", "GPIO28";
+            function = "tw3";
+            bias-pull-up;
+        };
+    };
+
+    syscon@e5025000 {
+        compatible = "syna,sl2610-mcu-syscon", "syscon";
+        reg = <0xe5025000 0x1000>;
+        clocks = <&osc>;
+        #clock-cells = <1>;
+        #reset-cells = <1>;
+
+        i2c0-pmux {
+            groups = "SM_GPIO12", "SM_GPIO13";
+            function = "tw0";
+        };
+    };
+
+    syscon@f7e30000 {
+        compatible = "syna,sl2610-cpu-syscon", "syscon";
+        reg = <0xf7e30000 0x4000>;
+        clocks = <&osc>;
+        #clock-cells = <1>;
+        syna,gbl-syscon = <&soc_syscon>;
+    };
+
+    syscon@f7490000 {
+        compatible = "syna,sl2610-avio-syscon", "syscon";
+        reg = <0xf7490000 0x4000>;
+        clocks = <&osc>;
+    };
+...
MAINTAINERS +3 -0
index 222b7fc2c3aa..e7c061ae5a87 100644
@@ -3808,9 +3808,12 @@ M:	Jisheng Zhang <[email protected]>
 M:	Sebastian Hesselbarth <[email protected]>
 L:	[email protected] (moderated for non-subscribers)
 S:	Maintained
+F:	Documentation/devicetree/bindings/soc/synaptics/
 F:	arch/arm/boot/dts/synaptics/
 F:	arch/arm/mach-berlin/
 F:	arch/arm64/boot/dts/synaptics/
+F:	include/dt-bindings/clock/syna,sl2610.h
+F:	include/dt-bindings/reset/syna,sl2610-reset.h
 
 ARM/TEGRA HDMI CEC SUBSYSTEM SUPPORT
 M:	Hans Verkuil <[email protected]>
include/dt-bindings/clock/syna,sl2610.h new file +131 -0

131 lines not on this page · raw message

include/dt-bindings/reset/syna,sl2610-reset.h new file +80 -0

80 lines not on this page · raw message

Signature · 1 line
2.55.0
#8 lore raw

Re: [PATCH v2 05/13] dt-bindings: soc: synaptics: add SL2610 system controllers

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] dt-bindings: soc: synaptics: split dissimilar SL2610 syscon blocks into separate schemas --

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Low] dt-bindings: soc: synaptics: split dissimilar SL2610 syscon blocks into separate schemas
--

commit bc8ce74277532ebd4eaa1fb7ce6d4be07d8dfe52
Author: Jisheng Zhang <[email protected]>

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

This commit adds a Device Tree binding schema and clock/reset header definitions for the Synaptics SL2610 SoC, MCU, AVIO, and CPU system control register blocks.

Quoted 6 lines
Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-soc-syscon.yaml new file +0 -0
new file mode 100644
index 0000000000000..cdf947cb3e0f6
@@ -0,0 +1,178 @@

[ ... ]

Quoted 9 lines
Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-soc-syscon.yaml new file +9 -0
+properties:
+  compatible:
+    items:
+      - enum:
+          - syna,sl2610-soc-syscon
+          - syna,sl2610-mcu-syscon
+          - syna,sl2610-avio-syscon
+          - syna,sl2610-cpu-syscon
+      - const: syscon

[ ... ]

Quoted 29 lines
Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-soc-syscon.yaml new file +29 -0
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - syna,sl2610-soc-syscon
+              - syna,sl2610-mcu-syscon
+    then:
+      required:
+        - '#clock-cells'
+        - '#reset-cells'
+    else:
+      properties:
+        '#reset-cells': false
+      patternProperties:
+        '-(pmux|pins)$': false
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: syna,sl2610-cpu-syscon
+    then:
+      required:
+        - '#clock-cells'
+        - syna,gbl-syscon
+    else:
+      properties:

Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-soc-syscon.yaml line 126

Quoted 10 lines
Documentation/devicetree/bindings/soc/synaptics/syna,sl2610-soc-syscon.yaml new file +10 -0
+        syna,gbl-syscon: false
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: syna,sl2610-avio-syscon
+    then:
+      properties:
+        '#clock-cells': false

[Severity: Low]
Should these dissimilar system controller blocks be split into separate binding schemas instead of combining them with three per-compatible if-then-else blocks in allOf?

Only the SoC and MCU blocks provide resets and pin mux subnodes, only the CPU block uses syna,gbl-syscon, and the AVIO block exposes none of these providers. Splitting the schema by block role would avoid toggling most properties and patternProperties per compatible.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
author maintainer
#9 lore raw

PATCH v2 6/13 soc: synaptics: add SL2610 system controller support

In reply to Jisheng Zhang

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.

---
 MAINTAINERS                           |  1 +
 drivers/soc/Kconfig                   |  1 +
 drivers/soc/Makefile                  |  1 +
 drivers/soc/synaptics/Kconfig         | 14 +++++
 drivers/soc/synaptics/Makefile        |  2 +
 drivers/soc/synaptics/sl2610-syscon.c | 84 +++++++++++++++++++++++++++
 6 files changed, 103 insertions(+)
 create mode 100644 drivers/soc/synaptics/Kconfig
 create mode 100644 drivers/soc/synaptics/Makefile
 create mode 100644 drivers/soc/synaptics/sl2610-syscon.c
MAINTAINERS +1 -0
index e7c061ae5a87..eae1493485ee 100644
@@ -3812,6 +3812,7 @@ F:	Documentation/devicetree/bindings/soc/synaptics/
 F:	arch/arm/boot/dts/synaptics/
 F:	arch/arm/mach-berlin/
 F:	arch/arm64/boot/dts/synaptics/
+F:	drivers/soc/synaptics/
 F:	include/dt-bindings/clock/syna,sl2610.h
 F:	include/dt-bindings/reset/syna,sl2610-reset.h
 
drivers/soc/Kconfig +1 -0
index 483cbdcae153..5fe7348cddab 100644
@@ -27,6 +27,7 @@ source "drivers/soc/sophgo/Kconfig"
 source "drivers/soc/st/Kconfig"
 source "drivers/soc/starfive/Kconfig"
 source "drivers/soc/sunxi/Kconfig"
+source "drivers/soc/synaptics/Kconfig"
 source "drivers/soc/tegra/Kconfig"
 source "drivers/soc/ti/Kconfig"
 source "drivers/soc/ux500/Kconfig"
drivers/soc/Makefile +1 -0
index 5a3efd68355c..3e51563b914c 100644
@@ -33,6 +33,7 @@ obj-y				+= sophgo/
 obj-y				+= st/
 obj-y				+= starfive/
 obj-y				+= sunxi/
+obj-y				+= synaptics/
 obj-$(CONFIG_ARCH_TEGRA)	+= tegra/
 obj-y				+= ti/
 obj-$(CONFIG_ARCH_U8500)	+= ux500/
drivers/soc/synaptics/Kconfig new file +14 -0
new file mode 100644
index 000000000000..9f0324a1a3b7
@@ -0,0 +1,14 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+config SOC_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.
drivers/soc/synaptics/Makefile new file +2 -0
new file mode 100644
index 000000000000..13710fc58903
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0-only
+obj-$(CONFIG_SOC_SL2610_SYSCON) += sl2610-syscon.o
drivers/soc/synaptics/sl2610-syscon.c new file +84 -0

84 lines not on this page · raw message

Signature · 1 line
2.55.0
#10 lore raw

Re: [PATCH v2 06/13] soc: synaptics: add SL2610 system controller support

Thank you for your contribution! Sashiko AI review found 3 potential issues to consider: - [Low] soc: synaptics: new MFD driver sl2610-syscon placed outside drivers/mfd - [Low] soc: synaptics: MFD…

Thank you for your contribution! Sashiko AI review found 3 potential issues to consider:
- [Low] soc: synaptics: new MFD driver sl2610-syscon placed outside drivers/mfd
- [Low] soc: synaptics: MFD used for single-function AVIO and CPU clock blocks
- [Low] soc: synaptics: mfd_cell arrays passed via match data in sl2610_syscon_probe()
--

commit 13fffaa081530baa348dec7822fd2e447d70af16
Author: Jisheng Zhang <[email protected]>

soc: synaptics: add SL2610 system controller support

This commit adds a driver for the Synaptics SL2610 system control blocks to register their clock, reset, and pin controller child devices via MFD.

Quoted 6 lines
drivers/soc/synaptics/Kconfig new file +0 -0
new file mode 100644
index 0000000000000..9f0324a1a3b7a

drivers/soc/synaptics/Kconfig line 8

Quoted 8 lines
drivers/soc/synaptics/Kconfig new file +8 -0
@@ -0,0 +1,14 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+config SOC_SL2610_SYSCON
+	tristate "Synaptics SL2610 system controller"
+	depends on ARCH_BERLIN || COMPILE_TEST
+	depends on OF && HAS_IOMEM
+	select MFD_CORE
+	select MFD_SYSCON

[Severity: Low]
Should this driver live under drivers/mfd/ instead of drivers/soc/synaptics/?

sl2610-syscon.c does not implement any SoC bus or SoC-specific service and only calls devm_mfd_add_devices() to instantiate MFD child devices. New core MFD drivers and new calls to devm_mfd_add_devices() belong in drivers/mfd/.

Quoted 30 lines
drivers/soc/synaptics/sl2610-syscon.c new file +24 -0
new file mode 100644
index 0000000000000..c6fc2955ac0de
@@ -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"),

drivers/soc/synaptics/sl2610-syscon.c line 34

Quoted 10 lines
drivers/soc/synaptics/sl2610-syscon.c new file +10 -0
+	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"),
+};

[Severity: Low]
Why use MFD for the single-function AVIO and CPU clock blocks?

sl2610_avio_cells and sl2610_cpu_cells each register only a single clock child device, and per the syna,sl2610-soc-syscon binding neither block provides reset or pinctrl functions. MFD is intended for devices that register multiple children across different subsystems, whereas the clock driver can bind directly to syna,sl2610-avio-syscon and syna,sl2610-cpu-syscon while keeping shared regmap access through the generic syscon compatible.

Quoted 26 lines
drivers/soc/synaptics/sl2610-syscon.c new file +26 -0
+
+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,

drivers/soc/synaptics/sl2610-syscon.c line 70

Quoted 10 lines
drivers/soc/synaptics/sl2610-syscon.c new file +10 -0
+				    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 },
+	{ }
+};

[Severity: Low]
This isn't a bug in normal DT probing, but MFD drivers should not pass mfd_cell arrays through the .data field of of_device_id tables. In addition, if the driver is bound without an OF match (such as via sysfs driver_override), device_get_match_data() returns NULL and sl2610_syscon_probe() dereferences a NULL data pointer.

Could sl2610_syscon_of_match store an enum or integer ID in .data and select the static const mfd_cell array with a switch statement (and a default error return) in sl2610_syscon_probe()?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=6
author maintainer
#11 lore raw

PATCH v2 7/13 reset: add Synaptics SL2610 reset controller support

In reply to Jisheng Zhang

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.

---
 MAINTAINERS                  |   1 +
 drivers/reset/Kconfig        |  13 ++
 drivers/reset/Makefile       |   1 +
 drivers/reset/reset-sl2610.c | 224 +++++++++++++++++++++++++++++++++++
 4 files changed, 239 insertions(+)
 create mode 100644 drivers/reset/reset-sl2610.c
MAINTAINERS +1 -0
index eae1493485ee..1bd3b2f39865 100644
@@ -3812,6 +3812,7 @@ F:	Documentation/devicetree/bindings/soc/synaptics/
 F:	arch/arm/boot/dts/synaptics/
 F:	arch/arm/mach-berlin/
 F:	arch/arm64/boot/dts/synaptics/
+F:	drivers/reset/reset-sl2610.c
 F:	drivers/soc/synaptics/
 F:	include/dt-bindings/clock/syna,sl2610.h
 F:	include/dt-bindings/reset/syna,sl2610-reset.h
drivers/reset/Kconfig +13 -0
index eda9c698a95f..98e973a8798c 100644
@@ -358,6 +358,19 @@ 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
+	select SOC_SL2610_SYSCON
+	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
drivers/reset/Makefile +1 -0
index 489fafd6bbe3..d28276a4f2ea 100644
@@ -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
drivers/reset/reset-sl2610.c new file +224 -0

224 lines not on this page · raw message

Signature · 1 line
2.55.0
#12 lore raw

Re: [PATCH v2 07/13] reset: add Synaptics SL2610 reset controller support

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] reset: sl2610: wrong errno in sl2610_reset_assert() and deassert() --

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Medium] reset: sl2610: wrong errno in sl2610_reset_assert() and deassert()
--

commit fd9868407ed20a422bf28d62579da17aa23dc9fc
Author: Jisheng Zhang <[email protected]>

reset: add Synaptics SL2610 reset controller support

This commit adds a reset controller driver for the SoC and MCU system control blocks on Synaptics SL2610 SoCs, supporting both pulse and sticky reset lines.

Quoted 5 lines
drivers/reset/reset-sl2610.c new file +0 -0
new file mode 100644
index 0000000000000..1ca58d5a3e713

[ ... ]

Quoted 13 lines
drivers/reset/reset-sl2610.c new file +13 -0
+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 -EINVAL;
+
+	return regmap_clear_bits(priv->regmap, cfg->reg, cfg->bit);
+}
+
+static int sl2610_reset_deassert(struct reset_controller_dev *rcdev,

drivers/reset/reset-sl2610.c line 157

Quoted 10 lines
drivers/reset/reset-sl2610.c new file +10 -0
+				 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 -EINVAL;
+
+	return regmap_set_bits(priv->regmap, cfg->reg, cfg->bit);
+}

[Severity: Medium]
Should sl2610_reset_assert() and sl2610_reset_deassert() return -ENOTSUPP (or 0 in sl2610_reset_deassert()) instead of -EINVAL when !cfg->sticky?

In drivers/reset/core.c, reset_control_deassert() treats self-deasserting pulse reset lines as deasserted by default when .deassert() is not implemented, and documents that .deassert() should return -ENOTSUPP when deassertion cannot be guaranteed:

drivers/reset/core.c:reset_control_deassert() {
	...
	/*
	 * If the reset controller does not implement .deassert(), we assume
	 * that it handles self-deasserting reset lines via .reset(). In that
	 * case, the reset lines are deasserted by default. If that is not the
	 * case, the reset controller driver should implement .deassert() and
	 * return -ENOTSUPP.
	 */
	if (!rcdev->ops->deassert)
		return 0;
	...
}

Because this controller implements .assert() and .deassert() for its sticky lines, returning -EINVAL for the 22 pulse reset lines in sl2610_reset_cfgs[] causes consumer drivers that call reset_control_deassert() during probe (such as 8250_dw) to fail probe, and prevents consumers such as stmmac_dvr_probe() from checking for -ENOTSUPP on reset_control_assert() and falling back to reset_control_reset().

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=7
author maintainer
#13 lore raw

PATCH v2 8/13 pinctrl: berlin: add Synaptics SL2610 pin controller support

In reply to Jisheng Zhang

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.

---
 MAINTAINERS                             |   1 +
 drivers/pinctrl/berlin/Kconfig          |  15 +
 drivers/pinctrl/berlin/Makefile         |   1 +
 drivers/pinctrl/berlin/pinctrl-sl2610.c | 759 ++++++++++++++++++++++++
 4 files changed, 776 insertions(+)
 create mode 100644 drivers/pinctrl/berlin/pinctrl-sl2610.c
MAINTAINERS +1 -0
index 1bd3b2f39865..b5bc76062771 100644
@@ -3812,6 +3812,7 @@ F:	Documentation/devicetree/bindings/soc/synaptics/
 F:	arch/arm/boot/dts/synaptics/
 F:	arch/arm/mach-berlin/
 F:	arch/arm64/boot/dts/synaptics/
+F:	drivers/pinctrl/berlin/pinctrl-sl2610.c
 F:	drivers/reset/reset-sl2610.c
 F:	drivers/soc/synaptics/
 F:	include/dt-bindings/clock/syna,sl2610.h
drivers/pinctrl/berlin/Kconfig +15 -0
index abb1c912b9ba..79541a4a81aa 100644
@@ -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 OF && HAS_IOMEM
+	select SOC_SL2610_SYSCON
+	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
drivers/pinctrl/berlin/Makefile +1 -0
index 7b4aa5444a4a..448965293e6a 100644
@@ -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
drivers/pinctrl/berlin/pinctrl-sl2610.c new file +759 -0

759 lines not on this page · raw message

Signature · 1 line
2.55.0
#14 lore raw

Re: [PATCH v2 08/13] pinctrl: berlin: add Synaptics SL2610 pin controller support

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] pinctrl: berlin: wrong pad config offset 0x87c for GPIO54 on SL2610 --

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Medium] pinctrl: berlin: wrong pad config offset 0x87c for GPIO54 on SL2610
--

commit b2ae5372019c8928361d53ac7a361789c010c9c3
Author: Jisheng Zhang <[email protected]>

pinctrl: berlin: add Synaptics SL2610 pin controller support

This commit adds the pin controller driver for Synaptics SL2610 SoCs, defining the SoC and MCU pin groups, mux functions, and pad configuration register offsets.

Quoted 6 lines
drivers/pinctrl/berlin/pinctrl-sl2610.c new file +0 -0
new file mode 100644
index 0000000000000..0a3dc146c2c01
@@ -0,0 +1,759 @@

[ ... ]

Quoted 1 line

+static const struct berlin_desc_group sl2610_soc_pinctrl_groups[] = {

[ ... ]

Quoted 7 lines
drivers/pinctrl/berlin/pinctrl-sl2610.c new file +7 -0
+	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,

drivers/pinctrl/berlin/pinctrl-sl2610.c line 256

Quoted 10 lines
drivers/pinctrl/berlin/pinctrl-sl2610.c new file +10 -0
+			0x87c, 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 */

[Severity: Medium]
Should the pad configuration offset for GPIO54 be 0x887c instead of 0x87c? All other entries in sl2610_soc_pinctrl_groups place conf_offset at 4-byte intervals in the 0x8800..0x88ec range, so configuring pad parameters for GPIO54 will read and modify offset 0x87c in the parent syscon regmap while leaving GPIO54's pad unconfigured.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=8
author maintainer
#15 lore raw

PATCH v2 9/13 clk: berlin: add Synaptics clock controller helpers

In reply to Jisheng Zhang

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.

---
 MAINTAINERS                        |   1 +
 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 +++++
 8 files changed, 606 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
MAINTAINERS +1 -0
index b5bc76062771..f3067f71d54c 100644
@@ -3812,6 +3812,7 @@ F:	Documentation/devicetree/bindings/soc/synaptics/
 F:	arch/arm/boot/dts/synaptics/
 F:	arch/arm/mach-berlin/
 F:	arch/arm64/boot/dts/synaptics/
+F:	drivers/clk/berlin/sl-*
 F:	drivers/pinctrl/berlin/pinctrl-sl2610.c
 F:	drivers/reset/reset-sl2610.c
 F:	drivers/soc/synaptics/
drivers/clk/Kconfig +1 -0
index 37a8e35d4178..906fabfe0d33 100644
@@ -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"
drivers/clk/berlin/Kconfig new file +7 -0
new file mode 100644
index 000000000000..8f71d4c7a478
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0
+
+config SL_COMMON_CLK
+	bool
+
+config SL_SYSMGR_CLK
+	bool
drivers/clk/berlin/Makefile +2 -0
index 3733733a4806..5dbd0fd264ad 100644
@@ -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
drivers/clk/berlin/sl-clk.c new file +279 -0

279 lines not on this page · raw message

drivers/clk/berlin/sl-clk.h new file +31 -0
new file mode 100644
index 000000000000..7489b26a5e8d
@@ -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 */
drivers/clk/berlin/sl-sysmgr-clk.c new file +241 -0

241 lines not on this page · raw message

drivers/clk/berlin/sl-sysmgr-clk.h new file +44 -0

44 lines not on this page · raw message

Signature · 1 line
2.55.0
#16 lore raw

Re: [PATCH v2 09/13] clk: berlin: add Synaptics clock controller helpers

Thank you for your contribution! Sashiko AI review found 5 potential issues to consider: - [High] clk: berlin: non-irqsave spinlock in sl_sysmgr_gateclk_ops - [Medium] clk: berlin: uninitialized…

Thank you for your contribution! Sashiko AI review found 5 potential issues to consider:
- [High] clk: berlin: non-irqsave spinlock in sl_sysmgr_gateclk_ops
- [Medium] clk: berlin: uninitialized clk_init_data in sl-sysmgr-clk.c
- [Medium] clk: berlin: sl_sysmgr_clk_setup() ignores descriptor flags
- [Medium] clk: berlin: missing .disable callbacks and duplicated gate clock in sl-sysmgr-clk
- [Low] clk: berlin: non-self-contained header sl-sysmgr-clk.h and unused macros
--

commit a40ea8003017371f6f9b098c53eae5c758e872e4
Author: Jisheng Zhang <[email protected]>

clk: berlin: add Synaptics clock controller helpers

This commit adds configurable divider and gate clock helpers for Synaptics system controllers along with an MCU system manager clock setup helper.

Quoted 6 lines
drivers/clk/berlin/sl-sysmgr-clk.c new file +0 -0
new file mode 100644
index 0000000000000..f3cf921fc3c1a
@@ -0,0 +1,241 @@

[ ... ]

Quoted 7 lines
drivers/clk/berlin/sl-sysmgr-clk.c new file +7 -0
+#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)

[ ... ]

Quoted 18 lines
drivers/clk/berlin/sl-sysmgr-clk.c new file +18 -0
+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)
+{

drivers/clk/berlin/sl-sysmgr-clk.c line 71

Quoted 10 lines
drivers/clk/berlin/sl-sysmgr-clk.c new file +10 -0
+	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 taking sl_sysmgr_gateclk_lock with guard(spinlock) instead of spinlock_irqsave deadlock?

clk_core_is_enabled() calls .is_enabled from process context without holding enable_lock and with local interrupts enabled (for example via clk_summary_show_one() or __clk_is_enabled()), while clk_enable() can be called from hardirq context:

clk_summary_show_one()
...
sl_sysmgr_gateclk_is_enabled()
spin_lock(&sl_sysmgr_gateclk_lock)
<hardirq>
clk_enable()
...
sl_sysmgr_gateclk_enable()
spin_lock(&sl_sysmgr_gateclk_lock) <-- spins forever

sl_sysmgr_gateclk_enable() needs guard(spinlock_irqsave), while sl_sysmgr_gateclk_is_enabled() only performs a single readl_relaxed() and does not need the lock.

Quoted 17 lines
drivers/clk/berlin/sl-sysmgr-clk.c new file +17 -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;

[ ... ]

drivers/clk/berlin/sl-sysmgr-clk.c line 140

Quoted 5 lines
drivers/clk/berlin/sl-sysmgr-clk.c new file +5 -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,
+};

[Severity: Medium]
Should sl_sysmgr_gateclk_ops and sl_sysmgr_clk_ops implement .disable callbacks?

Without .disable, consumer calls to clk_disable() and late boot's clk_disable_unused() cannot gate these clocks in hardware, and clk_is_enabled_when_prepared() treats them as enabled by .prepare even though .prepare is not implemented. In addition, struct sl_sysmgr_gateclk and struct sl_sysmgr_gateclk_desc duplicate devm_clk_hw_register_gate() and struct sl_gateclk_desc in drivers/clk/berlin/sl-clk.h.

drivers/clk/berlin/sl-sysmgr-clk.c line 153

Quoted 12 lines
drivers/clk/berlin/sl-sysmgr-clk.c new file +12 -0
+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;

[Severity: Medium]
Does leaving struct clk_init_data init uninitialized on the stack in sl_sysmgr_gateclk_register() and sl_sysmgr_clk_register() pass garbage init.parent_data and init.parent_hws pointers into devm_clk_hw_register()?

clk_core_populate_parent_map() reads init->parent_hws and init->parent_data unconditionally when registering the clock.

[ ... ]

Quoted 7 lines
drivers/clk/berlin/sl-sysmgr-clk.c new file +7 -0
+	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;
+

drivers/clk/berlin/sl-sysmgr-clk.c line 227

Quoted 10 lines
drivers/clk/berlin/sl-sysmgr-clk.c new file +10 -0
+		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;

[Severity: Medium]
Does sl_sysmgr_clk_setup() drop the flags field from gdescs[i] and descs[i]?

struct sl_sysmgr_gateclk_desc and struct sl_sysmgr_clk_desc both define an unsigned long flags member, but sl_sysmgr_clk_setup() never passes them to sl_sysmgr_gateclk_register() or sl_sysmgr_clk_register(), which hardcode init.flags = 0 and ignore flags such as CLK_IS_CRITICAL or CLK_IGNORE_UNUSED.

[ ... ]

Quoted 6 lines
drivers/clk/berlin/sl-sysmgr-clk.h new file +0 -0
new file mode 100644
index 0000000000000..5ccf388bcccbd
@@ -0,0 +1,44 @@

[ ... ]

Quoted 11 lines
drivers/clk/berlin/sl-sysmgr-clk.h new file +11 -0
+#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;
+};

[ ... ]

drivers/clk/berlin/sl-sysmgr-clk.h line 44

Quoted 10 lines
drivers/clk/berlin/sl-sysmgr-clk.h new file +10 -0
+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

[Severity: Low]
Does sl-sysmgr-clk.h need #include <linux/types.h> and a forward declaration of struct platform_device so it is self-contained when included before other headers? Also, <linux/version.h> and DIV_CHNG_EN in sl-sysmgr-clk.c are unused, and sl-clk.h uses u32 and u8 without directly including <linux/types.h>.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=9
author maintainer
#17 lore raw

PATCH v2 10/13 clk: berlin: add Synaptics SL2610 clocks and PLLs

In reply to Jisheng Zhang

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.

---
 MAINTAINERS                     |   1 +
 drivers/clk/berlin/Kconfig      |  27 +++
 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 ++
 6 files changed, 549 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
MAINTAINERS +1 -0
index f3067f71d54c..430758242906 100644
@@ -3812,6 +3812,7 @@ F:	Documentation/devicetree/bindings/soc/synaptics/
 F:	arch/arm/boot/dts/synaptics/
 F:	arch/arm/mach-berlin/
 F:	arch/arm64/boot/dts/synaptics/
+F:	drivers/clk/berlin/*sl2610*
 F:	drivers/clk/berlin/sl-*
 F:	drivers/pinctrl/berlin/pinctrl-sl2610.c
 F:	drivers/reset/reset-sl2610.c
drivers/clk/berlin/Kconfig +27 -0
index 8f71d4c7a478..be7e47e0ff52 100644
@@ -5,3 +5,30 @@ 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
+	select SOC_SL2610_SYSCON
+	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.
drivers/clk/berlin/Makefile +2 -0
index 5dbd0fd264ad..ec87dbed7dd4 100644
@@ -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
drivers/clk/berlin/clk-sl2610.c new file +360 -0

360 lines not on this page · raw message

drivers/clk/berlin/sl2610-pll.c new file +145 -0

145 lines not on this page · raw message

drivers/clk/berlin/sl2610-pll.h new file +14 -0
new file mode 100644
index 000000000000..b61a93b28610
@@ -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 */
Signature · 1 line
2.55.0
#18 lore raw

Re: [PATCH v2 10/13] clk: berlin: add Synaptics SL2610 clocks and PLLs

Thank you for your contribution! Sashiko AI review found 5 potential issues to consider: - [Medium] clk: berlin: dereference of dev before NULL check in sl2610_pll_register() - [Medium] clk: berlin…

Thank you for your contribution! Sashiko AI review found 5 potential issues to consider:
- [Medium] clk: berlin: dereference of dev before NULL check in sl2610_pll_register()
- [Medium] clk: berlin: irq lock inversion on sl_sysmgr_gateclk_lock via sl2610_sysmgr_clk_setup()
- [Low] clk: berlin: fix apbuart3clk and apbi2c1clk typos in sl2610_gates
- [Low] clk: berlin: missing OF and HAS_IOMEM dependencies on SL2610_PLL
- [Low] clk: berlin: unused SL2610_APLL macro and struct forward declarations
--

commit 9456f61cc7fffcd42790e27e9671ad341c8cf8cd
Author: Jisheng Zhang <[email protected]>

clk: berlin: add Synaptics SL2610 clocks and PLLs

This commit adds clock and PLL drivers for the Synaptics SL2610 SoC, registering the SoC, CPU, AVIO, and MCU clocks.

Quoted 14 lines
drivers/clk/berlin/Kconfig +6 -0
index 8f71d4c7a478b..be7e47e0ff523 100644
@@ -5,3 +5,30 @@ 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

drivers/clk/berlin/Kconfig config SL_COMMON_CLK · line 23

Quoted 10 lines
drivers/clk/berlin/Kconfig +10 -0
+	  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]
Should SL2610_PLL also depend on OF && HAS_IOMEM like SL2610_CLK? sl2610-pll.c calls readl_relaxed() and of_clk_get().

Also, both symbols allow COMPILE_TEST when ARCH_BERLIN=n, but drivers/clk/Makefile only descends into berlin/ for CONFIG_ARCH_BERLIN, so neither driver is built under COMPILE_TEST=y with ARCH_BERLIN=n.

Quoted 5 lines
drivers/clk/berlin/clk-sl2610.c new file +0 -0
new file mode 100644
index 0000000000000..b51d3523028de

[ ... ]

Quoted 7 lines
drivers/clk/berlin/clk-sl2610.c new file +7 -0
+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 },

drivers/clk/berlin/clk-sl2610.c line 70

Quoted 10 lines
drivers/clk/berlin/clk-sl2610.c new file +10 -0
+	{ "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 },

[Severity: Low]
Are "apbuart3lck" and "apbi2c1lck" typos for "apbuart3clk" and "apbi2c1clk"? Every other entry in sl2610_gates[] ends with "clk", so these two clocks are registered under misspelled names in clk_summary and any lookup by name.

[ ... ]

drivers/clk/berlin/clk-sl2610.c line 329

Quoted 7 lines
drivers/clk/berlin/clk-sl2610.c new file +7 -0
+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 the MCU gate clocks via sl_sysmgr_clk_setup() cause an IRQ lock inversion or deadlock on sl_sysmgr_gateclk_lock?

In commit "clk: berlin: add Synaptics clock controller helpers", sl_sysmgr_gateclk_enable() and sl_sysmgr_gateclk_is_enabled() acquire sl_sysmgr_gateclk_lock with guard(spinlock) instead of guard(spinlock_irqsave):

drivers/clk/berlin/sl-sysmgr-clk.c:sl_sysmgr_gateclk_is_enabled() {
	struct sl_sysmgr_gateclk *gclk = to_sl_sysmgr_gateclk(hw);
	u32 reg;

	guard(spinlock)(&sl_sysmgr_gateclk_lock);
	reg = readl_relaxed(gclk->reg);
    ...
}

clk_enable() holds the CCF enable_lock with interrupts disabled (and may run in hardirq context) before calling .enable, whereas clk_summary_show_one() and clk_hw_is_enabled() call .is_enabled from process context without enable_lock and with interrupts enabled:

CPU0 CPU1
---- ----
clk_enable()
clk_enable_lock()
spin_lock_irqsave(&enable_lock)
clk_summary_show_one()
clk_core_is_enabled()
sl_sysmgr_gateclk_is_enabled()
spin_lock(&sl_sysmgr_gateclk_lock)
sl_sysmgr_gateclk_enable()
spin_lock(&sl_sysmgr_gateclk_lock)
<hardirq>
clk_enable()
clk_enable_lock()
spin_lock_irqsave(&enable_lock)

*** DEADLOCK ***

A single-CPU deadlock also occurs if the interrupt on the same CPU calls clk_enable() on an MCU gate clock while sl_sysmgr_gateclk_is_enabled() holds sl_sysmgr_gateclk_lock. Using guard(spinlock_irqsave) (or reading gclk->reg locklessly in sl_sysmgr_gateclk_is_enabled() as sl_clk_is_enabled() does) avoids this.

Quoted 5 lines
drivers/clk/berlin/sl2610-pll.c new file +0 -0
new file mode 100644
index 0000000000000..62c5d2d19c362

[ ... ]

Quoted 9 lines
drivers/clk/berlin/sl2610-pll.c new file +9 -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;
+};

[ ... ]

drivers/clk/berlin/sl2610-pll.c line 105

Quoted 12 lines
drivers/clk/berlin/sl2610-pll.c new file +12 -0
+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: Medium]
Does sl2610_pll_register() dereference dev and dev->parent before the !dev check? If dev or dev->parent is NULL, initializing np at the top of the function causes a NULL pointer dereference instead of returning -EINVAL. sl2610_soc_clk_setup(), sl2610_cpu_clk_setup(), and sl2610_aio_clk_setup() in drivers/clk/berlin/clk-sl2610.c also dereference dev->parent->of_node without checking dev->parent.

Quoted 6 lines
drivers/clk/berlin/sl2610-pll.h new file +0 -0
new file mode 100644
index 0000000000000..b61a93b28610d

drivers/clk/berlin/sl2610-pll.h line 9

Quoted 9 lines
drivers/clk/berlin/sl2610-pll.h new file +9 -0
@@ -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;

[Severity: Low]
This isn't a bug, but struct clk_hw_onecell_data and struct device_node in sl2610-pll.h and the empty SL2610_APLL macro in sl2610-pll.c are unused and can be dropped.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=10
author maintainer
#19 lore raw

PATCH v2 11/13 dt-bindings: arm: berlin: add Synaptics SL2610 SoCs and RDK boards

In reply to Jisheng Zhang

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.

---
 .../bindings/arm/marvell,berlin.yaml          | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)
Documentation/devicetree/bindings/arm/marvell,berlin.yaml +20 -0
index 4e8442980dcb..30d94059e2f2 100644
@@ -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
Signature · 1 line
2.55.0
author maintainer
#20 lore raw

PATCH v2 12/13 arm64: dts: synaptics: add SL2610 family SoCs

In reply to Jisheng Zhang

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.

---
 arch/arm64/boot/dts/synaptics/sl2611.dtsi | 457 ++++++++++++++++++++++
 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, 605 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
arch/arm64/boot/dts/synaptics/sl2611.dtsi new file +457 -0
new file mode 100644
index 000000000000..663fe6034ba0
@@ -0,0 +1,457 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2024 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <[email protected]>
+ */
+
+#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";
+	interrupt-parent = <&gic>;
+	#address-cells = <2>;
+	#size-cells = <2>;
+
+	psci {
+		compatible = "arm,psci-1.0";
+		method = "smc";
+	};
+
+	optee {
+		compatible = "linaro,optee-tz";
+		method = "smc";
+	};
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu0: cpu@0 {
+			compatible = "arm,cortex-a55";
+			device_type = "cpu";
+			reg = <0x0>;
+			enable-method = "psci";
+			cpu-idle-states = <&CPU_SLEEP_0>;
+			i-cache-size = <32768>;
+			i-cache-line-size = <64>;
+			i-cache-sets = <128>;
+			d-cache-size = <32768>;
+			d-cache-line-size = <64>;
+			d-cache-sets = <128>;
+			next-level-cache = <&L2_0>;
+
+			L2_0: l2-cache {
+				compatible = "cache";
+				cache-size = <65536>;
+				cache-line-size = <64>;
+				cache-sets = <256>;
+				cache-level = <2>;
+				cache-unified;
+				next-level-cache = <&L3>;
+			};
+		};
+
+		L3: l3-cache0 {
+			compatible = "cache";
+			cache-level = <3>;
+			cache-unified;
+			cache-size = <262144>;
+			cache-line-size = <64>;
+			cache-sets = <256>;
+		};
+
+		idle-states {
+			entry-method = "psci";
+			CPU_SLEEP_0: cpu-sleep-0 {
+				compatible = "arm,idle-state";
+				local-timer-stop;
+				arm,psci-suspend-param = <0x0010000>;
+				entry-latency-us = <75>;
+				exit-latency-us = <155>;
+				min-residency-us = <50000>;
+			};
+		};
+	};
+
+	osc: osc {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+	};
+
+	pmu {
+		compatible = "arm,cortex-a55-pmu";
+		interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-affinity = <&cpu0>;
+	};
+
+	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)>;
+	};
+
+	soc {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges = <0 0 0 0xffffffff>;
+
+		sm-bus {
+			compatible = "simple-bus";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges;
+			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>;
+				interrupts = <GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&sm_clk CLK_SER_UART0>, <&sm_clk CLK_CFG_UART0>;
+				clock-names = "baudclk", "apb_pclk";
+				reg-shift = <2>;
+				status = "disabled";
+			};
+
+			sm_uart1: serial@e5031000 {
+				compatible = "syna,sl2610-uart", "snps,dw-apb-uart";
+				reg = <0xe5031000 0x100>;
+				interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&sm_clk CLK_SER_UART1>, <&sm_clk CLK_CFG_UART1>;
+				clock-names = "baudclk", "apb_pclk";
+				reg-shift = <2>;
+				status = "disabled";
+			};
+
+			sm_uart2: serial@e5032000 {
+				compatible = "syna,sl2610-uart", "snps,dw-apb-uart";
+				reg = <0xe5032000 0x100>;
+				interrupts = <GIC_SPI 132 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&sm_clk CLK_SER_UART2>, <&sm_clk CLK_CFG_UART2>;
+				clock-names = "baudclk", "apb_pclk";
+				reg-shift = <2>;
+				status = "disabled";
+			};
+
+			sm_uart3: serial@e5033000 {
+				compatible = "syna,sl2610-uart", "snps,dw-apb-uart";
+				reg = <0xe5033000 0x100>;
+				interrupts = <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&sm_clk CLK_SER_UART3>, <&sm_clk CLK_CFG_UART3>;
+				clock-names = "baudclk", "apb_pclk";
+				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>;
+				num-cs = <4>;
+				clocks = <&sm_clk CLK_SER_SPIM>, <&sm_clk CLK_CFG_SPIM>;
+				clock-names = "ssi_clk", "pclk";
+				interrupts = <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>;
+				status = "disabled";
+			};
+
+			sm_i2c0: i2c@e5035000 {
+				compatible = "syna,sl2610-i2c", "snps,designware-i2c";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				reg = <0xe5035000 0x100>;
+				clocks = <&sm_clk CLK_SER_I2CM0>, <&sm_clk CLK_CFG_I2CM0>;
+				clock-names = "ref", "pclk";
+				i2c-sda-falling-time-ns = <510>;
+				i2c-scl-falling-time-ns = <510>;
+				interrupts = <GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>;
+				status = "disabled";
+			};
+
+			sm_i2c1: i2c@e5036000 {
+				compatible = "syna,sl2610-i2c", "snps,designware-i2c";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				reg = <0xe5036000 0x100>;
+				clocks = <&sm_clk CLK_SER_I2CM1>, <&sm_clk CLK_CFG_I2CM1>;
+				clock-names = "ref", "pclk";
+				i2c-sda-falling-time-ns = <510>;
+				i2c-scl-falling-time-ns = <510>;
+				interrupts = <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>;
+				status = "disabled";
+			};
+
+			sm_i3c0: i3c@e5037000 {
+				compatible = "syna,sl2610-i3c", "snps,dw-i3c-master-1.00a";
+				#address-cells = <3>;
+				#size-cells = <0>;
+				reg = <0xe5037000 0x1000>;
+				interrupts = <GIC_SPI 129 IRQ_TYPE_LEVEL_HIGH>;
+				resets = <&sm_rst RST_SM_I3CSRST>, <&sm_rst RST_SM_I3CPRST>;
+				clocks = <&sm_clk CLK_SER_I3C>, <&sm_clk CLK_CFG_I3C>;
+				clock-names = "core", "apb";
+				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";
+					gpio-controller;
+					#gpio-cells = <2>;
+					ngpios = <16>;
+					reg = <0>;
+				};
+			};
+
+			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";
+					gpio-controller;
+					#gpio-cells = <2>;
+					ngpios = <8>;
+					reg = <0>;
+				};
+			};
+
+			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";
+					gpio-controller;
+					#gpio-cells = <2>;
+					ngpios = <8>;
+					reg = <0>;
+				};
+			};
+
+			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";
+					gpio-controller;
+					#gpio-cells = <2>;
+					ngpios = <8>;
+					reg = <0>;
+				};
+			};
+		};
+
+		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";
+			#interrupt-cells = <3>;
+			interrupt-controller;
+			reg = <0xf7e59000 0x1000>,
+			      <0xf7e5a000 0x2000>,
+			      <0xf7e5c000 0x2000>,
+			      <0xf7e5e000 0x2000>;
+			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>;
+			interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clk CLK_APBUART0>;
+			reg-shift = <2>;
+			status = "disabled";
+		};
+
+		soc_uart1: serial@f7f01000 {
+			compatible = "syna,sl2610-uart", "snps,dw-apb-uart";
+			reg = <0xf7f01000 0x100>;
+			interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clk CLK_APBUART1>;
+			reg-shift = <2>;
+			status = "disabled";
+		};
+
+		soc_uart2: serial@f7f02000 {
+			compatible = "syna,sl2610-uart", "snps,dw-apb-uart";
+			reg = <0xf7f02000 0x100>;
+			interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clk CLK_APBUART2>;
+			reg-shift = <2>;
+			status = "disabled";
+		};
+
+		soc_uart3: serial@f7f03000 {
+			compatible = "syna,sl2610-uart", "snps,dw-apb-uart";
+			reg = <0xf7f03000 0x100>;
+			interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clk CLK_APBUART3>;
+			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>;
+			num-cs = <4>;
+			clocks = <&clk CLK_APBSPI0>;
+			interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
+			status = "disabled";
+		};
+
+		soc_i2c0: i2c@f7f05000 {
+			compatible = "syna,sl2610-i2c", "snps,designware-i2c";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0xf7f05000 0x100>;
+			clocks = <&clk CLK_APBI2C0>;
+			i2c-sda-hold-time-ns = <449>;
+			i2c-sda-falling-time-ns = <425>;
+			i2c-scl-falling-time-ns = <205>;
+			interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>;
+			status = "disabled";
+		};
+
+		soc_i2c1: i2c@f7f06000 {
+			compatible = "syna,sl2610-i2c", "snps,designware-i2c";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0xf7f06000 0x100>;
+			clocks = <&clk CLK_APBI2C1>;
+			i2c-sda-hold-time-ns = <449>;
+			i2c-sda-falling-time-ns = <425>;
+			i2c-scl-falling-time-ns = <205>;
+			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";
+				gpio-controller;
+				#gpio-cells = <2>;
+				ngpios = <32>;
+				reg = <0>;
+				interrupt-controller;
+				#interrupt-cells = <2>;
+				interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
+			};
+		};
+
+		soc_spi1: spi@f7f0b000 {
+			compatible = "syna,sl2610-spi", "snps,dw-apb-ssi";
+			reg = <0xf7f0b000 0x100>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			num-cs = <4>;
+			clocks = <&clk CLK_APBSPI1>;
+			interrupts = <GIC_SPI 199 IRQ_TYPE_LEVEL_HIGH>;
+			status = "disabled";
+		};
+
+		soc_spi2: spi@f7f0c000 {
+			compatible = "syna,sl2610-spi", "snps,dw-apb-ssi";
+			reg = <0xf7f0c000 0x100>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			num-cs = <4>;
+			clocks = <&clk CLK_APBSPI2>;
+			interrupts = <GIC_SPI 200 IRQ_TYPE_LEVEL_HIGH>;
+			status = "disabled";
+		};
+
+		soc_spi3: spi@f7f0d000 {
+			compatible = "syna,sl2610-spi", "snps,dw-apb-ssi";
+			reg = <0xf7f0d000 0x100>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			num-cs = <4>;
+			clocks = <&clk CLK_APBSPI3>;
+			interrupts = <GIC_SPI 201 IRQ_TYPE_LEVEL_HIGH>;
+			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";
+				gpio-controller;
+				#gpio-cells = <2>;
+				ngpios = <32>;
+				reg = <0>;
+				interrupt-controller;
+				#interrupt-cells = <2>;
+				interrupts = <GIC_SPI 206 IRQ_TYPE_LEVEL_HIGH>;
+			};
+		};
+	};
+};
arch/arm64/boot/dts/synaptics/sl2613.dtsi new file +12 -0
new file mode 100644
index 000000000000..379809901677
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2025 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <[email protected]>
+ */
+
+#include "sl2611.dtsi"
+
+/ {
+	compatible = "syna,sl2613";
+};
arch/arm64/boot/dts/synaptics/sl2615.dtsi new file +46 -0

46 lines not on this page · raw message

arch/arm64/boot/dts/synaptics/sl2617.dtsi new file +46 -0

46 lines not on this page · raw message

arch/arm64/boot/dts/synaptics/sl2619.dtsi new file +44 -0

44 lines not on this page · raw message

Signature · 1 line
2.55.0
#21 lore raw

Re: [PATCH v2 12/13] arm64: dts: synaptics: add SL2610 family SoCs

Thank you for your contribution! Sashiko AI review found 3 potential issues to consider: - [Low] arm64: dts: synaptics: missing root compatible property in sl2619.dtsi - [Low] arm64: dts: synaptics…

Thank you for your contribution! Sashiko AI review found 3 potential issues to consider:
- [Low] arm64: dts: synaptics: missing root compatible property in sl2619.dtsi
- [Low] arm64: dts: synaptics: duplicated cpu1 and pmu nodes in sl2617/sl2619.dtsi
- [Low] arm64: dts: synaptics: optee node placed under root instead of /firmware
--

commit 9dec2dc5b8adc9799e77b0f1baf814fa359dd8c4
Author: Jisheng Zhang <[email protected]>

arm64: dts: synaptics: add SL2610 family SoCs

This commit adds devicetree files for the Synaptics SL2610 family SoCs (SL2611, SL2613, SL2615, SL2617, and SL2619), describing CPUs, GIC, system controllers, and serial, I2C, I3C, SPI, and GPIO peripherals.

Quoted 22 lines
arch/arm64/boot/dts/synaptics/sl2611.dtsi new file +16 -0
new file mode 100644
index 0000000000000..663fe6034ba05
@@ -0,0 +1,457 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2024 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <[email protected]>
+ */
+
+#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";
+	interrupt-parent = <&gic>;
+	#address-cells = <2>;
+	#size-cells = <2>;

arch/arm64/boot/dts/synaptics/sl2611.dtsi line 26

Quoted 10 lines
arch/arm64/boot/dts/synaptics/sl2611.dtsi new file +10 -0
+
+	psci {
+		compatible = "arm,psci-1.0";
+		method = "smc";
+	};
+
+	optee {
+		compatible = "linaro,optee-tz";
+		method = "smc";
+	};

[Severity: Low]
Should the optee node be placed under a /firmware container node?

Documentation/devicetree/bindings/arm/firmware/linaro,optee-tz.yaml places optee under /firmware, which of_platform_default_populate_init() looks up directly via of_find_node_by_path("/firmware") before populating the rest of the tree.

[ ... ]

Quoted 10 lines
arch/arm64/boot/dts/synaptics/sl2617.dtsi new file +4 -0
new file mode 100644
index 0000000000000..a0de686d1fae5
@@ -0,0 +1,46 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2025 Synaptics Incorporated
+ *

arch/arm64/boot/dts/synaptics/sl2617.dtsi line 14

Quoted 10 lines
arch/arm64/boot/dts/synaptics/sl2617.dtsi new file +10 -0
+ * Author: Jisheng Zhang <[email protected]>
+ */
+
+#include "sl2613.dtsi"
+
+/ {
+	compatible = "syna,sl2617";
+
+	cpus {
+		cpu1: cpu@100 {

[Severity: Low]
This isn't a bug, but sl2617.dtsi and sl2619.dtsi duplicate the entire cpu1 and pmu definitions from sl2615.dtsi. Could they include sl2615.dtsi and override the root compatible property, the same way sl2613.dtsi includes sl2611.dtsi?

[ ... ]

Quoted 7 lines
arch/arm64/boot/dts/synaptics/sl2619.dtsi new file +1 -0
new file mode 100644
index 0000000000000..96bd58bbed3e1
@@ -0,0 +1,44 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)

arch/arm64/boot/dts/synaptics/sl2619.dtsi line 11

Quoted 10 lines
arch/arm64/boot/dts/synaptics/sl2619.dtsi new file +10 -0
+/*
+ * Copyright (C) 2025 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <[email protected]>
+ */
+
+#include "sl2613.dtsi"
+
+/ {
+	cpus {

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

Unlike sl2615.dtsi and sl2617.dtsi, sl2619.dtsi does not override the root compatible property and inherits compatible = "syna,sl2613"; from sl2613.dtsi.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=12
author maintainer
#22 lore raw

PATCH v2 13/13 arm64: dts: synaptics: add SL2610 family RDK boards

In reply to Jisheng Zhang

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.

---
 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 | 135 ++++++++++++++++++
 7 files changed, 220 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
arch/arm64/boot/dts/synaptics/Makefile +5 -0
index de71ddda6835..810d0d08c2de 100644
@@ -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
arch/arm64/boot/dts/synaptics/sl2611-rdk.dts new file +16 -0
new file mode 100644
index 000000000000..585872307834
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2025 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <[email protected]>
+ */
+
+/dts-v1/;
+
+#include "sl2611.dtsi"
+#include "sl261x-rdk-common.dtsi"
+
+/ {
+	model = "Synaptics SL2611 RDK";
+	compatible = "syna,sl2611-rdk", "syna,sl2611";
+};
arch/arm64/boot/dts/synaptics/sl2613-rdk.dts new file +16 -0
new file mode 100644
index 000000000000..de75c9fab6a2
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2025 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <[email protected]>
+ */
+
+/dts-v1/;
+
+#include "sl2613.dtsi"
+#include "sl261x-rdk-common.dtsi"
+
+/ {
+	model = "Synaptics SL2613 RDK";
+	compatible = "syna,sl2613-rdk", "syna,sl2613";
+};
arch/arm64/boot/dts/synaptics/sl2615-rdk.dts new file +16 -0
new file mode 100644
index 000000000000..ae03638a3a53
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2025 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <[email protected]>
+ */
+
+/dts-v1/;
+
+#include "sl2615.dtsi"
+#include "sl261x-rdk-common.dtsi"
+
+/ {
+	model = "Synaptics SL2615 RDK";
+	compatible = "syna,sl2615-rdk", "syna,sl2615";
+};
arch/arm64/boot/dts/synaptics/sl2617-rdk.dts new file +16 -0
new file mode 100644
index 000000000000..ba4ea21ac505
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2025 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <[email protected]>
+ */
+
+/dts-v1/;
+
+#include "sl2617.dtsi"
+#include "sl261x-rdk-common.dtsi"
+
+/ {
+	model = "Synaptics SL2617 RDK";
+	compatible = "syna,sl2617-rdk", "syna,sl2617";
+};
arch/arm64/boot/dts/synaptics/sl2619-rdk.dts new file +16 -0
new file mode 100644
index 000000000000..58901ac2a050
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2025 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <[email protected]>
+ */
+
+/dts-v1/;
+
+#include "sl2619.dtsi"
+#include "sl261x-rdk-common.dtsi"
+
+/ {
+	model = "Synaptics SL2619 RDK";
+	compatible = "syna,sl2619-rdk", "syna,sl2619";
+};
arch/arm64/boot/dts/synaptics/sl261x-rdk-common.dtsi new file +135 -0

135 lines not on this page · raw message

Signature · 1 line
2.55.0
#23 lore raw

Re: [PATCH v2 13/13] arm64: dts: synaptics: add SL2610 family RDK boards

Thank you for your contribution! Sashiko AI review found 3 potential issues to consider: - [Low] arm64: dts: synaptics: deprecated cpu0-supply used in sl261x-rdk-common.dtsi - [Low] arm64: dts…

Thank you for your contribution! Sashiko AI review found 3 potential issues to consider:
- [Low] arm64: dts: synaptics: deprecated cpu0-supply used in sl261x-rdk-common.dtsi
- [Low] arm64: dts: synaptics: underscore in soc_i2c0-pmux node name
- [Low] arm64: dts: synaptics: unused linux-event-codes.h include in sl261x-rdk-common.dtsi
--

commit f1ba81aeb15547b6a1942dc7df6778c88410e949
Author: Jisheng Zhang <[email protected]>

arm64: dts: synaptics: add SL2610 family RDK boards

This commit adds device tree files for the Synaptics SL2611, SL2613, SL2615, SL2617, and SL2619 reference development kits along with a shared common dtsi.

Quoted 6 lines
arch/arm64/boot/dts/synaptics/sl261x-rdk-common.dtsi new file +0 -0
new file mode 100644
index 0000000000000..78a9b28fdf99e

arch/arm64/boot/dts/synaptics/sl261x-rdk-common.dtsi line 9

Quoted 9 lines
arch/arm64/boot/dts/synaptics/sl261x-rdk-common.dtsi new file +9 -0
@@ -0,0 +1,135 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2025 Synaptics Incorporated
+ *
+ * Author: Jisheng Zhang <[email protected]>
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/linux-event-codes.h>

[Severity: Low]
Is the dt-bindings/input/linux-event-codes.h include needed here? Neither sl261x-rdk-common.dtsi nor the board dts files that include it define any input nodes or reference event code macros.

[ ... ]

arch/arm64/boot/dts/synaptics/sl261x-rdk-common.dtsi line 36

Quoted 5 lines
arch/arm64/boot/dts/synaptics/sl261x-rdk-common.dtsi new file +5 -0
+	cpus {
+		cpu@0 {
+			cpu0-supply = <&vcore>;
+		};
+	};

[Severity: Low]
Should cpu@0 use cpu-supply instead of cpu0-supply? Documentation/devicetree/bindings/arm/cpus.yaml marks cpu0-supply as deprecated in favor of cpu-supply, and the dual-core SL2615, SL2617, and SL2619 variants also define cpu1: cpu@100.

[ ... ]

arch/arm64/boot/dts/synaptics/sl261x-rdk-common.dtsi line 59

Quoted 7 lines
arch/arm64/boot/dts/synaptics/sl261x-rdk-common.dtsi new file +7 -0
+&pinctrl {
+	soc_i2c0_pmux: soc_i2c0-pmux {
+		groups = "GPIO23", "GPIO24";
+		function = "tw2";
+		drive-strength = <7>;
+	};
+};

[Severity: Low]
Should the node name soc_i2c0-pmux use a hyphen instead of an underscore (for example, soc-i2c0-pmux)? Using an underscore in a devicetree node name triggers a dtc node_name_chars_strict warning when building with W=2.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=13