Skip to contentSkip to conversation

Add support for Cix Sky1 resets

PATCH Superseded Gary Yang 2 participants 6 messages Feb 3

Subsystems (3)

v6 of 10 Superseded Latest is v10 →

lore
Share & tools
lore

Gary Yang

author maintainer
#0 lore raw

v6 cover Add support for Cix Sky1 resets

Patch 1: Add yaml file for Cix Sky1 resets
Patch 2: Add driver codes for Cix Sky1 resets
Patch 3: Add dts nodes for Cix Sky1 resets

v6 changes:
- Pass dts build check with below commands:
make O=$OUTKNL dt_binding_check
make O=$OUTKNL dt_binding_check DT_SCHEMA_FILES=cix,sky1-system-control.yaml make O=$OUTKNL CHECK_DTBS=y W=1 cix/sky1-orion-o6.dtb scripts/checkpatch.pl 000*.patch
- refine reset driver
- fix dt-bindings style

v5 changes:
- Pass dts build check with below commands:
make O=$OUTKNL dt_binding_check
make O=$OUTKNL dt_binding_check DT_SCHEMA_FILES=cix,sky1-rst.yaml make O=$OUTKNL dt_binding_check DT_SCHEMA_FILES=cix,sky1-system-controller.yaml make O=$OUTKNL CHECK_DTBS=y W=1 cix/sky1-orion-o6.dtb scripts/checkpatch.pl 000*.patch
- refine reset driver
- fix dt-bindings style

v4 changes:
- Pass dts build check with below commands:
make O=$OUTKNL dt_binding_check
make O=$OUTKNL dt_binding_check DT_SCHEMA_FILES=cix,sky1-rst.yaml make O=$OUTKNL CHECK_DTBS=y W=1 cix/sky1-orion-o6.dtb scripts/checkpatch.pl 000*.patch
- add syscon
- refine reset driver
- fix dt-bindings style

v3 changes:
- Pass dts build check with below commands:
make O=$OUTKNL dt_binding_check
make O=$OUTKNL dt_binding_check DT_SCHEMA_FILES=cix,sky1-rst.yaml make O=$OUTKNL CHECK_DTBS=y W=1 cix/sky1-orion-o6.dtb scripts/checkpatch.pl 000*.patch
- remove syscon

v2 changes:
- Pass dts build check with below commands:
make O=$OUTKNL dt_binding_check
make O=$OUTKNL dt_binding_check DT_SCHEMA_FILES=cix,sky1-rst.yaml make O=$OUTKNL CHECK_DTBS=y W=1 cix/sky1-orion-o6.dtb scripts/checkpatch.pl 000*.patch
- fix dt-bindings style
- refine reset driver

Gary Yang (3):
dt-bindings: soc: cix: document the simple-mfd syscon on Sky1 SoC
reset: add Sky1 soc reset support
arm64: dts: cix: add support for cix sky1 resets

 .../soc/cix/cix,sky1-system-control.yaml      |  49 +++++
 arch/arm64/boot/dts/cix/sky1.dtsi             |  14 ++
 drivers/reset/Kconfig                         |   7 +
 drivers/reset/Makefile                        |   1 +
 drivers/reset/reset-sky1-base.c               | 126 +++++++++++
 drivers/reset/reset-sky1-fch.c                |  78 +++++++
 drivers/reset/reset-sky1.c                    | 204 ++++++++++++++++++
 drivers/soc/Kconfig                           |   1 +
 drivers/soc/Makefile                          |   1 +
 drivers/soc/cix/Kconfig                       |  11 +
 drivers/soc/cix/Makefile                      |   1 +
 drivers/soc/cix/sky1-system-control.c         |  47 ++++
 include/dt-bindings/reset/cix,sky1-rst-fch.h  |  42 ++++
 include/dt-bindings/reset/cix,sky1-rst.h      | 164 ++++++++++++++
 include/linux/reset/sky1.h                    |  18 ++
 15 files changed, 764 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/cix/cix,sky1-system-control.yaml
 create mode 100644 drivers/reset/reset-sky1-base.c
 create mode 100644 drivers/reset/reset-sky1-fch.c
 create mode 100644 drivers/reset/reset-sky1.c
 create mode 100644 drivers/soc/cix/Kconfig
 create mode 100644 drivers/soc/cix/Makefile
 create mode 100644 drivers/soc/cix/sky1-system-control.c
 create mode 100644 include/dt-bindings/reset/cix,sky1-rst-fch.h
 create mode 100644 include/dt-bindings/reset/cix,sky1-rst.h
 create mode 100644 include/linux/reset/sky1.h
