devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] mips: realtek: Add reboot support
@ 2024-09-13  2:49 Chris Packham
  2024-09-13  2:49 ` [PATCH v2 1/2] dt-bindings: mfd: Add Realtek switch Chris Packham
  2024-09-13  2:49 ` [PATCH v2 2/2] mips: dts: realtek: Add syscon-reboot node Chris Packham
  0 siblings, 2 replies; 4+ messages in thread
From: Chris Packham @ 2024-09-13  2:49 UTC (permalink / raw)
  To: lee, robh, krzk+dt, conor+dt, tsbogend, devicetree, linux-kernel,
	linux-mips
  Cc: Chris Packham

The system reboot on the cameo-rtl9302c (and presumably many other boards based
on the realtek reference design) is connected via the switch reset register
(RST_GLB_CTRL_0).

Because the switch register block encompasses a number of functions that would
normally be separate perhipherals I've represented it as a syscon node. Right
now the only peripheral I've added is the reset (using syscon-reboot). The
binding and syscon node will be expanded in the future to add some additional
functions (e.g. I2C, GPIO, MDIO).

Chris Packham (2):
  dt-bindings: mfd: Add Realtek switch
  mips: dts: realtek: Add syscon-reboot node

 .../bindings/mfd/realtek,rtl9302c-switch.yaml | 50 +++++++++++++++++++
 arch/mips/boot/dts/realtek/rtl930x.dtsi       | 11 ++++
 2 files changed, 61 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/realtek,rtl9302c-switch.yaml

-- 
2.46.0


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

* [PATCH v2 1/2] dt-bindings: mfd: Add Realtek switch
  2024-09-13  2:49 [PATCH v2 0/2] mips: realtek: Add reboot support Chris Packham
@ 2024-09-13  2:49 ` Chris Packham
  2024-09-13  4:19   ` Rob Herring (Arm)
  2024-09-13  2:49 ` [PATCH v2 2/2] mips: dts: realtek: Add syscon-reboot node Chris Packham
  1 sibling, 1 reply; 4+ messages in thread
From: Chris Packham @ 2024-09-13  2:49 UTC (permalink / raw)
  To: lee, robh, krzk+dt, conor+dt, tsbogend, devicetree, linux-kernel,
	linux-mips
  Cc: Chris Packham

Add device tree schema for the Realtek switch. Currently the only
supported feature is the syscon-reboot which is needed to be able to
reboot the board.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---

Notes:
    Changes in v2:
    - use filename that matches the compatible
    - put maintainers after title
    - remove unnecessary label in example
    - Rework description to focus on what is implemented rather than what
      may be implemented in the future.

 .../bindings/mfd/realtek,rtl9302c-switch.yaml | 50 +++++++++++++++++++
 1 file changed, 50 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/realtek,rtl9302c-switch.yaml

diff --git a/Documentation/devicetree/bindings/mfd/realtek,rtl9302c-switch.yaml b/Documentation/devicetree/bindings/mfd/realtek,rtl9302c-switch.yaml
new file mode 100644
index 000000000000..902750d33bea
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/realtek,rtl9302c-switch.yaml
@@ -0,0 +1,50 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/realtek,switch.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Realtek Switch with Internal CPU
+
+maintainers:
+  - Chris Packham <chris.packham@alliedtelesis.co.nz>
+
+description:
+  The RTL9302 is an Ethernet switch with an integrated CPU. A number of
+  different peripherals are accessed through a common register block,
+  represented here as a syscon node.
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - realtek,rtl9302c-switch
+      - const: syscon
+      - const: simple-mfd
+
+  reg:
+    maxItems: 1
+
+  reboot:
+    $ref: /schemas/power/reset/syscon-reboot.yaml#
+
+required:
+  - compatible
+  - reg
+  - reboot
+
+additionalProperties: false
+
+examples:
+  - |
+    ethernet-switch@1b000000 {
+      compatible = "realtek,rtl9302c-switch", "syscon", "simple-mfd";
+      reg = <0x1b000000 0x10000>;
+
+      reboot {
+        compatible = "syscon-reboot";
+        offset = <0x0c>;
+        value = <0x01>;
+      };
+    };
+
-- 
2.46.0


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

* [PATCH v2 2/2] mips: dts: realtek: Add syscon-reboot node
  2024-09-13  2:49 [PATCH v2 0/2] mips: realtek: Add reboot support Chris Packham
  2024-09-13  2:49 ` [PATCH v2 1/2] dt-bindings: mfd: Add Realtek switch Chris Packham
