Skip to contentSkip to conversation

reset: Add Broadcom STB RESCAL reset controller

PATCH In review Florian Fainelli 3 participants 5 messages Jan 3, 2020 – Jan 6, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v3 cover reset: Add Broadcom STB RESCAL reset controller

Hi Philipp,

This patch series adds support for the BCM7216 RESCAL reset controller which is necessary to initialize SATA and PCIe0/1 on that chip.

Please let us know if you have any comments. Thanks!

Changes in v3:

- indented "base" variable with a space
- return ret directly out of readl_poll_timeout()
- removed additional register read after write, not necessary
- removed call to platform_set_drvdata, unnecessary either
- corrected Jim's email in Signed-off-by in patch #2

Changes in v2:

- binding document is in YAML format per Rob's suggestion
- indented bit definitions the same way for all definitions
- moved reset logic to the .reset() callback
- removed the XOR operation which is not necessary after clarifying with Jim that this was not necessary
- use readl_poll_timeout()

Jim Quinlan (2):
dt-bindings: reset: Document BCM7216 RESCAL reset controller
reset: Add Broadcom STB RESCAL reset controller

 .../reset/brcm,bcm7216-pcie-sata-rescal.yaml  |  37 ++++++
 drivers/reset/Kconfig                         |   7 ++
 drivers/reset/Makefile                        |   1 +
 drivers/reset/reset-brcmstb-rescal.c          | 107 ++++++++++++++++++
 4 files changed, 152 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/brcm,bcm7216-pcie-sata-rescal.yaml
 create mode 100644 drivers/reset/reset-brcmstb-rescal.c
Signature · 1 line
2.17.1
#1 lore raw

PATCH v3 1/2 dt-bindings: reset: Document BCM7216 RESCAL reset controller

From: Jim Quinlan <[email protected]>

BCM7216 has a special purpose RESCAL reset controller for its SATA and PCIe0/1 instances. This is a simple reset controller with #reset-cells set to 0.

[florian: Convert to YAML binding]
---
 .../reset/brcm,bcm7216-pcie-sata-rescal.yaml  | 37 +++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/brcm,bcm7216-pcie-sata-rescal.yaml
Documentation/devicetree/bindings/reset/brcm,bcm7216-pcie-sata-rescal.yaml new file +37 -0
new file mode 100644
index 000000000000..411bd76f1b64
@@ -0,0 +1,37 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+# Copyright 2020 Broadcom
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/reset/brcm,bcm7216-pcie-sata-rescal.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: BCM7216 RESCAL reset controller
+
+description: This document describes the BCM7216 RESCAL reset controller which is responsible for controlling the reset of the SATA and PCIe0/1 instances on BCM7216.
+
+maintainers:
+  - Florian Fainelli <[email protected]>
+  - Jim Quinlan <[email protected]>
+
+properties:
+  compatible:
+    const: brcm,bcm7216-pcie-sata-rescal
+
+  reg:
+    maxItems: 1
+
+  "#reset-cells":
+    const: 0
+
+required:
+  - compatible
+  - reg
+  - "#reset-cells"
+
+examples:
+  - |
+    reset-controller@8b2c800 {
+          compatible = "brcm,bcm7216-pcie-sata-rescal";
+          reg = <0x8b2c800 0x10>;
+          #reset-cells = <0>;
+    };
Signature · 1 line
2.17.1
maintainer Reviewed-by on v3 1/2
#2 lore raw

Re: [PATCH v3 1/2] dt-bindings: reset: Document BCM7216 RESCAL reset controller

Quoted 6 lines · Florian Fainelli

From: Jim Quinlan <[email protected]>

BCM7216 has a special purpose RESCAL reset controller for its SATA and PCIe0/1 instances. This is a simple reset controller with #reset-cells set to 0.

Quoted 8 lines
[florian: Convert to YAML binding]
---
 .../reset/brcm,bcm7216-pcie-sata-rescal.yaml  | 37 +++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/brcm,bcm7216-pcie-sata-rescal.yaml
#3 lore raw

PATCH v3 2/2 reset: Add Broadcom STB RESCAL reset controller

In reply to Florian Fainelli

From: Jim Quinlan <[email protected]>

On BCM7216 there is a special purpose reset controller named RESCAL (reset calibration) which is necessary for SATA and PCIe0/1 to operate correctly. This commit adds support for such a reset controller to be available.

---
 drivers/reset/Kconfig                |   7 ++
 drivers/reset/Makefile               |   1 +
 drivers/reset/reset-brcmstb-rescal.c | 107 +++++++++++++++++++++++++++
 3 files changed, 115 insertions(+)
 create mode 100644 drivers/reset/reset-brcmstb-rescal.c
drivers/reset/Kconfig +7 -0
index 12f5c897788d..b7cc0a2049d9 100644
@@ -49,6 +49,13 @@ config RESET_BRCMSTB
 	  This enables the reset controller driver for Broadcom STB SoCs using
 	  a SUN_TOP_CTRL_SW_INIT style controller.
 
+config RESET_BRCMSTB_RESCAL
+	bool "Broadcom STB RESCAL reset controller"
+	default ARCH_BRCMSTB || COMPILE_TEST
+	help
+	  This enables the RESCAL reset controller for SATA, PCIe0, or PCIe1 on
+	  BCM7216.
+
 config RESET_HSDK
 	bool "Synopsys HSDK Reset Driver"
 	depends on HAS_IOMEM
drivers/reset/Makefile +1 -0
index 00767c03f5f2..1e4291185c52 100644
@@ -8,6 +8,7 @@ obj-$(CONFIG_RESET_ATH79) += reset-ath79.o
 obj-$(CONFIG_RESET_AXS10X) += reset-axs10x.o
 obj-$(CONFIG_RESET_BERLIN) += reset-berlin.o
 obj-$(CONFIG_RESET_BRCMSTB) += reset-brcmstb.o
+obj-$(CONFIG_RESET_BRCMSTB_RESCAL) += reset-brcmstb-rescal.o
 obj-$(CONFIG_RESET_HSDK) += reset-hsdk.o
 obj-$(CONFIG_RESET_IMX7) += reset-imx7.o
 obj-$(CONFIG_RESET_LANTIQ) += reset-lantiq.o
drivers/reset/reset-brcmstb-rescal.c new file +107 -0

107 lines not on this page · raw message

Signature · 1 line
2.17.1
maintainer
#4 lore raw
In reply to Florian Fainelli

Hi Florian,

Quoted 7 lines · Florian Fainelli

Hi Philipp,

This patch series adds support for the BCM7216 RESCAL reset controller which is necessary to initialize SATA and PCIe0/1 on that chip.

Please let us know if you have any comments. Thanks!

Quoted 7 lines

Changes in v3:

- indented "base" variable with a space
- return ret directly out of readl_poll_timeout()
- removed additional register read after write, not necessary
- removed call to platform_set_drvdata, unnecessary either
- corrected Jim's email in Signed-off-by in patch #2

Thank you, both applied to reset/next.

regards
Philipp