Signature · 1 line
2.49.0
author maintainer
#1 lore raw

PATCH v6 1/3 dt-bindings: soc: cix: document the simple-mfd syscon on Sky1 SoC

There are two system control on Cix sky1 Soc. One is located in S0 domain, and the other is located in S0 and S5 domain. The system control contains resets, usb typeC and more. At this point, only the reset controller child is described as usb typeC uses it by phandle.

---
 .../soc/cix/cix,sky1-system-control.yaml      |  49 ++++++
 include/dt-bindings/reset/cix,sky1-rst-fch.h  |  42 +++++
 include/dt-bindings/reset/cix,sky1-rst.h      | 164 ++++++++++++++++++
 3 files changed, 255 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/cix/cix,sky1-system-control.yaml
 create mode 100644 include/dt-bindings/reset/cix,sky1-rst-fch.h
 create mode 100644 include/dt-bindings/reset/cix,sky1-rst.h
Documentation/devicetree/bindings/soc/cix/cix,sky1-system-control.yaml new file +49 -0
new file mode 100644
index 000000000000..5fb6b97c3c00
@@ -0,0 +1,49 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/cix/cix,sky1-system-control.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Cix Sky1 SoC system control register region
+
+maintainers:
+  - Gary Yang <[email protected]>
+
+description:
+  An wide assortment of registers of the system controller on Sky1 SoC,
+  including resets, usb, wakeup sources and so on.
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - cix,sky1-system-control
+          - cix,sky1-s5-system-control
+      - const: syscon
+      - const: simple-mfd
+
+  reg:
+    maxItems: 1
+
+  '#address-cells':
+    const: 1
+
+  '#size-cells':
+    const: 1
+
+  '#reset-cells':
+    const: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    syscon@16000000 {
+      compatible = "cix,sky1-s5-system-control", "syscon", "simple-mfd";
+      reg = <0x16000000 0x1000>;
+      #reset-cells = <1>;
+    };
include/dt-bindings/reset/cix,sky1-rst-fch.h new file +42 -0

42 lines not on this page · raw message

include/dt-bindings/reset/cix,sky1-rst.h new file +164 -0

164 lines not on this page · raw message

Signature · 1 line
2.49.0
author maintainer
#2 lore raw

PATCH v6 2/3 reset: add Sky1 soc reset support

In reply to Gary Yang

Add support for the resets on Cix's Sky1 SoC.
There are two reset controllers on Cix Sky1 Soc. One is located in S0 domain, and the other is located in S0 and S5 domain.

---
 drivers/reset/Kconfig                 |   7 +
 drivers/reset/Makefile                |   1 +
 drivers/reset/reset-sky1-base.c       | 126 ++++++++++++++++
 drivers/reset/reset-sky1-fch.c        |  78 ++++++++++
 drivers/reset/reset-sky1.c            | 204 ++++++++++++++++++++++++++
 drivers/soc/Kconfig                   |   1 +
 drivers/soc/Makefile                  |   1 +
 drivers/soc/cix/Kconfig               |  11 ++
 drivers/soc/cix/Makefile              |   1 +
 drivers/soc/cix/sky1-system-control.c |  47 ++++++
 include/linux/reset/sky1.h            |  18 +++
 11 files changed, 495 insertions(+)
 create mode 100644 drivers/reset/reset-sky1-base.c
 create mode 100644 drivers/reset/reset-sky1-fch.c
 create mode 100644 drivers/reset/reset-sky1.c
 create mode 100644 drivers/soc/cix/Kconfig
 create mode 100644 drivers/soc/cix/Makefile
 create mode 100644 drivers/soc/cix/sky1-system-control.c
 create mode 100644 include/linux/reset/sky1.h