@ 2024-09-13  2:49 ` Chris Packham
  1 sibling, 0 replies; 4+ messages in thread
From: Chris Packham @ 2024-09-13  2:49 UTC (permalink / raw)
  To: lee, robh, krzk+dt, conor+dt, tsbogend, devicetree, linux-kernel,
	linux-mips
  Cc: Chris Packham

The board level reset on systems using the RTL9302 can be driven via the
switch. Use a syscon-reboot node to represent this.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---

Notes:
    Changes in v2:
    - drop redundant status = "okay"

 arch/mips/boot/dts/realtek/rtl930x.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/mips/boot/dts/realtek/rtl930x.dtsi b/arch/mips/boot/dts/realtek/rtl930x.dtsi
index f271940f82be..cf1b38b6c353 100644
--- a/arch/mips/boot/dts/realtek/rtl930x.dtsi
+++ b/arch/mips/boot/dts/realtek/rtl930x.dtsi
@@ -29,6 +29,17 @@ lx_clk: clock-175mhz {
 		#clock-cells = <0>;
 		clock-frequency  = <175000000>;
 	};
+
+	switch0: switch@1b000000 {
+		compatible = "realtek,rtl9302c-switch", "syscon", "simple-mfd";
+		reg = <0x1b000000 0x10000>;
+
+		reboot {
+			compatible = "syscon-reboot";
+			offset = <0x0c>;
+			value = <0x01>;
+		};
+	};
 };
 
 &soc {
-- 
2.46.0


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

* Re: [PATCH v2 1/2] dt-bindings: mfd: Add Realtek switch
  2024-09-13  2:49 ` [PATCH v2 1/2] dt-bindings: mfd: Add Realtek switch Chris Packham
@ 2024-09-13  4:19   ` Rob Herring (Arm)
  0 siblings, 0 replies; 4+ messages in thread
From: Rob Herring (Arm) @ 2024-09-13  4:19 UTC (permalink / raw)
  To: Chris Packham
  Cc: tsbogend, conor+dt, devicetree, lee, linux-mips, linux-kernel,
	krzk+dt


On Fri, 13 Sep 2024 14:49:47 +1200, Chris Packham wrote:
> Add device tree schema for the Realtek switch. Currently the only
> supported feature is the syscon-reboot which is needed to be able to
> reboot the board.
> 
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> ---
> 
> Notes:
>     Changes in v2:
>     - use filename that matches the compatible
>     - put maintainers after title
>     - remove unnecessary label in example
>     - Rework description to focus on what is implemented rather than what
>       may be implemented in the future.
> 
>  .../bindings/mfd/realtek,rtl9302c-switch.yaml | 50 +++++++++++++++++++
>  1 file changed, 50 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/mfd/realtek,rtl9302c-switch.yaml
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mfd/realtek,rtl9302c-switch.yaml: $id: Cannot determine base path from $id, relative path/filename doesn't match actual path or filename
 	 $id: http://devicetree.org/schemas/mfd/realtek,switch.yaml
 	file: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mfd/realtek,rtl9302c-switch.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20240913024948.1317786-2-chris.packham@alliedtelesis.co.nz

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.


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

end of thread, other threads:[~2024-09-13  4:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-13  2:49 [PATCH v2 0/2] mips: realtek: Add reboot support Chris Packham
2024-09-13  2:49 ` [PATCH v2 1/2] dt-bindings: mfd: Add Realtek switch Chris Packham
2024-09-13  4:19   ` Rob Herring (Arm)
2024-09-13  2:49 ` [PATCH v2 2/2] mips: dts: realtek: Add syscon-reboot node Chris Packham

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