drivers/reset/Kconfig +7 -0
index 6e5d6deffa7d..24bf60c4e640 100644
@@ -291,6 +291,13 @@ config RESET_SIMPLE
 	   - SiFive FU740 SoCs
 	   - Sophgo SoCs
 
+config RESET_SKY1
+	bool "Cix Sky1 reset controller"
+	depends on HAS_IOMEM
+	depends on ARCH_CIX || COMPILE_TEST
+	help
+	  This enables the reset controller for Cix Sky1.
+
 config RESET_SOCFPGA
 	bool "SoCFPGA Reset Driver" if COMPILE_TEST && (!ARM || !ARCH_INTEL_SOCFPGA)
 	default ARM && ARCH_INTEL_SOCFPGA
drivers/reset/Makefile +1 -0
index 9c3e484dfd81..6a43ed23da14 100644
@@ -37,6 +37,7 @@ obj-$(CONFIG_RESET_RZG2L_USBPHY_CTRL) += reset-rzg2l-usbphy-ctrl.o
 obj-$(CONFIG_RESET_RZV2H_USB2PHY) += reset-rzv2h-usb2phy.o
 obj-$(CONFIG_RESET_SCMI) += reset-scmi.o
 obj-$(CONFIG_RESET_SIMPLE) += reset-simple.o
+obj-$(CONFIG_RESET_SKY1) += reset-sky1-base.o reset-sky1.o reset-sky1-fch.o
 obj-$(CONFIG_RESET_SOCFPGA) += reset-socfpga.o
 obj-$(CONFIG_RESET_SPACEMIT) += reset-spacemit.o
 obj-$(CONFIG_RESET_SUNPLUS) += reset-sunplus.o
drivers/reset/reset-sky1-base.c new file +126 -0

126 lines not on this page · raw message

drivers/reset/reset-sky1-fch.c new file +78 -0

78 lines not on this page · raw message

drivers/reset/reset-sky1.c new file +204 -0

204 lines not on this page · raw message

drivers/soc/Kconfig +1 -0
index a2d65adffb80..150352c50be9 100644
@@ -8,6 +8,7 @@ source "drivers/soc/atmel/Kconfig"
 source "drivers/soc/bcm/Kconfig"
 source "drivers/soc/canaan/Kconfig"
 source "drivers/soc/cirrus/Kconfig"
+source "drivers/soc/cix/Kconfig"
 source "drivers/soc/fsl/Kconfig"
 source "drivers/soc/fujitsu/Kconfig"
 source "drivers/soc/hisilicon/Kconfig"
drivers/soc/Makefile +1 -0
index c9e689080ceb..e36645abf20a 100644
@@ -9,6 +9,7 @@ obj-$(CONFIG_ARCH_AT91)		+= atmel/
 obj-y				+= bcm/
 obj-$(CONFIG_ARCH_CANAAN)	+= canaan/
 obj-$(CONFIG_EP93XX_SOC)        += cirrus/
+obj-$(CONFIG_ARCH_CIX)		+= cix/
 obj-$(CONFIG_ARCH_DOVE)		+= dove/
 obj-$(CONFIG_MACH_DOVE)		+= dove/
 obj-y				+= fsl/
drivers/soc/cix/Kconfig new file +11 -0
new file mode 100644
index 000000000000..3487499d4b2a
@@ -0,0 +1,11 @@
+config CIX_SOC_SYSCONS
+	bool "Cix SoC syscon drivers"
+	default y
+	depends on ARCH_CIX
+	select MFD_CORE
+	help
+	  The drivers add support for the syscons on Cix SoC. Without
+	  the drivers core parts of the kernel such as resets will not
+	  function correctly.
+
+	  If unsure, and on a Cix SoC, say y.
drivers/soc/cix/Makefile new file +1 -0
new file mode 100644
index 000000000000..e1252cf836ba
@@ -0,0 +1 @@
+obj-$(CONFIG_CIX_SOC_SYSCONS)	+= sky1-system-control.o
drivers/soc/cix/sky1-system-control.c new file +47 -0

47 lines not on this page · raw message

include/linux/reset/sky1.h new file +18 -0
new file mode 100644
index 000000000000..2939071e510c
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __LINUX_RESET_SKY1_H__
+#define __LINUX_RESET_SKY1_H__
+
+struct sky1_src_signal {
+	unsigned int offset;
+	unsigned int bit;
+};
+
+struct sky1_src_variant {
+	const struct sky1_src_signal *signals;
+	unsigned int signals_num;
+};
+
+int sky1_reset_common_probe(struct platform_device *pdev,
+			    const struct sky1_src_variant *variant);
+
+#endif /* __LINUX_RESET_SKY1_H__ */
Signature · 1 line
2.49.0
#3 lore raw

Re: [PATCH v6 2/3] reset: add Sky1 soc reset support

kernel test robot noticed the following build warnings:

Hi Gary,

kernel test robot noticed the following build warnings:

[auto build test WARNING on robh/for-next]
[also build test WARNING on lee-leds/for-leds-next linus/master pza/reset/next v6.19-rc8 next-20260202] [cannot apply to pza/imx-drm/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Gary-Yang/dt-bindings-soc-cix-document-the-simple-mfd-syscon-on-Sky1-SoC/20260203-102331
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link:    https://lore.kernel.org/r/20260203022031.4075627-3-gary.yang%40cixtech.com
patch subject: [PATCH v6 2/3] reset: add Sky1 soc reset support
config: nios2-allmodconfig (https://download.01.org/0day-ci/archive/20260203/[email protected]/config)
compiler: nios2-linux-gcc (GCC) 11.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260203/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

>> drivers/reset/reset-sky1-base.c:97:5: warning: no previous prototype for 'sky1_reset_common_probe' [-Wmissing-prototypes]

97 | int sky1_reset_common_probe(struct platform_device *pdev,
| ^~~~~~~~~~~~~~~~~~~~~~~

vim +/sky1_reset_common_probe +97 drivers/reset/reset-sky1-base.c

    96	
  > 97	int sky1_reset_common_probe(struct platform_device *pdev,
    98				const struct sky1_src_variant *variant)
    99	{
   100		struct sky1_src *sky1src;
   101		struct device *dev = &pdev->dev;
   102	
   103		sky1src = devm_kzalloc(dev, sizeof(*sky1src), GFP_KERNEL);
   104		if (!sky1src)
   105			return -ENOMEM;
   106	
   107		sky1src->regmap = device_node_to_regmap(dev->parent->of_node);
   108		if (IS_ERR(sky1src->regmap)) {
   109			dev_err(dev, "Unable to get sky1-src regmap");
   110			return PTR_ERR(sky1src->regmap);
   111		}
   112	
   113		sky1src->signals = variant->signals;
   114		sky1src->rcdev.owner     = THIS_MODULE;
   115		sky1src->rcdev.nr_resets = variant->signals_num;
   116		sky1src->rcdev.ops       = &sky1_src_ops;
   117		sky1src->rcdev.of_node   = dev->parent->of_node;
   118		sky1src->rcdev.dev       = dev;

119
120 return devm_reset_controller_register(dev, &sky1src->rcdev);
121 }
122 EXPORT_SYMBOL_GPL(sky1_reset_common_probe);
123

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#4 lore raw

Re: [PATCH v6 2/3] reset: add Sky1 soc reset support

In reply to Gary Yang
kernel test robot noticed the following build warnings:

Hi Gary,

kernel test robot noticed the following build warnings:

[auto build test WARNING on robh/for-next]
[also build test WARNING on lee-leds/for-leds-next linus/master pza/reset/next v6.19-rc8 next-20260202] [cannot apply to pza/imx-drm/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Gary-Yang/dt-bindings-soc-cix-document-the-simple-mfd-syscon-on-Sky1-SoC/20260203-102331
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link:    https://lore.kernel.org/r/20260203022031.4075627-3-gary.yang%40cixtech.com
patch subject: [PATCH v6 2/3] reset: add Sky1 soc reset support
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20260204/[email protected]/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260204/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

>> drivers/reset/reset-sky1-base.c:97:5: warning: no previous prototype for function 'sky1_reset_common_probe' [-Wmissing-prototypes]
      97 | int sky1_reset_common_probe(struct platform_device *pdev,
         |     ^
   drivers/reset/reset-sky1-base.c:97:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
      97 | int sky1_reset_common_probe(struct platform_device *pdev,
         | ^
         | static 

1 warning generated.

vim +/sky1_reset_common_probe +97 drivers/reset/reset-sky1-base.c

    96	
  > 97	int sky1_reset_common_probe(struct platform_device *pdev,
    98				const struct sky1_src_variant *variant)
    99	{
   100		struct sky1_src *sky1src;
   101		struct device *dev = &pdev->dev;
   102	
   103		sky1src = devm_kzalloc(dev, sizeof(*sky1src), GFP_KERNEL);
   104		if (!sky1src)
   105			return -ENOMEM;
   106	
   107		sky1src->regmap = device_node_to_regmap(dev->parent->of_node);
   108		if (IS_ERR(sky1src->regmap)) {
   109			dev_err(dev, "Unable to get sky1-src regmap");
   110			return PTR_ERR(sky1src->regmap);
   111		}
   112	
   113		sky1src->signals = variant->signals;
   114		sky1src->rcdev.owner     = THIS_MODULE;
   115		sky1src->rcdev.nr_resets = variant->signals_num;
   116		sky1src->rcdev.ops       = &sky1_src_ops;
   117		sky1src->rcdev.of_node   = dev->parent->of_node;
   118		sky1src->rcdev.dev       = dev;

119
120 return devm_reset_controller_register(dev, &sky1src->rcdev);
121 }
122 EXPORT_SYMBOL_GPL(sky1_reset_common_probe);
123

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
author maintainer
#5 lore raw

PATCH v6 3/3 arm64: dts: cix: add support for cix sky1 resets

In reply to Gary Yang

There are two reset conctrollers on Cix Sky1 Soc. One is located in S0 domain, and the other is located in S0 and S5 domain.

---
 arch/arm64/boot/dts/cix/sky1.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/arm64/boot/dts/cix/sky1.dtsi +14 -0
index 64b76905cbff..37dca97b6b67 100644
@@ -348,6 +348,13 @@ i3c1: i3c@4100000 {
 			status = "disabled";
 		};
 
+		syscon: syscon@4160000 {
+			compatible = "cix,sky1-system-control", "syscon",
+				     "simple-mfd";
+			reg = <0x0 0x4160000 0x0 0x100>;
+			#reset-cells = <1>;
+		};
+
 		iomuxc: pinctrl@4170000 {
 			compatible = "cix,sky1-pinctrl";
 			reg = <0x0 0x04170000 0x0 0x1000>;
@@ -568,6 +575,13 @@ ppi_partition1: interrupt-partition-1 {
 			};
 		};
 
+		s5_syscon: s5-syscon@16000000 {
+			compatible = "cix,sky1-s5-system-control", "syscon",
+				     "simple-mfd";
+			reg = <0x0 0x16000000 0x0 0x1000>;
+			#reset-cells = <1>;
+		};
+
 		iomuxc_s5: pinctrl@16007000 {
 			compatible = "cix,sky1-pinctrl-s5";
 			reg = <0x0 0x16007000 0x0 0x1000>;
Signature · 1 line
2.49.0