Skip to contentSkip to conversation

bmips: add bcm6345 reset controller support

PATCH Superseded Álvaro Fernández Rojas 5 participants 68 messages Jun 9, 2020 – Jun 14, 2020

Subsystems (4)

v1 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

cover bmips: add bcm6345 reset controller support

BCM63xx SoCs have a reset controller for certain components.

Álvaro Fernández Rojas (7):
mips: bmips: select ARCH_HAS_RESET_CONTROLLER
dt-bindings: reset: add BCM6345 reset controller bindings
reset: add BCM6345 reset controller driver
mips: bmips: dts: add BCM6328 reset controller support
mips: bmips: dts: add BCM6358 reset controller support
mips: bmips: dts: add BCM6362 reset controller support
mips: bmips: dts: add BCM6368 reset controller support

 .../bindings/reset/brcm,bcm6345-reset.yaml    |  37 +++++
 arch/mips/Kconfig                             |   1 +
 arch/mips/boot/dts/brcm/bcm6328.dtsi          |   6 +
 arch/mips/boot/dts/brcm/bcm6358.dtsi          |   6 +
 arch/mips/boot/dts/brcm/bcm6362.dtsi          |   6 +
 arch/mips/boot/dts/brcm/bcm6368.dtsi          |   6 +
 drivers/reset/Kconfig                         |   7 +
 drivers/reset/Makefile                        |   1 +
 drivers/reset/reset-bcm6345.c                 | 149 ++++++++++++++++++
 9 files changed, 219 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/brcm,bcm6345-reset.yaml
 create mode 100644 drivers/reset/reset-bcm6345.c
Signature · 1 line
2.26.2
#1 lore raw

PATCH 1/7 mips: bmips: select ARCH_HAS_RESET_CONTROLLER

This allows to add reset controllers support.

---
 arch/mips/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/mips/Kconfig +1 -0
index 9dc08ee3d6b9..e82586e7719c 100644
@@ -229,6 +229,7 @@ config ATH79
 
 config BMIPS_GENERIC
 	bool "Broadcom Generic BMIPS kernel"
+	select ARCH_HAS_RESET_CONTROLLER
 	select ARCH_HAS_SYNC_DMA_FOR_CPU_ALL
 	select ARCH_HAS_PHYS_TO_DMA
 	select BOOT_RAW
Signature · 1 line
2.26.2
#2 lore raw

PATCH 2/7 dt-bindings: reset: add BCM6345 reset controller bindings

In reply to Álvaro Fernández Rojas

Add support for resetting blocks through the Linux reset controller subsystem for BCM63xx SoCs.

---
 .../bindings/reset/brcm,bcm6345-reset.yaml    | 37 +++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/brcm,bcm6345-reset.yaml
Documentation/devicetree/bindings/reset/brcm,bcm6345-reset.yaml new file +37 -0
new file mode 100644
index 000000000000..eb3f2182e631
@@ -0,0 +1,37 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/reset/brcm,bcm6345-reset.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: BCM6345 reset controller
+
+description: This document describes the BCM6345 reset controller.
+
+maintainers:
+  - Álvaro Fernández Rojas <[email protected]>
+
+properties:
+  compatible:
+    const: brcm,bcm6345-reset
+
+  reg:
+    maxItems: 2
+
+  "#reset-cells":
+    const: 1
+
+required:
+  - compatible
+  - reg
+  - "#reset-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    reset-controller@10000010 {
+      compatible = "brcm,bcm6345-reset";
+      reg = <0x10000010 0x4>;
+      #reset-cells = <1>;
+    };
Signature · 1 line
2.26.2
#3 lore raw

PATCH 3/7 reset: add BCM6345 reset controller driver

In reply to Álvaro Fernández Rojas

Add support for resetting blocks through the Linux reset controller subsystem for BCM63xx SoCs.

---
 drivers/reset/Kconfig         |   7 ++
 drivers/reset/Makefile        |   1 +
 drivers/reset/reset-bcm6345.c | 149 ++++++++++++++++++++++++++++++++++
 3 files changed, 157 insertions(+)
 create mode 100644 drivers/reset/reset-bcm6345.c
drivers/reset/Kconfig +7 -0
index d9efbfd29646..9f1da978cef6 100644
@@ -41,6 +41,13 @@ config RESET_BERLIN
 	help
 	  This enables the reset controller driver for Marvell Berlin SoCs.
 
+config RESET_BCM6345
+	bool "BCM6345 Reset Controller"
+	depends on BMIPS_GENERIC || COMPILE_TEST
+	default BMIPS_GENERIC
+	help
+	  This enables the reset controller driver for BCM6345 SoCs.
+
 config RESET_BRCMSTB
 	tristate "Broadcom STB reset controller"
 	depends on ARCH_BRCMSTB || COMPILE_TEST
drivers/reset/Makefile +1 -0
index 249ed357c997..e642aae42f0f 100644
@@ -6,6 +6,7 @@ obj-$(CONFIG_ARCH_TEGRA) += tegra/
 obj-$(CONFIG_RESET_A10SR) += reset-a10sr.o
 obj-$(CONFIG_RESET_ATH79) += reset-ath79.o
 obj-$(CONFIG_RESET_AXS10X) += reset-axs10x.o
+obj-$(CONFIG_RESET_BCM6345) += reset-bcm6345.o
 obj-$(CONFIG_RESET_BERLIN) += reset-berlin.o
 obj-$(CONFIG_RESET_BRCMSTB) += reset-brcmstb.o
 obj-$(CONFIG_RESET_BRCMSTB_RESCAL) += reset-brcmstb-rescal.o
drivers/reset/reset-bcm6345.c new file +149 -0

149 lines not on this page · raw message

Signature · 1 line
2.26.2
maintainer
#4 lore raw

Re: [PATCH 3/7] reset: add BCM6345 reset controller driver

Hi Álvaro,

Quoted 114 lines · Álvaro Fernández Rojas

Add support for resetting blocks through the Linux reset controller subsystem for BCM63xx SoCs.

---
 drivers/reset/Kconfig         |   7 ++
 drivers/reset/Makefile        |   1 +
 drivers/reset/reset-bcm6345.c | 149 ++++++++++++++++++++++++++++++++++
 3 files changed, 157 insertions(+)
 create mode 100644 drivers/reset/reset-bcm6345.c
drivers/reset/Kconfig +7 -0
index d9efbfd29646..9f1da978cef6 100644
@@ -41,6 +41,13 @@ config RESET_BERLIN
 	help
 	  This enables the reset controller driver for Marvell Berlin SoCs.
 
+config RESET_BCM6345
+	bool "BCM6345 Reset Controller"
+	depends on BMIPS_GENERIC || COMPILE_TEST
+	default BMIPS_GENERIC
+	help
+	  This enables the reset controller driver for BCM6345 SoCs.
+
 config RESET_BRCMSTB
 	tristate "Broadcom STB reset controller"
 	depends on ARCH_BRCMSTB || COMPILE_TEST
drivers/reset/Makefile +1 -0
index 249ed357c997..e642aae42f0f 100644
@@ -6,6 +6,7 @@ obj-$(CONFIG_ARCH_TEGRA) += tegra/
 obj-$(CONFIG_RESET_A10SR) += reset-a10sr.o
 obj-$(CONFIG_RESET_ATH79) += reset-ath79.o
 obj-$(CONFIG_RESET_AXS10X) += reset-axs10x.o
+obj-$(CONFIG_RESET_BCM6345) += reset-bcm6345.o
 obj-$(CONFIG_RESET_BERLIN) += reset-berlin.o
 obj-$(CONFIG_RESET_BRCMSTB) += reset-brcmstb.o
 obj-$(CONFIG_RESET_BRCMSTB_RESCAL) += reset-brcmstb-rescal.o
drivers/reset/reset-bcm6345.c new file +67 -0
new file mode 100644
index 000000000000..088b7fdb896b
@@ -0,0 +1,149 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * BCM6345 Reset Controller Driver
+ *
+ * Copyright (C) 2020 Álvaro Fernández Rojas <[email protected]>
+ */
+
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/mod_devicetable.h>
+#include <linux/platform_device.h>
+#include <linux/reset-controller.h>
+
+#define BCM6345_RESET_NUM		32
+#define BCM6345_RESET_SLEEP_MIN_US	10000
+#define BCM6345_RESET_SLEEP_MAX_US	20000
+
+struct bcm6345_reset {
+	struct reset_controller_dev rcdev;
+	void __iomem *base;
+	spinlock_t lock;
+};
+
+static int bcm6345_reset_update(struct bcm6345_reset *bcm6345_reset,
+				unsigned long id, bool assert)
+{
+	uint32_t val;
+
+	val = __raw_readl(bcm6345_reset->base);
+	if (assert)
+		val &= ~BIT(id);
+	else
+		val |= BIT(id);
+	__raw_writel(val, bcm6345_reset->base);
+
+	return 0;
+}
+
+static int bcm6345_reset_assert(struct reset_controller_dev *rcdev,
+				unsigned long id)
+{
+	struct bcm6345_reset *bcm6345_reset =
+		container_of(rcdev, struct bcm6345_reset, rcdev);
+	unsigned long flags;
+
+	spin_lock_irqsave(&bcm6345_reset->lock, flags);
+	bcm6345_reset_update(bcm6345_reset, id, true);
+	spin_unlock_irqrestore(&bcm6345_reset->lock, flags);
+
+	return 0;
+}
+
+static int bcm6345_reset_deassert(struct reset_controller_dev *rcdev,
+				  unsigned long id)
+{
+	struct bcm6345_reset *bcm6345_reset =
+		container_of(rcdev, struct bcm6345_reset, rcdev);
+	unsigned long flags;
+
+	spin_lock_irqsave(&bcm6345_reset->lock, flags);
+	bcm6345_reset_update(bcm6345_reset, id, false);
+	spin_unlock_irqrestore(&bcm6345_reset->lock, flags);
+
+	return 0;
+}
+

drivers/reset/reset-bcm6345.c line 77

Quoted 10 lines
drivers/reset/reset-bcm6345.c new file +10 -0
+static int bcm6345_reset_reset(struct reset_controller_dev *rcdev,
+			       unsigned long id)
+{
+	struct bcm6345_reset *bcm6345_reset =
+		container_of(rcdev, struct bcm6345_reset, rcdev);
+	unsigned long flags;
+
+	spin_lock_irqsave(&bcm6345_reset->lock, flags);
+	usleep_range(BCM6345_RESET_SLEEP_MIN_US,
+		     BCM6345_RESET_SLEEP_MAX_US);

What is the purpose of sleeping before reset assertion?

If you can do without this, with I think this driver could be made to use reset-simple.

regards
Philipp

#5 lore raw

Re: [PATCH 3/7] reset: add BCM6345 reset controller driver

Hi Philipp,

Quoted 123 lines · Philipp Zabel

Hi Álvaro,

Quoted 118 lines · Álvaro Fernández Rojas

Add support for resetting blocks through the Linux reset controller subsystem for BCM63xx SoCs.

---

drivers/reset/Kconfig         |   7 ++
drivers/reset/Makefile        |   1 +
drivers/reset/reset-bcm6345.c | 149 ++++++++++++++++++++++++++++++++++
3 files changed, 157 insertions(+)

create mode 100644 drivers/reset/reset-bcm6345.c

drivers/reset/Kconfig +7 -0
index d9efbfd29646..9f1da978cef6 100644
@@ -41,6 +41,13 @@ config RESET_BERLIN
 	help
 	  This enables the reset controller driver for Marvell Berlin SoCs.
 
+config RESET_BCM6345
+	bool "BCM6345 Reset Controller"
+	depends on BMIPS_GENERIC || COMPILE_TEST
+	default BMIPS_GENERIC
+	help
+	  This enables the reset controller driver for BCM6345 SoCs.
+

config RESET_BRCMSTB

	tristate "Broadcom STB reset controller"
	depends on ARCH_BRCMSTB || COMPILE_TEST
drivers/reset/Makefile +0 -0
index 249ed357c997..e642aae42f0f 100644
@@ -6,6 +6,7 @@ obj-$(CONFIG_ARCH_TEGRA) += tegra/

obj-$(CONFIG_RESET_A10SR) += reset-a10sr.o obj-$(CONFIG_RESET_ATH79) += reset-ath79.o obj-$(CONFIG_RESET_AXS10X) += reset-axs10x.o +obj-$(CONFIG_RESET_BCM6345) += reset-bcm6345.o obj-$(CONFIG_RESET_BERLIN) += reset-berlin.o obj-$(CONFIG_RESET_BRCMSTB) += reset-brcmstb.o obj-$(CONFIG_RESET_BRCMSTB_RESCAL) += reset-brcmstb-rescal.o

drivers/reset/reset-bcm6345.c new file +71 -0
new file mode 100644
index 000000000000..088b7fdb896b
@@ -0,0 +1,149 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * BCM6345 Reset Controller Driver
+ *
+ * Copyright (C) 2020 Álvaro Fernández Rojas <[email protected]>
+ */
+
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/mod_devicetable.h>
+#include <linux/platform_device.h>
+#include <linux/reset-controller.h>
+
+#define BCM6345_RESET_NUM		32
+#define BCM6345_RESET_SLEEP_MIN_US	10000
+#define BCM6345_RESET_SLEEP_MAX_US	20000
+
+struct bcm6345_reset {
+	struct reset_controller_dev rcdev;
+	void __iomem *base;
+	spinlock_t lock;
+};
+
+static int bcm6345_reset_update(struct bcm6345_reset *bcm6345_reset,
+				unsigned long id, bool assert)
+{
+	uint32_t val;
+
+	val = __raw_readl(bcm6345_reset->base);
+	if (assert)
+		val &= ~BIT(id);
+	else
+		val |= BIT(id);
+	__raw_writel(val, bcm6345_reset->base);
+
+	return 0;
+}
+
+static int bcm6345_reset_assert(struct reset_controller_dev *rcdev,
+				unsigned long id)
+{
+	struct bcm6345_reset *bcm6345_reset =
+		container_of(rcdev, struct bcm6345_reset, rcdev);
+	unsigned long flags;
+
+	spin_lock_irqsave(&bcm6345_reset->lock, flags);
+	bcm6345_reset_update(bcm6345_reset, id, true);
+	spin_unlock_irqrestore(&bcm6345_reset->lock, flags);
+
+	return 0;
+}
+
+static int bcm6345_reset_deassert(struct reset_controller_dev *rcdev,
+				  unsigned long id)
+{
+	struct bcm6345_reset *bcm6345_reset =
+		container_of(rcdev, struct bcm6345_reset, rcdev);
+	unsigned long flags;
+
+	spin_lock_irqsave(&bcm6345_reset->lock, flags);
+	bcm6345_reset_update(bcm6345_reset, id, false);
+	spin_unlock_irqrestore(&bcm6345_reset->lock, flags);
+
+	return 0;
+}
+
+static int bcm6345_reset_reset(struct reset_controller_dev *rcdev,
+			       unsigned long id)
+{
+	struct bcm6345_reset *bcm6345_reset =
Quoted 8 lines

drivers/reset/reset-bcm6345.c line 77

Quoted 6 lines
drivers/reset/reset-bcm6345.c new file +6 -0
+		container_of(rcdev, struct bcm6345_reset, rcdev);
+	unsigned long flags;
+
+	spin_lock_irqsave(&bcm6345_reset->lock, flags);
+	usleep_range(BCM6345_RESET_SLEEP_MIN_US,
+		     BCM6345_RESET_SLEEP_MAX_US);

What is the purpose of sleeping before reset assertion?

None, I must have introduced that for testing something and then I forgot to remove it. Sorry for that...

Quoted 3 lines

If you can do without this, with I think this driver could be made to use reset-simple.

Yes, but only if I can add reset support with a configurable sleep range to reset-simple. Is this possible?

Quoted 3 lines

regards
Philipp

Best regards,
Álvaro.

maintainer
#6 lore raw

Re: [PATCH 3/7] reset: add BCM6345 reset controller driver

Hi Álvaro,

Quoted 134 lines · Álvaro Fernández Rojas

Hi Philipp,

Quoted 123 lines · Philipp Zabel

Hi Álvaro,

Quoted 118 lines · Álvaro Fernández Rojas

Add support for resetting blocks through the Linux reset controller subsystem for BCM63xx SoCs.

---

drivers/reset/Kconfig         |   7 ++
drivers/reset/Makefile        |   1 +
drivers/reset/reset-bcm6345.c | 149 ++++++++++++++++++++++++++++++++++
3 files changed, 157 insertions(+)

create mode 100644 drivers/reset/reset-bcm6345.c

drivers/reset/Kconfig +7 -0
index d9efbfd29646..9f1da978cef6 100644
@@ -41,6 +41,13 @@ config RESET_BERLIN
 	help
 	  This enables the reset controller driver for Marvell Berlin SoCs.
 
+config RESET_BCM6345
+	bool "BCM6345 Reset Controller"
+	depends on BMIPS_GENERIC || COMPILE_TEST
+	default BMIPS_GENERIC
+	help
+	  This enables the reset controller driver for BCM6345 SoCs.
+

config RESET_BRCMSTB

	tristate "Broadcom STB reset controller"
	depends on ARCH_BRCMSTB || COMPILE_TEST
drivers/reset/Makefile +0 -0
index 249ed357c997..e642aae42f0f 100644
@@ -6,6 +6,7 @@ obj-$(CONFIG_ARCH_TEGRA) += tegra/

obj-$(CONFIG_RESET_A10SR) += reset-a10sr.o obj-$(CONFIG_RESET_ATH79) += reset-ath79.o obj-$(CONFIG_RESET_AXS10X) += reset-axs10x.o +obj-$(CONFIG_RESET_BCM6345) += reset-bcm6345.o obj-$(CONFIG_RESET_BERLIN) += reset-berlin.o obj-$(CONFIG_RESET_BRCMSTB) += reset-brcmstb.o obj-$(CONFIG_RESET_BRCMSTB_RESCAL) += reset-brcmstb-rescal.o

drivers/reset/reset-bcm6345.c new file +71 -0
new file mode 100644
index 000000000000..088b7fdb896b
@@ -0,0 +1,149 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * BCM6345 Reset Controller Driver
+ *
+ * Copyright (C) 2020 Álvaro Fernández Rojas <[email protected]>
+ */
+
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/mod_devicetable.h>
+#include <linux/platform_device.h>
+#include <linux/reset-controller.h>
+
+#define BCM6345_RESET_NUM		32
+#define BCM6345_RESET_SLEEP_MIN_US	10000
+#define BCM6345_RESET_SLEEP_MAX_US	20000
+
+struct bcm6345_reset {
+	struct reset_controller_dev rcdev;
+	void __iomem *base;
+	spinlock_t lock;
+};
+
+static int bcm6345_reset_update(struct bcm6345_reset *bcm6345_reset,
+				unsigned long id, bool assert)
+{
+	uint32_t val;
+
+	val = __raw_readl(bcm6345_reset->base);
+	if (assert)
+		val &= ~BIT(id);
+	else
+		val |= BIT(id);
+	__raw_writel(val, bcm6345_reset->base);
+
+	return 0;
+}
+
+static int bcm6345_reset_assert(struct reset_controller_dev *rcdev,
+				unsigned long id)
+{
+	struct bcm6345_reset *bcm6345_reset =
+		container_of(rcdev, struct bcm6345_reset, rcdev);
+	unsigned long flags;
+
+	spin_lock_irqsave(&bcm6345_reset->lock, flags);
+	bcm6345_reset_update(bcm6345_reset, id, true);
+	spin_unlock_irqrestore(&bcm6345_reset->lock, flags);
+
+	return 0;
+}
+
+static int bcm6345_reset_deassert(struct reset_controller_dev *rcdev,
+				  unsigned long id)
+{
+	struct bcm6345_reset *bcm6345_reset =
+		container_of(rcdev, struct bcm6345_reset, rcdev);
+	unsigned long flags;
+
+	spin_lock_irqsave(&bcm6345_reset->lock, flags);
+	bcm6345_reset_update(bcm6345_reset, id, false);
+	spin_unlock_irqrestore(&bcm6345_reset->lock, flags);
+
+	return 0;
+}
+
+static int bcm6345_reset_reset(struct reset_controller_dev *rcdev,
+			       unsigned long id)
+{
+	struct bcm6345_reset *bcm6345_reset =
Quoted 8 lines

drivers/reset/reset-bcm6345.c line 77

Quoted 6 lines
drivers/reset/reset-bcm6345.c new file +6 -0
+		container_of(rcdev, struct bcm6345_reset, rcdev);
+	unsigned long flags;
+
+	spin_lock_irqsave(&bcm6345_reset->lock, flags);
+	usleep_range(BCM6345_RESET_SLEEP_MIN_US,
+		     BCM6345_RESET_SLEEP_MAX_US);

What is the purpose of sleeping before reset assertion?

Quoted 6 lines

None, I must have introduced that for testing something and then I forgot to remove it. Sorry for that...

Quoted 2 lines

If you can do without this, with I think this driver could be made to use reset-simple.

Yes, but only if I can add reset support with a configurable sleep range to reset-simple. Is this possible?

I should have mentioned, support for this is on the reset/next branch:

git://git.pengutronix.de/pza/linux.git reset/next

regards
Philipp

#7 lore raw

Re: [PATCH 3/7] reset: add BCM6345 reset controller driver

Hello Philipp,

Quoted 141 lines · Philipp Zabel

Hi Álvaro,

Quoted 136 lines · Álvaro Fernández Rojas

Hi Philipp,

Quoted 123 lines · Philipp Zabel

Hi Álvaro,

Quoted 118 lines · Álvaro Fernández Rojas

Add support for resetting blocks through the Linux reset controller subsystem for BCM63xx SoCs.

---

drivers/reset/Kconfig         |   7 ++
drivers/reset/Makefile        |   1 +
drivers/reset/reset-bcm6345.c | 149 ++++++++++++++++++++++++++++++++++
3 files changed, 157 insertions(+)

create mode 100644 drivers/reset/reset-bcm6345.c

drivers/reset/Kconfig +7 -0
index d9efbfd29646..9f1da978cef6 100644
@@ -41,6 +41,13 @@ config RESET_BERLIN
 	help
 	  This enables the reset controller driver for Marvell Berlin SoCs.
 
+config RESET_BCM6345
+	bool "BCM6345 Reset Controller"
+	depends on BMIPS_GENERIC || COMPILE_TEST
+	default BMIPS_GENERIC
+	help
+	  This enables the reset controller driver for BCM6345 SoCs.
+

config RESET_BRCMSTB

	tristate "Broadcom STB reset controller"
	depends on ARCH_BRCMSTB || COMPILE_TEST
drivers/reset/Makefile +0 -0
index 249ed357c997..e642aae42f0f 100644
@@ -6,6 +6,7 @@ obj-$(CONFIG_ARCH_TEGRA) += tegra/

obj-$(CONFIG_RESET_A10SR) += reset-a10sr.o obj-$(CONFIG_RESET_ATH79) += reset-ath79.o obj-$(CONFIG_RESET_AXS10X) += reset-axs10x.o +obj-$(CONFIG_RESET_BCM6345) += reset-bcm6345.o obj-$(CONFIG_RESET_BERLIN) += reset-berlin.o obj-$(CONFIG_RESET_BRCMSTB) += reset-brcmstb.o obj-$(CONFIG_RESET_BRCMSTB_RESCAL) += reset-brcmstb-rescal.o

drivers/reset/reset-bcm6345.c new file +71 -0
new file mode 100644
index 000000000000..088b7fdb896b
@@ -0,0 +1,149 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * BCM6345 Reset Controller Driver
+ *
+ * Copyright (C) 2020 Álvaro Fernández Rojas <[email protected]>
+ */
+
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/mod_devicetable.h>
+#include <linux/platform_device.h>
+#include <linux/reset-controller.h>
+
+#define BCM6345_RESET_NUM		32
+#define BCM6345_RESET_SLEEP_MIN_US	10000
+#define BCM6345_RESET_SLEEP_MAX_US	20000
+
+struct bcm6345_reset {
+	struct reset_controller_dev rcdev;
+	void __iomem *base;
+	spinlock_t lock;
+};
+
+static int bcm6345_reset_update(struct bcm6345_reset *bcm6345_reset,
+				unsigned long id, bool assert)
+{
+	uint32_t val;
+
+	val = __raw_readl(bcm6345_reset->base);
+	if (assert)
+		val &= ~BIT(id);
+	else
+		val |= BIT(id);
+	__raw_writel(val, bcm6345_reset->base);
+
+	return 0;
+}
+
+static int bcm6345_reset_assert(struct reset_controller_dev *rcdev,
+				unsigned long id)
+{
+	struct bcm6345_reset *bcm6345_reset =
+		container_of(rcdev, struct bcm6345_reset, rcdev);
+	unsigned long flags;
+
+	spin_lock_irqsave(&bcm6345_reset->lock, flags);
+	bcm6345_reset_update(bcm6345_reset, id, true);
+	spin_unlock_irqrestore(&bcm6345_reset->lock, flags);
+
+	return 0;
+}
+
+static int bcm6345_reset_deassert(struct reset_controller_dev *rcdev,
+				  unsigned long id)
+{
+	struct bcm6345_reset *bcm6345_reset =
+		container_of(rcdev, struct bcm6345_reset, rcdev);
+	unsigned long flags;
+
+	spin_lock_irqsave(&bcm6345_reset->lock, flags);
+	bcm6345_reset_update(bcm6345_reset, id, false);
+	spin_unlock_irqrestore(&bcm6345_reset->lock, flags);
+
+	return 0;
+}
+
+static int bcm6345_reset_reset(struct reset_controller_dev *rcdev,
+			       unsigned long id)
+{
+	struct bcm6345_reset *bcm6345_reset =
Quoted 8 lines

drivers/reset/reset-bcm6345.c line 77

Quoted 6 lines
drivers/reset/reset-bcm6345.c new file +6 -0
+		container_of(rcdev, struct bcm6345_reset, rcdev);
+	unsigned long flags;
+
+	spin_lock_irqsave(&bcm6345_reset->lock, flags);
+	usleep_range(BCM6345_RESET_SLEEP_MIN_US,
+		     BCM6345_RESET_SLEEP_MAX_US);

What is the purpose of sleeping before reset assertion?

None, I must have introduced that for testing something and then I forgot to remove it. Sorry for that...

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

If you can do without this, with I think this driver could be made to use reset-simple.

Yes, but only if I can add reset support with a configurable sleep range to reset-simple. Is this possible?

I should have mentioned, support for this is on the reset/next branch:

git://git.pengutronix.de/pza/linux.git reset/next

Yes, but reset_us was only added to reset_simple_data, so there’s no way to fill that value from reset_simple_devdata or device tree, right?

Quoted 3 lines

regards
Philipp

Regards,
Álvaro.

#8 lore raw

Re: [PATCH 3/7] reset: add BCM6345 reset controller driver

Quoted 10 lines · Álvaro Fernández Rojas
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

If you can do without this, with I think this driver could be made to use reset-simple.

Yes, but only if I can add reset support with a configurable sleep range to reset-simple. Is this possible?

I should have mentioned, support for this is on the reset/next branch:

git://git.pengutronix.de/pza/linux.git reset/next

Yes, but reset_us was only added to reset_simple_data, so there’s no way to fill that value from reset_simple_devdata or device tree, right?

Not that I can see, but you could certainly extend it here:

if (devdata) {
		reg_offset = devdata->reg_offset;
		if (devdata->nr_resets)
			data->rcdev.nr_resets = devdata->nr_resets;
		data->active_low = devdata->active_low;
		data->status_active_low = devdata->status_active_low;
	}

and have an appropriate devdata structure be provided for your compatible string:

+ { .compatible = "brcm,bcm6345-reset", .data = bcm6345_reset_devdata },

Signature · 1 line
Florian
#9 lore raw

Re: [PATCH 3/7] reset: add BCM6345 reset controller driver

Hi Florian,

Quoted 18 lines · Florian Fainelli
Quoted 10 lines · Álvaro Fernández Rojas
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

If you can do without this, with I think this driver could be made to use reset-simple.

Yes, but only if I can add reset support with a configurable sleep range to reset-simple. Is this possible?

I should have mentioned, support for this is on the reset/next branch:

git://git.pengutronix.de/pza/linux.git reset/next

Yes, but reset_us was only added to reset_simple_data, so there’s no way to fill that value from reset_simple_devdata or device tree, right?

Not that I can see, but you could certainly extend it here:

Quoted 7 lines
if (devdata) {
		reg_offset = devdata->reg_offset;
		if (devdata->nr_resets)
			data->rcdev.nr_resets = devdata->nr_resets;
		data->active_low = devdata->active_low;
		data->status_active_low = devdata->status_active_low;
	}

Yes, I would extend it there too, but I was just saying that it’s a bit strange that it was only added to reset_simple_data without any way to fill the value.

Quoted 7 lines

and have an appropriate devdata structure be provided for your compatible string:

(quoted diff) +1 -0
+	{ .compatible = "brcm,bcm6345-reset", .data = bcm6345_reset_devdata },
Signature · 1 line
Florian

Regards,
Álvaro.

maintainer
#10 lore raw

Re: [PATCH 3/7] reset: add BCM6345 reset controller driver

Hi Álvaro,

Quoted 28 lines · Álvaro Fernández Rojas

Hi Florian,

Quoted 18 lines · Florian Fainelli
Quoted 10 lines · Álvaro Fernández Rojas
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

If you can do without this, with I think this driver could be made to use reset-simple.

Yes, but only if I can add reset support with a configurable sleep range to reset-simple. Is this possible?

I should have mentioned, support for this is on the reset/next branch:

git://git.pengutronix.de/pza/linux.git reset/next

Yes, but reset_us was only added to reset_simple_data, so there’s no way to fill that value from reset_simple_devdata or device tree, right?

Not that I can see, but you could certainly extend it here:

Quoted 7 lines
if (devdata) {
		reg_offset = devdata->reg_offset;
		if (devdata->nr_resets)
			data->rcdev.nr_resets = devdata->nr_resets;
		data->active_low = devdata->active_low;
		data->status_active_low = devdata->status_active_low;
	}
Quoted 1 line

Yes, I would extend it there too,

You are right, reset_us is missing from reset_simple_devdata.

Quoted 2 lines

but I was just saying that it’s a bit strange that it was only added to reset_simple_data without any way to fill the value.

The patch was added for the benefit of drivers that register their own reset controller using reset_simple_data/ops, like sunxi or socfpga. This might be considered an oversight, but until now there was no user inside reset-simple.c.

regards
Philipp

#11 lore raw

PATCH 4/7 mips: bmips: dts: add BCM6328 reset controller support

In reply to Álvaro Fernández Rojas

BCM6328 SoCs have a reset controller for certain components.

---
 arch/mips/boot/dts/brcm/bcm6328.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/mips/boot/dts/brcm/bcm6328.dtsi +6 -0
index af860d06def6..590118cf5c12 100644
@@ -57,6 +57,12 @@ clkctl: clock-controller@10000004 {
 			#clock-cells = <1>;
 		};
 
+		periph_rst: reset-controller@10000010 {
+			compatible = "brcm,bcm6345-reset";
+			reg = <0x10000010 0x4>;
+			#reset-cells = <1>;
+		};
+
 		periph_intc: interrupt-controller@10000020 {
 			compatible = "brcm,bcm6345-l1-intc";
 			reg = <0x10000020 0x10>,
Signature · 1 line
2.26.2
#12 lore raw

PATCH 5/7 mips: bmips: dts: add BCM6358 reset controller support

In reply to Álvaro Fernández Rojas

BCM6358 SoCs have a reset controller for certain components.

---
 arch/mips/boot/dts/brcm/bcm6358.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/mips/boot/dts/brcm/bcm6358.dtsi +6 -0
index f21176cac038..9d93e7f5e6fc 100644
@@ -82,6 +82,12 @@ periph_intc: interrupt-controller@fffe000c {
 			interrupts = <2>, <3>;
 		};
 
+		periph_rst: reset-controller@fffe0034 {
+			compatible = "brcm,bcm6345-reset";
+			reg = <0xfffe0034 0x4>;
+			#reset-cells = <1>;
+		};
+
 		leds0: led-controller@fffe00d0 {
 			#address-cells = <1>;
 			#size-cells = <0>;
Signature · 1 line
2.26.2
#13 lore raw

PATCH 6/7 mips: bmips: dts: add BCM6362 reset controller support

In reply to Álvaro Fernández Rojas

BCM6362 SoCs have a reset controller for certain components.

---
 arch/mips/boot/dts/brcm/bcm6362.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/mips/boot/dts/brcm/bcm6362.dtsi +6 -0
index 8ae6981735b8..443af6b4c838 100644
@@ -70,6 +70,12 @@ reboot: syscon-reboot@10000008 {
 			mask = <0x1>;
 		};
 
+		periph_rst: reset-controller@10000010 {
+			compatible = "brcm,bcm6345-reset";
+			reg = <0x10000010 0x4>;
+			#reset-cells = <1>;
+		};
+
 		periph_intc: interrupt-controller@10000020 {
 			compatible = "brcm,bcm6345-l1-intc";
 			reg = <0x10000020 0x10>,
Signature · 1 line
2.26.2
#14 lore raw

PATCH 7/7 mips: bmips: dts: add BCM6368 reset controller support

In reply to Álvaro Fernández Rojas

BCM6368 SoCs have a reset controller for certain components.

---
 arch/mips/boot/dts/brcm/bcm6368.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/mips/boot/dts/brcm/bcm6368.dtsi +6 -0
index 449c167dd892..52c19f40b9cc 100644
@@ -70,6 +70,12 @@ reboot: syscon-reboot@10000008 {
 			mask = <0x1>;
 		};
 
+		periph_rst: reset-controller@10000010 {
+			compatible = "brcm,bcm6345-reset";
+			reg = <0x10000010 0x4>;
+			#reset-cells = <1>;
+		};
+
 		periph_intc: interrupt-controller@10000020 {
 			compatible = "brcm,bcm6345-l1-intc";
 			reg = <0x10000020 0x10>,
Signature · 1 line
2.26.2
#15 lore raw

v2 cover bmips: add bcm6345 reset controller support

In reply to Álvaro Fernández Rojas

BCM63xx SoCs have a reset controller for certain components.

v2: add compatibility to reset-simple instead of adding a new driver.

Álvaro Fernández Rojas (7):
mips: bmips: select ARCH_HAS_RESET_CONTROLLER
dt-bindings: reset: add BCM6345 reset controller bindings
drivers: reset: simple: add BCM6345 reset support
mips: bmips: dts: add BCM6328 reset controller support
mips: bmips: dts: add BCM6358 reset controller support
mips: bmips: dts: add BCM6362 reset controller support
mips: bmips: dts: add BCM6368 reset controller support

 .../bindings/reset/brcm,bcm6345-reset.yaml    | 37 +++++++++++++++++++
 arch/mips/Kconfig                             |  1 +
 arch/mips/boot/dts/brcm/bcm6328.dtsi          |  6 +++
 arch/mips/boot/dts/brcm/bcm6358.dtsi          |  6 +++
 arch/mips/boot/dts/brcm/bcm6362.dtsi          |  6 +++
 arch/mips/boot/dts/brcm/bcm6368.dtsi          |  6 +++
 drivers/reset/Kconfig                         |  3 +-
 drivers/reset/reset-simple.c                  |  1 +
 8 files changed, 65 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/reset/brcm,bcm6345-reset.yaml
Signature · 1 line
2.26.2
#16 lore raw

PATCH v2 1/7 mips: bmips: select ARCH_HAS_RESET_CONTROLLER

This allows to add reset controllers support.

---
v2: no changes

 arch/mips/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/mips/Kconfig +1 -0
index 9dc08ee3d6b9..e82586e7719c 100644
@@ -229,6 +229,7 @@ config ATH79
 
 config BMIPS_GENERIC
 	bool "Broadcom Generic BMIPS kernel"
+	select ARCH_HAS_RESET_CONTROLLER
 	select ARCH_HAS_SYNC_DMA_FOR_CPU_ALL
 	select ARCH_HAS_PHYS_TO_DMA
 	select BOOT_RAW
Signature · 1 line
2.26.2
#18 lore raw

PATCH v2 2/7 dt-bindings: reset: add BCM6345 reset controller bindings

In reply to Álvaro Fernández Rojas

Add support for resetting blocks through the Linux reset controller subsystem for BCM63xx SoCs.

---
v2: no changes

 .../bindings/reset/brcm,bcm6345-reset.yaml    | 37 +++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/brcm,bcm6345-reset.yaml
Documentation/devicetree/bindings/reset/brcm,bcm6345-reset.yaml new file +37 -0
new file mode 100644
index 000000000000..eb3f2182e631
@@ -0,0 +1,37 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/reset/brcm,bcm6345-reset.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: BCM6345 reset controller
+
+description: This document describes the BCM6345 reset controller.
+
+maintainers:
+  - Álvaro Fernández Rojas <[email protected]>
+
+properties:
+  compatible:
+    const: brcm,bcm6345-reset
+
+  reg:
+    maxItems: 2
+
+  "#reset-cells":
+    const: 1
+
+required:
+  - compatible
+  - reg
+  - "#reset-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    reset-controller@10000010 {
+      compatible = "brcm,bcm6345-reset";
+      reg = <0x10000010 0x4>;
+      #reset-cells = <1>;
+    };
Signature · 1 line
2.26.2
Reviewed-by on v2 2/7
#19 lore raw

Re: [PATCH v2 2/7] dt-bindings: reset: add BCM6345 reset controller bindings

Quoted 2 lines · Álvaro Fernández Rojas

Add support for resetting blocks through the Linux reset controller subsystem for BCM63xx SoCs.

The commit message should be paraphrasing part of your binding content, not necessarily describing why this is useful.

This looks good to me though:

Signature · 1 line
Florian
#20 lore raw

PATCH v2 3/7 drivers: reset: simple: add BCM6345 reset support

In reply to Álvaro Fernández Rojas

Add support for resetting blocks through the Linux reset controller subsystem for BCM63xx SoCs.

---
v2: add compatibility to reset-simple instead of adding a new driver.

 drivers/reset/Kconfig        | 3 ++-
 drivers/reset/reset-simple.c | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/reset/Kconfig +2 -1
index d9efbfd29646..84d29b585e9b 100644
@@ -153,7 +153,7 @@ config RESET_SCMI
 
 config RESET_SIMPLE
 	bool "Simple Reset Controller Driver" if COMPILE_TEST
-	default ARCH_AGILEX || ARCH_ASPEED || ARCH_BITMAIN || ARCH_REALTEK || ARCH_STM32 || ARCH_STRATIX10 || ARCH_SUNXI || ARCH_ZX || ARC
+	default ARCH_AGILEX || ARCH_ASPEED || ARCH_BITMAIN || ARCH_REALTEK || ARCH_STM32 || ARCH_STRATIX10 || ARCH_SUNXI || ARCH_ZX || ARC || BMIPS_GENERIC
 	help
 	  This enables a simple reset controller driver for reset lines that
 	  that can be asserted and deasserted by toggling bits in a contiguous,
@@ -163,6 +163,7 @@ config RESET_SIMPLE
 	   - Altera SoCFPGAs
 	   - ASPEED BMC SoCs
 	   - Bitmain BM1880 SoC
+	   - BMIPS (BCM6345)
 	   - Realtek SoCs
 	   - RCC reset controller in STM32 MCUs
 	   - Allwinner SoCs
drivers/reset/reset-simple.c +1 -0
index 067e7e7b34f1..c00bb65c0b70 100644
@@ -118,6 +118,7 @@ static const struct reset_simple_devdata reset_simple_active_low = {
 static const struct of_device_id reset_simple_dt_ids[] = {
 	{ .compatible = "altr,stratix10-rst-mgr",
 		.data = &reset_simple_socfpga },
+	{ .compatible = "brcm,bcm6345-reset" },
 	{ .compatible = "st,stm32-rcc", },
 	{ .compatible = "allwinner,sun6i-a31-clock-reset",
 		.data = &reset_simple_active_low },
Signature · 1 line
2.26.2
#21 lore raw

Re: [PATCH v2 3/7] drivers: reset: simple: add BCM6345 reset support

Quoted 4 lines · Álvaro Fernández Rojas

Add support for resetting blocks through the Linux reset controller subsystem for BCM63xx SoCs.

This looks good to me, however in v1 there was a need for sleeping after the reset assertion, and this does not appear to be taken care of by default by reset-simple.c, did you determine the delay not to be necessary?

Signature · 1 line
Florian
#22 lore raw

Re: [PATCH v2 3/7] drivers: reset: simple: add BCM6345 reset support

Hi Florian,

Quoted 5 lines · Florian Fainelli

On 6/9/2020 9:02 AM, Álvaro Fernández Rojas wrote:

Quoted 8 lines
Quoted 4 lines

Add support for resetting blocks through the Linux reset controller subsystem for BCM63xx SoCs.

This looks good to me, however in v1 there was a need for sleeping after the reset assertion, and this does not appear to be taken care of by default by reset-simple.c, did you determine the delay not to be necessary?

Let me do some more tests to determine if it’s really needed.

Quoted 2 lines
Signature · 1 line
Florian
#23 lore raw

PATCH v2 4/7 mips: bmips: dts: add BCM6328 reset controller support

In reply to Álvaro Fernández Rojas

BCM6328 SoCs have a reset controller for certain components.

---
v2: no changes.

 arch/mips/boot/dts/brcm/bcm6328.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/mips/boot/dts/brcm/bcm6328.dtsi +6 -0
index af860d06def6..590118cf5c12 100644
@@ -57,6 +57,12 @@ clkctl: clock-controller@10000004 {
 			#clock-cells = <1>;
 		};
 
+		periph_rst: reset-controller@10000010 {
+			compatible = "brcm,bcm6345-reset";
+			reg = <0x10000010 0x4>;
+			#reset-cells = <1>;
+		};
+
 		periph_intc: interrupt-controller@10000020 {
 			compatible = "brcm,bcm6345-l1-intc";
 			reg = <0x10000020 0x10>,
Signature · 1 line
2.26.2
Acked-by on v2 4/7
#24 lore raw

Re: [PATCH v2 4/7] mips: bmips: dts: add BCM6328 reset controller support

Quoted 3 lines · Álvaro Fernández Rojas

BCM6328 SoCs have a reset controller for certain components.

You should probably create include files under include/dt-bindings/ which designate the various reset control bits that are valid for a given SoC.

Signature · 1 line
Florian
#25 lore raw

Re: [PATCH v2 4/7] mips: bmips: dts: add BCM6328 reset controller support

Hi Florian,

Quoted 7 lines · Florian Fainelli
Quoted 2 lines · Álvaro Fernández Rojas

BCM6328 SoCs have a reset controller for certain components.

Quoted 7 lines
Quoted 1 line

You should probably create include files under include/dt-bindings/ which designate the various reset control bits that are valid for a given SoC.

I will do that in v3.

Quoted 2 lines
Signature · 1 line
Florian
#26 lore raw

PATCH v2 5/7 mips: bmips: dts: add BCM6358 reset controller support

In reply to Álvaro Fernández Rojas

BCM6358 SoCs have a reset controller for certain components.

---
v2: no changes.

 arch/mips/boot/dts/brcm/bcm6358.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/mips/boot/dts/brcm/bcm6358.dtsi +6 -0
index f21176cac038..9d93e7f5e6fc 100644
@@ -82,6 +82,12 @@ periph_intc: interrupt-controller@fffe000c {
 			interrupts = <2>, <3>;
 		};
 
+		periph_rst: reset-controller@fffe0034 {
+			compatible = "brcm,bcm6345-reset";
+			reg = <0xfffe0034 0x4>;
+			#reset-cells = <1>;
+		};
+
 		leds0: led-controller@fffe00d0 {
 			#address-cells = <1>;
 			#size-cells = <0>;
Signature · 1 line
2.26.2
#28 lore raw

PATCH v2 6/7 mips: bmips: dts: add BCM6362 reset controller support

In reply to Álvaro Fernández Rojas

BCM6362 SoCs have a reset controller for certain components.

---
v2: no changes.

 arch/mips/boot/dts/brcm/bcm6362.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/mips/boot/dts/brcm/bcm6362.dtsi +6 -0
index 8ae6981735b8..443af6b4c838 100644
@@ -70,6 +70,12 @@ reboot: syscon-reboot@10000008 {
 			mask = <0x1>;
 		};
 
+		periph_rst: reset-controller@10000010 {
+			compatible = "brcm,bcm6345-reset";
+			reg = <0x10000010 0x4>;
+			#reset-cells = <1>;
+		};
+
 		periph_intc: interrupt-controller@10000020 {
 			compatible = "brcm,bcm6345-l1-intc";
 			reg = <0x10000020 0x10>,
Signature · 1 line
2.26.2
#30 lore raw

PATCH v2 7/7 mips: bmips: dts: add BCM6368 reset controller support

In reply to Álvaro Fernández Rojas

BCM6368 SoCs have a reset controller for certain components.

---
v2: no changes.

 arch/mips/boot/dts/brcm/bcm6368.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/mips/boot/dts/brcm/bcm6368.dtsi +6 -0
index 449c167dd892..52c19f40b9cc 100644
@@ -70,6 +70,12 @@ reboot: syscon-reboot@10000008 {
 			mask = <0x1>;
 		};
 
+		periph_rst: reset-controller@10000010 {
+			compatible = "brcm,bcm6345-reset";
+			reg = <0x10000010 0x4>;
+			#reset-cells = <1>;
+		};
+
 		periph_intc: interrupt-controller@10000020 {
 			compatible = "brcm,bcm6345-l1-intc";
 			reg = <0x10000020 0x10>,
Signature · 1 line
2.26.2
#32 lore raw

v3 cover bmips: add bcm6345 reset controller support

In reply to Álvaro Fernández Rojas

BCM63xx SoCs have a reset controller for certain components.

v3: using reset-simple isn't possible since sleeping after performing the
reset is also needed.
Add BCM63268 and BCM6318 support.
v2: add compatibility to reset-simple instead of adding a new driver.

Álvaro Fernández Rojas (9):
mips: bmips: select ARCH_HAS_RESET_CONTROLLER
dt-bindings: reset: add BCM6345 reset controller bindings
reset: add BCM6345 reset controller driver
mips: bmips: dts: add BCM6328 reset controller support
mips: bmips: dts: add BCM6358 reset controller support
mips: bmips: dts: add BCM6362 reset controller support
mips: bmips: dts: add BCM6368 reset controller support
mips: bmips: dts: add BCM63268 reset controller support
mips: bmips: add BCM6318 reset controller definitions

 .../bindings/reset/brcm,bcm6345-reset.yaml    |  37 +++++
 arch/mips/Kconfig                             |   1 +
 arch/mips/boot/dts/brcm/bcm63268.dtsi         |   6 +
 arch/mips/boot/dts/brcm/bcm6328.dtsi          |   6 +
 arch/mips/boot/dts/brcm/bcm6358.dtsi          |   6 +
 arch/mips/boot/dts/brcm/bcm6362.dtsi          |   6 +
 arch/mips/boot/dts/brcm/bcm6368.dtsi          |   6 +
 drivers/reset/Kconfig                         |   7 +
 drivers/reset/Makefile                        |   1 +
 drivers/reset/reset-bcm6345.c                 | 135 ++++++++++++++++++
 include/dt-bindings/reset/bcm6318-reset.h     |  20 +++
 include/dt-bindings/reset/bcm63268-reset.h    |  26 ++++
 include/dt-bindings/reset/bcm6328-reset.h     |  18 +++
 include/dt-bindings/reset/bcm6358-reset.h     |  15 ++
 include/dt-bindings/reset/bcm6362-reset.h     |  22 +++
 include/dt-bindings/reset/bcm6368-reset.h     |  16 +++
 16 files changed, 328 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/brcm,bcm6345-reset.yaml
 create mode 100644 drivers/reset/reset-bcm6345.c
 create mode 100644 include/dt-bindings/reset/bcm6318-reset.h
 create mode 100644 include/dt-bindings/reset/bcm63268-reset.h
 create mode 100644 include/dt-bindings/reset/bcm6328-reset.h
 create mode 100644 include/dt-bindings/reset/bcm6358-reset.h
 create mode 100644 include/dt-bindings/reset/bcm6362-reset.h
 create mode 100644 include/dt-bindings/reset/bcm6368-reset.h
Signature · 1 line
2.26.2
#33 lore raw

PATCH v3 1/9 mips: bmips: select ARCH_HAS_RESET_CONTROLLER

This allows to add reset controllers support.

---
v3: no changes
v2: no changes

 arch/mips/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/mips/Kconfig +1 -0
index 9dc08ee3d6b9..e82586e7719c 100644
@@ -229,6 +229,7 @@ config ATH79
 
 config BMIPS_GENERIC
 	bool "Broadcom Generic BMIPS kernel"
+	select ARCH_HAS_RESET_CONTROLLER
 	select ARCH_HAS_SYNC_DMA_FOR_CPU_ALL
 	select ARCH_HAS_PHYS_TO_DMA
 	select BOOT_RAW
Signature · 1 line
2.26.2
#34 lore raw

PATCH v3 2/9 dt-bindings: reset: add BCM6345 reset controller bindings

In reply to Álvaro Fernández Rojas

Add device tree binding documentation for BCM6345 reset controller.

---
 .../bindings/reset/brcm,bcm6345-reset.yaml    | 37 +++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/brcm,bcm6345-reset.yaml
Documentation/devicetree/bindings/reset/brcm,bcm6345-reset.yaml new file +37 -0
new file mode 100644
index 000000000000..eb3f2182e631
@@ -0,0 +1,37 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/reset/brcm,bcm6345-reset.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: BCM6345 reset controller
+
+description: This document describes the BCM6345 reset controller.
+
+maintainers:
+  - Álvaro Fernández Rojas <[email protected]>
+
+properties:
+  compatible:
+    const: brcm,bcm6345-reset
+
+  reg:
+    maxItems: 2
+
+  "#reset-cells":
+    const: 1
+
+required:
+  - compatible
+  - reg
+  - "#reset-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    reset-controller@10000010 {
+      compatible = "brcm,bcm6345-reset";
+      reg = <0x10000010 0x4>;
+      #reset-cells = <1>;
+    };
Signature · 1 line
2.26.2
maintainer
#35 lore raw

Re: [PATCH v3 2/9] dt-bindings: reset: add BCM6345 reset controller bindings

Quoted 9 lines · Álvaro Fernández Rojas

Add device tree binding documentation for BCM6345 reset controller.

---
 .../bindings/reset/brcm,bcm6345-reset.yaml    | 37 +++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/brcm,bcm6345-reset.yaml

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

/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/reset/brcm,bcm6345-reset.example.dt.yaml: reset-controller@10000010: reg: [[268435472, 4]] is too short

See https://patchwork.ozlabs.org/patch/1307115

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

pip3 install git+https://github.com/devicetree-org/dt-schema.git@master --upgrade

Please check and re-submit.

#36 lore raw

Re: [PATCH v3 2/9] dt-bindings: reset: add BCM6345 reset controller bindings

Quoted 12 lines · Rob Herring
Quoted 9 lines · Álvaro Fernández Rojas

Add device tree binding documentation for BCM6345 reset controller.

---
 .../bindings/reset/brcm,bcm6345-reset.yaml    | 37 +++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/brcm,bcm6345-reset.yaml
Quoted 3 lines

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

/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/reset/brcm,bcm6345-reset.example.dt.yaml: reset-controller@10000010: reg: [[268435472, 4]] is too short

maxItems for the reg property should be 1 here.

Signature · 1 line
Florian
#37 lore raw

PATCH v3 3/9 reset: add BCM6345 reset controller driver

In reply to Álvaro Fernández Rojas

Add support for resetting blocks through the Linux reset controller subsystem for BCM63xx SoCs.

---
v3: using reset-simple isn't possible since sleeping after performing the
reset is also needed.
v2: add compatibility to reset-simple instead of adding a new driver.

 drivers/reset/Kconfig         |   7 ++
 drivers/reset/Makefile        |   1 +
 drivers/reset/reset-bcm6345.c | 135 ++++++++++++++++++++++++++++++++++
 3 files changed, 143 insertions(+)
 create mode 100644 drivers/reset/reset-bcm6345.c
drivers/reset/Kconfig +7 -0
index d9efbfd29646..9f1da978cef6 100644
@@ -41,6 +41,13 @@ config RESET_BERLIN
 	help
 	  This enables the reset controller driver for Marvell Berlin SoCs.
 
+config RESET_BCM6345
+	bool "BCM6345 Reset Controller"
+	depends on BMIPS_GENERIC || COMPILE_TEST
+	default BMIPS_GENERIC
+	help
+	  This enables the reset controller driver for BCM6345 SoCs.
+
 config RESET_BRCMSTB
 	tristate "Broadcom STB reset controller"
 	depends on ARCH_BRCMSTB || COMPILE_TEST
drivers/reset/Makefile +1 -0
index 249ed357c997..e642aae42f0f 100644
@@ -6,6 +6,7 @@ obj-$(CONFIG_ARCH_TEGRA) += tegra/
 obj-$(CONFIG_RESET_A10SR) += reset-a10sr.o
 obj-$(CONFIG_RESET_ATH79) += reset-ath79.o
 obj-$(CONFIG_RESET_AXS10X) += reset-axs10x.o
+obj-$(CONFIG_RESET_BCM6345) += reset-bcm6345.o
 obj-$(CONFIG_RESET_BERLIN) += reset-berlin.o
 obj-$(CONFIG_RESET_BRCMSTB) += reset-brcmstb.o
 obj-$(CONFIG_RESET_BRCMSTB_RESCAL) += reset-brcmstb-rescal.o
drivers/reset/reset-bcm6345.c new file +135 -0

135 lines not on this page · raw message

Signature · 1 line
2.26.2
#38 lore raw

PATCH v3 4/9 mips: bmips: dts: add BCM6328 reset controller support

In reply to Álvaro Fernández Rojas

BCM6328 SoCs have a reset controller for certain components.

---
v3: add reset controller definitions header file.
v2: no changes.

 arch/mips/boot/dts/brcm/bcm6328.dtsi      |  6 ++++++
 include/dt-bindings/reset/bcm6328-reset.h | 18 ++++++++++++++++++
 2 files changed, 24 insertions(+)
 create mode 100644 include/dt-bindings/reset/bcm6328-reset.h
arch/mips/boot/dts/brcm/bcm6328.dtsi +6 -0
index af860d06def6..590118cf5c12 100644
@@ -57,6 +57,12 @@ clkctl: clock-controller@10000004 {
 			#clock-cells = <1>;
 		};
 
+		periph_rst: reset-controller@10000010 {
+			compatible = "brcm,bcm6345-reset";
+			reg = <0x10000010 0x4>;
+			#reset-cells = <1>;
+		};
+
 		periph_intc: interrupt-controller@10000020 {
 			compatible = "brcm,bcm6345-l1-intc";
 			reg = <0x10000020 0x10>,
include/dt-bindings/reset/bcm6328-reset.h new file +18 -0
new file mode 100644
index 000000000000..0f3df87d47af
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+#ifndef __DT_BINDINGS_RESET_BCM6328_H
+#define __DT_BINDINGS_RESET_BCM6328_H
+
+#define BCM6328_RST_SPI		0
+#define BCM6328_RST_EPHY	1
+#define BCM6328_RST_SAR		2
+#define BCM6328_RST_ENETSW	3
+#define BCM6328_RST_USBS	4
+#define BCM6328_RST_USBH	5
+#define BCM6328_RST_PCM		6
+#define BCM6328_RST_PCIE_CORE	7
+#define BCM6328_RST_PCIE	8
+#define BCM6328_RST_PCIE_EXT	9
+#define BCM6328_RST_PCIE_HARD	10
+
+#endif /* __DT_BINDINGS_RESET_BCM6328_H */
Signature · 1 line
2.26.2
#39 lore raw

PATCH v3 5/9 mips: bmips: dts: add BCM6358 reset controller support

In reply to Álvaro Fernández Rojas

BCM6358 SoCs have a reset controller for certain components.

---
v3: add reset controller definitions header file.
v2: no changes.

 arch/mips/boot/dts/brcm/bcm6358.dtsi      |  6 ++++++
 include/dt-bindings/reset/bcm6358-reset.h | 15 +++++++++++++++
 2 files changed, 21 insertions(+)
 create mode 100644 include/dt-bindings/reset/bcm6358-reset.h
arch/mips/boot/dts/brcm/bcm6358.dtsi +6 -0
index f21176cac038..9d93e7f5e6fc 100644
@@ -82,6 +82,12 @@ periph_intc: interrupt-controller@fffe000c {
 			interrupts = <2>, <3>;
 		};
 
+		periph_rst: reset-controller@fffe0034 {
+			compatible = "brcm,bcm6345-reset";
+			reg = <0xfffe0034 0x4>;
+			#reset-cells = <1>;
+		};
+
 		leds0: led-controller@fffe00d0 {
 			#address-cells = <1>;
 			#size-cells = <0>;
include/dt-bindings/reset/bcm6358-reset.h new file +15 -0
new file mode 100644
index 000000000000..bda62ef84f5a
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+#ifndef __DT_BINDINGS_RESET_BCM6358_H
+#define __DT_BINDINGS_RESET_BCM6358_H
+
+#define BCM6358_RST_SPI		0
+#define BCM6358_RST_ENET	2
+#define BCM6358_RST_MPI		3
+#define BCM6358_RST_EPHY	6
+#define BCM6358_RST_SAR		7
+#define BCM6358_RST_USBH	12
+#define BCM6358_RST_PCM		13
+#define BCM6358_RST_ADSL	14
+
+#endif /* __DT_BINDINGS_RESET_BCM6358_H */
Signature · 1 line
2.26.2
#40 lore raw

PATCH v3 6/9 mips: bmips: dts: add BCM6362 reset controller support

In reply to Álvaro Fernández Rojas

BCM6362 SoCs have a reset controller for certain components.

---
v3: add reset controller definitions header file.
v2: no changes.

 arch/mips/boot/dts/brcm/bcm6362.dtsi      |  6 ++++++
 include/dt-bindings/reset/bcm6362-reset.h | 22 ++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 include/dt-bindings/reset/bcm6362-reset.h
arch/mips/boot/dts/brcm/bcm6362.dtsi +6 -0
index 8ae6981735b8..443af6b4c838 100644
@@ -70,6 +70,12 @@ reboot: syscon-reboot@10000008 {
 			mask = <0x1>;
 		};
 
+		periph_rst: reset-controller@10000010 {
+			compatible = "brcm,bcm6345-reset";
+			reg = <0x10000010 0x4>;
+			#reset-cells = <1>;
+		};
+
 		periph_intc: interrupt-controller@10000020 {
 			compatible = "brcm,bcm6345-l1-intc";
 			reg = <0x10000020 0x10>,
include/dt-bindings/reset/bcm6362-reset.h new file +22 -0
new file mode 100644
index 000000000000..7ebb0546e0ab
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+#ifndef __DT_BINDINGS_RESET_BCM6362_H
+#define __DT_BINDINGS_RESET_BCM6362_H
+
+#define BCM6362_RST_SPI		0
+#define BCM6362_RST_IPSEC	1
+#define BCM6362_RST_EPHY	2
+#define BCM6362_RST_SAR		3
+#define BCM6362_RST_ENETSW	4
+#define BCM6362_RST_USBD	5
+#define BCM6362_RST_USBH	6
+#define BCM6362_RST_PCM		7
+#define BCM6362_RST_PCIE_CORE	8
+#define BCM6362_RST_PCIE	9
+#define BCM6362_RST_PCIE_EXT	10
+#define BCM6362_RST_WLAN_SHIM	11
+#define BCM6362_RST_DDR_PHY	12
+#define BCM6362_RST_FAP		13
+#define BCM6362_RST_WLAN_UBUS	14
+
+#endif /* __DT_BINDINGS_RESET_BCM6362_H */
Signature · 1 line
2.26.2
#41 lore raw

PATCH v3 7/9 mips: bmips: dts: add BCM6368 reset controller support

In reply to Álvaro Fernández Rojas

BCM6368 SoCs have a reset controller for certain components.

---
v3: add reset controller definitions header file.
v2: no changes.

 arch/mips/boot/dts/brcm/bcm6368.dtsi      |  6 ++++++
 include/dt-bindings/reset/bcm6368-reset.h | 16 ++++++++++++++++
 2 files changed, 22 insertions(+)
 create mode 100644 include/dt-bindings/reset/bcm6368-reset.h
arch/mips/boot/dts/brcm/bcm6368.dtsi +6 -0
index 449c167dd892..52c19f40b9cc 100644
@@ -70,6 +70,12 @@ reboot: syscon-reboot@10000008 {
 			mask = <0x1>;
 		};
 
+		periph_rst: reset-controller@10000010 {
+			compatible = "brcm,bcm6345-reset";
+			reg = <0x10000010 0x4>;
+			#reset-cells = <1>;
+		};
+
 		periph_intc: interrupt-controller@10000020 {
 			compatible = "brcm,bcm6345-l1-intc";
 			reg = <0x10000020 0x10>,
include/dt-bindings/reset/bcm6368-reset.h new file +16 -0
new file mode 100644
index 000000000000..c81d8eb6d173
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+#ifndef __DT_BINDINGS_RESET_BCM6368_H
+#define __DT_BINDINGS_RESET_BCM6368_H
+
+#define BCM6368_RST_SPI		0
+#define BCM6368_RST_MPI		3
+#define BCM6368_RST_IPSEC	4
+#define BCM6368_RST_EPHY	6
+#define BCM6368_RST_SAR		7
+#define BCM6368_RST_SWITCH	10
+#define BCM6368_RST_USBD	11
+#define BCM6368_RST_USBH	12
+#define BCM6368_RST_PCM		13
+
+#endif /* __DT_BINDINGS_RESET_BCM6368_H */
Signature · 1 line
2.26.2
#42 lore raw

PATCH v3 8/9 mips: bmips: dts: add BCM63268 reset controller support

In reply to Álvaro Fernández Rojas

BCM63268 SoCs have a reset controller for certain components.

---
v3: add new path with BCM63268 reset controller support.

 arch/mips/boot/dts/brcm/bcm63268.dtsi      |  6 +++++
 include/dt-bindings/reset/bcm63268-reset.h | 26 ++++++++++++++++++++++
 2 files changed, 32 insertions(+)
 create mode 100644 include/dt-bindings/reset/bcm63268-reset.h
arch/mips/boot/dts/brcm/bcm63268.dtsi +6 -0
index beec24145af7..0150da7e3905 100644
@@ -70,6 +70,12 @@ reboot: syscon-reboot@10000008 {
 			mask = <0x1>;
 		};
 
+		periph_rst: reset-controller@10000010 {
+			compatible = "brcm,bcm6345-reset";
+			reg = <0x10000010 0x4>;
+			#reset-cells = <1>;
+		};
+
 		periph_intc: interrupt-controller@10000020 {
 			compatible = "brcm,bcm6345-l1-intc";
 			reg = <0x10000020 0x20>,
include/dt-bindings/reset/bcm63268-reset.h new file +26 -0
new file mode 100644
index 000000000000..6a6403a4c2d5
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+#ifndef __DT_BINDINGS_RESET_BCM63268_H
+#define __DT_BINDINGS_RESET_BCM63268_H
+
+#define BCM63268_RST_SPI	0
+#define BCM63268_RST_IPSEC	1
+#define BCM63268_RST_EPHY	2
+#define BCM63268_RST_SAR	3
+#define BCM63268_RST_ENETSW	4
+#define BCM63268_RST_USBS	5
+#define BCM63268_RST_USBH	6
+#define BCM63268_RST_PCM	7
+#define BCM63268_RST_PCIE_CORE	8
+#define BCM63268_RST_PCIE	9
+#define BCM63268_RST_PCIE_EXT	10
+#define BCM63268_RST_WLAN_SHIM	11
+#define BCM63268_RST_DDR_PHY	12
+#define BCM63268_RST_FAP0	13
+#define BCM63268_RST_WLAN_UBUS	14
+#define BCM63268_RST_DECT	15
+#define BCM63268_RST_FAP1	16
+#define BCM63268_RST_PCIE_HARD	17
+#define BCM63268_RST_GPHY	18
+
+#endif /* __DT_BINDINGS_RESET_BCM63268_H */
Signature · 1 line
2.26.2
#43 lore raw

PATCH v3 9/9 mips: bmips: add BCM6318 reset controller definitions

In reply to Álvaro Fernández Rojas

BCM6318 SoCs have a reset controller for certain components.

---
v3: add new path with BCM6318 reset controller definitions.

 include/dt-bindings/reset/bcm6318-reset.h | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 include/dt-bindings/reset/bcm6318-reset.h
include/dt-bindings/reset/bcm6318-reset.h new file +20 -0
new file mode 100644
index 000000000000..f4fef7bfb06d
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+#ifndef __DT_BINDINGS_RESET_BCM6318_H
+#define __DT_BINDINGS_RESET_BCM6318_H
+
+#define BCM6318_RST_SPI		0
+#define BCM6318_RST_EPHY	1
+#define BCM6318_RST_SAR		2
+#define BCM6318_RST_ENETSW	3
+#define BCM6318_RST_USBD	4
+#define BCM6318_RST_USBH	5
+#define BCM6318_RST_PCIE_CORE	6
+#define BCM6318_RST_PCIE	7
+#define BCM6318_RST_PCIE_EXT	8
+#define BCM6318_RST_PCIE_HARD	9
+#define BCM6318_RST_ADSL	10
+#define BCM6318_RST_PHYMIPS	11
+#define BCM6318_RST_HOSTMIPS	11
+
+#endif /* __DT_BINDINGS_RESET_BCM6318_H */
Signature · 1 line
2.26.2
#44 lore raw

v4 cover bmips: add bcm6345 reset controller support

In reply to Álvaro Fernández Rojas

BCM63xx SoCs have a reset controller for certain components.

v4: Fix device tree bindings documentation.
v3: using reset-simple isn't possible since sleeping after performing the
reset is also needed.
Add BCM63268 and BCM6318 support.
v2: add compatibility to reset-simple instead of adding a new driver.

Álvaro Fernández Rojas (9):
mips: bmips: select ARCH_HAS_RESET_CONTROLLER
dt-bindings: reset: add BCM6345 reset controller bindings
reset: add BCM6345 reset controller driver
mips: bmips: dts: add BCM6328 reset controller support
mips: bmips: dts: add BCM6358 reset controller support
mips: bmips: dts: add BCM6362 reset controller support
mips: bmips: dts: add BCM6368 reset controller support
mips: bmips: dts: add BCM63268 reset controller support
mips: bmips: add BCM6318 reset controller definitions

 .../bindings/reset/brcm,bcm6345-reset.yaml    |  37 +++++
 arch/mips/Kconfig                             |   1 +
 arch/mips/boot/dts/brcm/bcm63268.dtsi         |   6 +
 arch/mips/boot/dts/brcm/bcm6328.dtsi          |   6 +
 arch/mips/boot/dts/brcm/bcm6358.dtsi          |   6 +
 arch/mips/boot/dts/brcm/bcm6362.dtsi          |   6 +
 arch/mips/boot/dts/brcm/bcm6368.dtsi          |   6 +
 drivers/reset/Kconfig                         |   7 +
 drivers/reset/Makefile                        |   1 +
 drivers/reset/reset-bcm6345.c                 | 135 ++++++++++++++++++
 include/dt-bindings/reset/bcm6318-reset.h     |  20 +++
 include/dt-bindings/reset/bcm63268-reset.h    |  26 ++++
 include/dt-bindings/reset/bcm6328-reset.h     |  18 +++
 include/dt-bindings/reset/bcm6358-reset.h     |  15 ++
 include/dt-bindings/reset/bcm6362-reset.h     |  22 +++
 include/dt-bindings/reset/bcm6368-reset.h     |  16 +++
 16 files changed, 328 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/brcm,bcm6345-reset.yaml
 create mode 100644 drivers/reset/reset-bcm6345.c
 create mode 100644 include/dt-bindings/reset/bcm6318-reset.h
 create mode 100644 include/dt-bindings/reset/bcm63268-reset.h
 create mode 100644 include/dt-bindings/reset/bcm6328-reset.h
 create mode 100644 include/dt-bindings/reset/bcm6358-reset.h
 create mode 100644 include/dt-bindings/reset/bcm6362-reset.h
 create mode 100644 include/dt-bindings/reset/bcm6368-reset.h
Signature · 1 line
2.27.0
#45 lore raw

PATCH v4 1/9 mips: bmips: select ARCH_HAS_RESET_CONTROLLER

This allows to add reset controllers support.

---
v4: no changes
v3: no changes
v2: no changes

 arch/mips/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/mips/Kconfig +1 -0
index 26c63e8161f0..4721ec4e3408 100644
@@ -227,6 +227,7 @@ config ATH79
 
 config BMIPS_GENERIC
 	bool "Broadcom Generic BMIPS kernel"
+	select ARCH_HAS_RESET_CONTROLLER
 	select ARCH_HAS_SYNC_DMA_FOR_CPU_ALL
 	select ARCH_HAS_PHYS_TO_DMA
 	select BOOT_RAW
Signature · 1 line
2.27.0
#46 lore raw

PATCH v4 2/9 dt-bindings: reset: add BCM6345 reset controller bindings

In reply to Álvaro Fernández Rojas

Add device tree binding documentation for BCM6345 reset controller.

---
v4: change license and fix maxItems.
v3: no changes
v2: no changes

 .../bindings/reset/brcm,bcm6345-reset.yaml    | 37 +++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/brcm,bcm6345-reset.yaml
Documentation/devicetree/bindings/reset/brcm,bcm6345-reset.yaml new file +37 -0
new file mode 100644
index 000000000000..560cf6522cb8
@@ -0,0 +1,37 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/reset/brcm,bcm6345-reset.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: BCM6345 reset controller
+
+description: This document describes the BCM6345 reset controller.
+
+maintainers:
+  - Álvaro Fernández Rojas <[email protected]>
+
+properties:
+  compatible:
+    const: brcm,bcm6345-reset
+
+  reg:
+    maxItems: 1
+
+  "#reset-cells":
+    const: 1
+
+required:
+  - compatible
+  - reg
+  - "#reset-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    reset-controller@10000010 {
+      compatible = "brcm,bcm6345-reset";
+      reg = <0x10000010 0x4>;
+      #reset-cells = <1>;
+    };
Signature · 1 line
2.27.0
#47 lore raw

PATCH v4 3/9 reset: add BCM6345 reset controller driver

In reply to Álvaro Fernández Rojas

Add support for resetting blocks through the Linux reset controller subsystem for BCM63xx SoCs.

---
v4: no changes.
v3: using reset-simple isn't possible since sleeping after performing the
reset is also needed.
v2: add compatibility to reset-simple instead of adding a new driver.

 drivers/reset/Kconfig         |   7 ++
 drivers/reset/Makefile        |   1 +
 drivers/reset/reset-bcm6345.c | 135 ++++++++++++++++++++++++++++++++++
 3 files changed, 143 insertions(+)
 create mode 100644 drivers/reset/reset-bcm6345.c
drivers/reset/Kconfig +7 -0
index d9efbfd29646..9f1da978cef6 100644
@@ -41,6 +41,13 @@ config RESET_BERLIN
 	help
 	  This enables the reset controller driver for Marvell Berlin SoCs.
 
+config RESET_BCM6345
+	bool "BCM6345 Reset Controller"
+	depends on BMIPS_GENERIC || COMPILE_TEST
+	default BMIPS_GENERIC
+	help
+	  This enables the reset controller driver for BCM6345 SoCs.
+
 config RESET_BRCMSTB
 	tristate "Broadcom STB reset controller"
 	depends on ARCH_BRCMSTB || COMPILE_TEST
drivers/reset/Makefile +1 -0
index 249ed357c997..e642aae42f0f 100644
@@ -6,6 +6,7 @@ obj-$(CONFIG_ARCH_TEGRA) += tegra/
 obj-$(CONFIG_RESET_A10SR) += reset-a10sr.o
 obj-$(CONFIG_RESET_ATH79) += reset-ath79.o
 obj-$(CONFIG_RESET_AXS10X) += reset-axs10x.o
+obj-$(CONFIG_RESET_BCM6345) += reset-bcm6345.o
 obj-$(CONFIG_RESET_BERLIN) += reset-berlin.o
 obj-$(CONFIG_RESET_BRCMSTB) += reset-brcmstb.o
 obj-$(CONFIG_RESET_BRCMSTB_RESCAL) += reset-brcmstb-rescal.o
drivers/reset/reset-bcm6345.c new file +135 -0

135 lines not on this page · raw message

Signature · 1 line
2.27.0
#48 lore raw

Re: [PATCH v4 3/9] reset: add BCM6345 reset controller driver

Thank you for the patch! Perhaps something to improve:

Hi "Álvaro,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on pza/reset/next]
[also build test WARNING on robh/for-next v5.7]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/lvaro-Fern-ndez-Rojas/bmips-add-bcm6345-reset-controller-support/20200613-164237
base:   https://git.pengutronix.de/git/pza/linux reset/next
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project d7e6f116f4517952fbdf5ad4b5ff67e378600c60)

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate

All warnings (new ones prefixed by >>, old ones prefixed by <<):

>> WARNING: modpost: vmlinux.o(.data+0x1b0c020): Section mismatch in reference from the variable bcm6345_reset_driver to the function .init.text:bcm6345_reset_probe()

The variable bcm6345_reset_driver references
the function __init bcm6345_reset_probe()
If the reference is valid then annotate the
variable with or __refdata (see linux/init.h) or name the variable:

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

#50 lore raw

PATCH v4 4/9 mips: bmips: dts: add BCM6328 reset controller support

In reply to Álvaro Fernández Rojas

BCM6328 SoCs have a reset controller for certain components.

---
v4: no changes.
v3: add reset controller definitions header file.
v2: no changes.

 arch/mips/boot/dts/brcm/bcm6328.dtsi      |  6 ++++++
 include/dt-bindings/reset/bcm6328-reset.h | 18 ++++++++++++++++++
 2 files changed, 24 insertions(+)
 create mode 100644 include/dt-bindings/reset/bcm6328-reset.h
arch/mips/boot/dts/brcm/bcm6328.dtsi +6 -0
index af860d06def6..590118cf5c12 100644
@@ -57,6 +57,12 @@ clkctl: clock-controller@10000004 {
 			#clock-cells = <1>;
 		};
 
+		periph_rst: reset-controller@10000010 {
+			compatible = "brcm,bcm6345-reset";
+			reg = <0x10000010 0x4>;
+			#reset-cells = <1>;
+		};
+
 		periph_intc: interrupt-controller@10000020 {
 			compatible = "brcm,bcm6345-l1-intc";
 			reg = <0x10000020 0x10>,
include/dt-bindings/reset/bcm6328-reset.h new file +18 -0
new file mode 100644
index 000000000000..0f3df87d47af
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+#ifndef __DT_BINDINGS_RESET_BCM6328_H
+#define __DT_BINDINGS_RESET_BCM6328_H
+
+#define BCM6328_RST_SPI		0
+#define BCM6328_RST_EPHY	1
+#define BCM6328_RST_SAR		2
+#define BCM6328_RST_ENETSW	3
+#define BCM6328_RST_USBS	4
+#define BCM6328_RST_USBH	5
+#define BCM6328_RST_PCM		6
+#define BCM6328_RST_PCIE_CORE	7
+#define BCM6328_RST_PCIE	8
+#define BCM6328_RST_PCIE_EXT	9
+#define BCM6328_RST_PCIE_HARD	10
+
+#endif /* __DT_BINDINGS_RESET_BCM6328_H */
Signature · 1 line
2.27.0
#51 lore raw

PATCH v4 5/9 mips: bmips: dts: add BCM6358 reset controller support

In reply to Álvaro Fernández Rojas

BCM6358 SoCs have a reset controller for certain components.

---
v4: no changes.
v3: add reset controller definitions header file.
v2: no changes.

 arch/mips/boot/dts/brcm/bcm6358.dtsi      |  6 ++++++
 include/dt-bindings/reset/bcm6358-reset.h | 15 +++++++++++++++
 2 files changed, 21 insertions(+)
 create mode 100644 include/dt-bindings/reset/bcm6358-reset.h
arch/mips/boot/dts/brcm/bcm6358.dtsi +6 -0
index f21176cac038..9d93e7f5e6fc 100644
@@ -82,6 +82,12 @@ periph_intc: interrupt-controller@fffe000c {
 			interrupts = <2>, <3>;
 		};
 
+		periph_rst: reset-controller@fffe0034 {
+			compatible = "brcm,bcm6345-reset";
+			reg = <0xfffe0034 0x4>;
+			#reset-cells = <1>;
+		};
+
 		leds0: led-controller@fffe00d0 {
 			#address-cells = <1>;
 			#size-cells = <0>;
include/dt-bindings/reset/bcm6358-reset.h new file +15 -0
new file mode 100644
index 000000000000..bda62ef84f5a
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+#ifndef __DT_BINDINGS_RESET_BCM6358_H
+#define __DT_BINDINGS_RESET_BCM6358_H
+
+#define BCM6358_RST_SPI		0
+#define BCM6358_RST_ENET	2
+#define BCM6358_RST_MPI		3
+#define BCM6358_RST_EPHY	6
+#define BCM6358_RST_SAR		7
+#define BCM6358_RST_USBH	12
+#define BCM6358_RST_PCM		13
+#define BCM6358_RST_ADSL	14
+
+#endif /* __DT_BINDINGS_RESET_BCM6358_H */
Signature · 1 line
2.27.0
#52 lore raw

PATCH v4 6/9 mips: bmips: dts: add BCM6362 reset controller support

In reply to Álvaro Fernández Rojas

BCM6362 SoCs have a reset controller for certain components.

---
v4: no changes.
v3: add reset controller definitions header file.
v2: no changes.

 arch/mips/boot/dts/brcm/bcm6362.dtsi      |  6 ++++++
 include/dt-bindings/reset/bcm6362-reset.h | 22 ++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 include/dt-bindings/reset/bcm6362-reset.h
arch/mips/boot/dts/brcm/bcm6362.dtsi +6 -0
index 8ae6981735b8..443af6b4c838 100644
@@ -70,6 +70,12 @@ reboot: syscon-reboot@10000008 {
 			mask = <0x1>;
 		};
 
+		periph_rst: reset-controller@10000010 {
+			compatible = "brcm,bcm6345-reset";
+			reg = <0x10000010 0x4>;
+			#reset-cells = <1>;
+		};
+
 		periph_intc: interrupt-controller@10000020 {
 			compatible = "brcm,bcm6345-l1-intc";
 			reg = <0x10000020 0x10>,
include/dt-bindings/reset/bcm6362-reset.h new file +22 -0
new file mode 100644
index 000000000000..7ebb0546e0ab
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+#ifndef __DT_BINDINGS_RESET_BCM6362_H
+#define __DT_BINDINGS_RESET_BCM6362_H
+
+#define BCM6362_RST_SPI		0
+#define BCM6362_RST_IPSEC	1
+#define BCM6362_RST_EPHY	2
+#define BCM6362_RST_SAR		3
+#define BCM6362_RST_ENETSW	4
+#define BCM6362_RST_USBD	5
+#define BCM6362_RST_USBH	6
+#define BCM6362_RST_PCM		7
+#define BCM6362_RST_PCIE_CORE	8
+#define BCM6362_RST_PCIE	9
+#define BCM6362_RST_PCIE_EXT	10
+#define BCM6362_RST_WLAN_SHIM	11
+#define BCM6362_RST_DDR_PHY	12
+#define BCM6362_RST_FAP		13
+#define BCM6362_RST_WLAN_UBUS	14
+
+#endif /* __DT_BINDINGS_RESET_BCM6362_H */
Signature · 1 line
2.27.0
#53 lore raw

PATCH v4 7/9 mips: bmips: dts: add BCM6368 reset controller support

In reply to Álvaro Fernández Rojas

BCM6368 SoCs have a reset controller for certain components.

---
v4: no changes.
v3: add reset controller definitions header file.
v2: no changes.

 arch/mips/boot/dts/brcm/bcm6368.dtsi      |  6 ++++++
 include/dt-bindings/reset/bcm6368-reset.h | 16 ++++++++++++++++
 2 files changed, 22 insertions(+)
 create mode 100644 include/dt-bindings/reset/bcm6368-reset.h
arch/mips/boot/dts/brcm/bcm6368.dtsi +6 -0
index 449c167dd892..52c19f40b9cc 100644
@@ -70,6 +70,12 @@ reboot: syscon-reboot@10000008 {
 			mask = <0x1>;
 		};
 
+		periph_rst: reset-controller@10000010 {
+			compatible = "brcm,bcm6345-reset";
+			reg = <0x10000010 0x4>;
+			#reset-cells = <1>;
+		};
+
 		periph_intc: interrupt-controller@10000020 {
 			compatible = "brcm,bcm6345-l1-intc";
 			reg = <0x10000020 0x10>,
include/dt-bindings/reset/bcm6368-reset.h new file +16 -0
new file mode 100644
index 000000000000..c81d8eb6d173
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+#ifndef __DT_BINDINGS_RESET_BCM6368_H
+#define __DT_BINDINGS_RESET_BCM6368_H
+
+#define BCM6368_RST_SPI		0
+#define BCM6368_RST_MPI		3
+#define BCM6368_RST_IPSEC	4
+#define BCM6368_RST_EPHY	6
+#define BCM6368_RST_SAR		7
+#define BCM6368_RST_SWITCH	10
+#define BCM6368_RST_USBD	11
+#define BCM6368_RST_USBH	12
+#define BCM6368_RST_PCM		13
+
+#endif /* __DT_BINDINGS_RESET_BCM6368_H */
Signature · 1 line
2.27.0
#54 lore raw

PATCH v4 8/9 mips: bmips: dts: add BCM63268 reset controller support

In reply to Álvaro Fernández Rojas

BCM63268 SoCs have a reset controller for certain components.

---
v4: no changes.
v3: add new path with BCM63268 reset controller support.

 arch/mips/boot/dts/brcm/bcm63268.dtsi      |  6 +++++
 include/dt-bindings/reset/bcm63268-reset.h | 26 ++++++++++++++++++++++
 2 files changed, 32 insertions(+)
 create mode 100644 include/dt-bindings/reset/bcm63268-reset.h
arch/mips/boot/dts/brcm/bcm63268.dtsi +6 -0
index beec24145af7..0150da7e3905 100644
@@ -70,6 +70,12 @@ reboot: syscon-reboot@10000008 {
 			mask = <0x1>;
 		};
 
+		periph_rst: reset-controller@10000010 {
+			compatible = "brcm,bcm6345-reset";
+			reg = <0x10000010 0x4>;
+			#reset-cells = <1>;
+		};
+
 		periph_intc: interrupt-controller@10000020 {
 			compatible = "brcm,bcm6345-l1-intc";
 			reg = <0x10000020 0x20>,
include/dt-bindings/reset/bcm63268-reset.h new file +26 -0
new file mode 100644
index 000000000000..6a6403a4c2d5
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+#ifndef __DT_BINDINGS_RESET_BCM63268_H
+#define __DT_BINDINGS_RESET_BCM63268_H
+
+#define BCM63268_RST_SPI	0
+#define BCM63268_RST_IPSEC	1
+#define BCM63268_RST_EPHY	2
+#define BCM63268_RST_SAR	3
+#define BCM63268_RST_ENETSW	4
+#define BCM63268_RST_USBS	5
+#define BCM63268_RST_USBH	6
+#define BCM63268_RST_PCM	7
+#define BCM63268_RST_PCIE_CORE	8
+#define BCM63268_RST_PCIE	9
+#define BCM63268_RST_PCIE_EXT	10
+#define BCM63268_RST_WLAN_SHIM	11
+#define BCM63268_RST_DDR_PHY	12
+#define BCM63268_RST_FAP0	13
+#define BCM63268_RST_WLAN_UBUS	14
+#define BCM63268_RST_DECT	15
+#define BCM63268_RST_FAP1	16
+#define BCM63268_RST_PCIE_HARD	17
+#define BCM63268_RST_GPHY	18
+
+#endif /* __DT_BINDINGS_RESET_BCM63268_H */
Signature · 1 line
2.27.0
#56 lore raw

PATCH v4 9/9 mips: bmips: add BCM6318 reset controller definitions

In reply to Álvaro Fernández Rojas

BCM6318 SoCs have a reset controller for certain components.

---
v4: no changes.
v3: add new path with BCM6318 reset controller definitions.

 include/dt-bindings/reset/bcm6318-reset.h | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 include/dt-bindings/reset/bcm6318-reset.h
include/dt-bindings/reset/bcm6318-reset.h new file +20 -0
new file mode 100644
index 000000000000..f4fef7bfb06d
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+#ifndef __DT_BINDINGS_RESET_BCM6318_H
+#define __DT_BINDINGS_RESET_BCM6318_H
+
+#define BCM6318_RST_SPI		0
+#define BCM6318_RST_EPHY	1
+#define BCM6318_RST_SAR		2
+#define BCM6318_RST_ENETSW	3
+#define BCM6318_RST_USBD	4
+#define BCM6318_RST_USBH	5
+#define BCM6318_RST_PCIE_CORE	6
+#define BCM6318_RST_PCIE	7
+#define BCM6318_RST_PCIE_EXT	8
+#define BCM6318_RST_PCIE_HARD	9
+#define BCM6318_RST_ADSL	10
+#define BCM6318_RST_PHYMIPS	11
+#define BCM6318_RST_HOSTMIPS	11
+
+#endif /* __DT_BINDINGS_RESET_BCM6318_H */
Signature · 1 line
2.27.0
#58 lore raw

v5 cover bmips: add bcm6345 reset controller support

In reply to Álvaro Fernández Rojas

BCM63xx SoCs have a reset controller for certain components.

v5: fix kbuild robot error (drop __init).
v4: fix device tree bindings documentation.
v3: using reset-simple isn't possible since sleeping after performing the
reset is also needed.
Add BCM63268 and BCM6318 support.
v2: add compatibility to reset-simple instead of adding a new driver.

Álvaro Fernández Rojas (9):
mips: bmips: select ARCH_HAS_RESET_CONTROLLER
dt-bindings: reset: add BCM6345 reset controller bindings
reset: add BCM6345 reset controller driver
mips: bmips: dts: add BCM6328 reset controller support
mips: bmips: dts: add BCM6358 reset controller support
mips: bmips: dts: add BCM6362 reset controller support
mips: bmips: dts: add BCM6368 reset controller support
mips: bmips: dts: add BCM63268 reset controller support
mips: bmips: add BCM6318 reset controller definitions

 .../bindings/reset/brcm,bcm6345-reset.yaml    |  37 +++++
 arch/mips/Kconfig                             |   1 +
 arch/mips/boot/dts/brcm/bcm63268.dtsi         |   6 +
 arch/mips/boot/dts/brcm/bcm6328.dtsi          |   6 +
 arch/mips/boot/dts/brcm/bcm6358.dtsi          |   6 +
 arch/mips/boot/dts/brcm/bcm6362.dtsi          |   6 +
 arch/mips/boot/dts/brcm/bcm6368.dtsi          |   6 +
 drivers/reset/Kconfig                         |   7 +
 drivers/reset/Makefile                        |   1 +
 drivers/reset/reset-bcm6345.c                 | 135 ++++++++++++++++++
 include/dt-bindings/reset/bcm6318-reset.h     |  20 +++
 include/dt-bindings/reset/bcm63268-reset.h    |  26 ++++
 include/dt-bindings/reset/bcm6328-reset.h     |  18 +++
 include/dt-bindings/reset/bcm6358-reset.h     |  15 ++
 include/dt-bindings/reset/bcm6362-reset.h     |  22 +++
 include/dt-bindings/reset/bcm6368-reset.h     |  16 +++
 16 files changed, 328 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/brcm,bcm6345-reset.yaml
 create mode 100644 drivers/reset/reset-bcm6345.c
 create mode 100644 include/dt-bindings/reset/bcm6318-reset.h
 create mode 100644 include/dt-bindings/reset/bcm63268-reset.h
 create mode 100644 include/dt-bindings/reset/bcm6328-reset.h
 create mode 100644 include/dt-bindings/reset/bcm6358-reset.h
 create mode 100644 include/dt-bindings/reset/bcm6362-reset.h
 create mode 100644 include/dt-bindings/reset/bcm6368-reset.h
Signature · 1 line
2.27.0
#59 lore raw

PATCH v5 1/9 mips: bmips: select ARCH_HAS_RESET_CONTROLLER

This allows to add reset controllers support.

---
v5: no changes
v4: no changes
v3: no changes
v2: no changes

 arch/mips/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/mips/Kconfig +1 -0
index 6fee1a133e9d..b1840119cb64 100644
@@ -227,6 +227,7 @@ config ATH79
 
 config BMIPS_GENERIC
 	bool "Broadcom Generic BMIPS kernel"
+	select ARCH_HAS_RESET_CONTROLLER
 	select ARCH_HAS_SYNC_DMA_FOR_CPU_ALL
 	select ARCH_HAS_PHYS_TO_DMA
 	select BOOT_RAW
Signature · 1 line
2.27.0
#60 lore raw

PATCH v5 2/9 dt-bindings: reset: add BCM6345 reset controller bindings

In reply to Álvaro Fernández Rojas

Add device tree binding documentation for BCM6345 reset controller.

---
v5: no changes
v4: change license and fix maxItems.
v3: no changes
v2: no changes

 .../bindings/reset/brcm,bcm6345-reset.yaml    | 37 +++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/brcm,bcm6345-reset.yaml
Documentation/devicetree/bindings/reset/brcm,bcm6345-reset.yaml new file +37 -0
new file mode 100644
index 000000000000..560cf6522cb8
@@ -0,0 +1,37 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/reset/brcm,bcm6345-reset.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: BCM6345 reset controller
+
+description: This document describes the BCM6345 reset controller.
+
+maintainers:
+  - Álvaro Fernández Rojas <[email protected]>
+
+properties:
+  compatible:
+    const: brcm,bcm6345-reset
+
+  reg:
+    maxItems: 1
+
+  "#reset-cells":
+    const: 1
+
+required:
+  - compatible
+  - reg
+  - "#reset-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    reset-controller@10000010 {
+      compatible = "brcm,bcm6345-reset";
+      reg = <0x10000010 0x4>;
+      #reset-cells = <1>;
+    };
Signature · 1 line
2.27.0
#61 lore raw

PATCH v5 3/9 reset: add BCM6345 reset controller driver

In reply to Álvaro Fernández Rojas

Add support for resetting blocks through the Linux reset controller subsystem for BCM63xx SoCs.

---
v5: fix kbuild robot error (drop __init).
v4: no changes.
v3: using reset-simple isn't possible since sleeping after performing the
reset is also needed.
v2: add compatibility to reset-simple instead of adding a new driver.

 drivers/reset/Kconfig         |   7 ++
 drivers/reset/Makefile        |   1 +
 drivers/reset/reset-bcm6345.c | 135 ++++++++++++++++++++++++++++++++++
 3 files changed, 143 insertions(+)
 create mode 100644 drivers/reset/reset-bcm6345.c
drivers/reset/Kconfig +7 -0
index d9efbfd29646..9f1da978cef6 100644
@@ -41,6 +41,13 @@ config RESET_BERLIN
 	help
 	  This enables the reset controller driver for Marvell Berlin SoCs.
 
+config RESET_BCM6345
+	bool "BCM6345 Reset Controller"
+	depends on BMIPS_GENERIC || COMPILE_TEST
+	default BMIPS_GENERIC
+	help
+	  This enables the reset controller driver for BCM6345 SoCs.
+
 config RESET_BRCMSTB
 	tristate "Broadcom STB reset controller"
 	depends on ARCH_BRCMSTB || COMPILE_TEST
drivers/reset/Makefile +1 -0
index 249ed357c997..e642aae42f0f 100644
@@ -6,6 +6,7 @@ obj-$(CONFIG_ARCH_TEGRA) += tegra/
 obj-$(CONFIG_RESET_A10SR) += reset-a10sr.o
 obj-$(CONFIG_RESET_ATH79) += reset-ath79.o
 obj-$(CONFIG_RESET_AXS10X) += reset-axs10x.o
+obj-$(CONFIG_RESET_BCM6345) += reset-bcm6345.o
 obj-$(CONFIG_RESET_BERLIN) += reset-berlin.o
 obj-$(CONFIG_RESET_BRCMSTB) += reset-brcmstb.o
 obj-$(CONFIG_RESET_BRCMSTB_RESCAL) += reset-brcmstb-rescal.o
drivers/reset/reset-bcm6345.c new file +135 -0

135 lines not on this page · raw message

Signature · 1 line
2.27.0
#62 lore raw

PATCH v5 4/9 mips: bmips: dts: add BCM6328 reset controller support

In reply to Álvaro Fernández Rojas

BCM6328 SoCs have a reset controller for certain components.

---
v5: no changes.
v4: no changes.
v3: add reset controller definitions header file.
v2: no changes.

 arch/mips/boot/dts/brcm/bcm6328.dtsi      |  6 ++++++
 include/dt-bindings/reset/bcm6328-reset.h | 18 ++++++++++++++++++
 2 files changed, 24 insertions(+)
 create mode 100644 include/dt-bindings/reset/bcm6328-reset.h
arch/mips/boot/dts/brcm/bcm6328.dtsi +6 -0
index af860d06def6..590118cf5c12 100644
@@ -57,6 +57,12 @@ clkctl: clock-controller@10000004 {
 			#clock-cells = <1>;
 		};
 
+		periph_rst: reset-controller@10000010 {
+			compatible = "brcm,bcm6345-reset";
+			reg = <0x10000010 0x4>;
+			#reset-cells = <1>;
+		};
+
 		periph_intc: interrupt-controller@10000020 {
 			compatible = "brcm,bcm6345-l1-intc";
 			reg = <0x10000020 0x10>,
include/dt-bindings/reset/bcm6328-reset.h new file +18 -0
new file mode 100644
index 000000000000..0f3df87d47af
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+#ifndef __DT_BINDINGS_RESET_BCM6328_H
+#define __DT_BINDINGS_RESET_BCM6328_H
+
+#define BCM6328_RST_SPI		0
+#define BCM6328_RST_EPHY	1
+#define BCM6328_RST_SAR		2
+#define BCM6328_RST_ENETSW	3
+#define BCM6328_RST_USBS	4
+#define BCM6328_RST_USBH	5
+#define BCM6328_RST_PCM		6
+#define BCM6328_RST_PCIE_CORE	7
+#define BCM6328_RST_PCIE	8
+#define BCM6328_RST_PCIE_EXT	9
+#define BCM6328_RST_PCIE_HARD	10
+
+#endif /* __DT_BINDINGS_RESET_BCM6328_H */
Signature · 1 line
2.27.0
#63 lore raw

PATCH v5 5/9 mips: bmips: dts: add BCM6358 reset controller support

In reply to Álvaro Fernández Rojas

BCM6358 SoCs have a reset controller for certain components.

---
v5: no changes.
v4: no changes.
v3: add reset controller definitions header file.
v2: no changes.

 arch/mips/boot/dts/brcm/bcm6358.dtsi      |  6 ++++++
 include/dt-bindings/reset/bcm6358-reset.h | 15 +++++++++++++++
 2 files changed, 21 insertions(+)
 create mode 100644 include/dt-bindings/reset/bcm6358-reset.h
arch/mips/boot/dts/brcm/bcm6358.dtsi +6 -0
index f21176cac038..9d93e7f5e6fc 100644
@@ -82,6 +82,12 @@ periph_intc: interrupt-controller@fffe000c {
 			interrupts = <2>, <3>;
 		};
 
+		periph_rst: reset-controller@fffe0034 {
+			compatible = "brcm,bcm6345-reset";
+			reg = <0xfffe0034 0x4>;
+			#reset-cells = <1>;
+		};
+
 		leds0: led-controller@fffe00d0 {
 			#address-cells = <1>;
 			#size-cells = <0>;
include/dt-bindings/reset/bcm6358-reset.h new file +15 -0
new file mode 100644
index 000000000000..bda62ef84f5a
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+#ifndef __DT_BINDINGS_RESET_BCM6358_H
+#define __DT_BINDINGS_RESET_BCM6358_H
+
+#define BCM6358_RST_SPI		0
+#define BCM6358_RST_ENET	2
+#define BCM6358_RST_MPI		3
+#define BCM6358_RST_EPHY	6
+#define BCM6358_RST_SAR		7
+#define BCM6358_RST_USBH	12
+#define BCM6358_RST_PCM		13
+#define BCM6358_RST_ADSL	14
+
+#endif /* __DT_BINDINGS_RESET_BCM6358_H */
Signature · 1 line
2.27.0
#64 lore raw

PATCH v5 6/9 mips: bmips: dts: add BCM6362 reset controller support

In reply to Álvaro Fernández Rojas

BCM6362 SoCs have a reset controller for certain components.

---
v5: no changes.
v4: no changes.
v3: add reset controller definitions header file.
v2: no changes.

 arch/mips/boot/dts/brcm/bcm6362.dtsi      |  6 ++++++
 include/dt-bindings/reset/bcm6362-reset.h | 22 ++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 include/dt-bindings/reset/bcm6362-reset.h
arch/mips/boot/dts/brcm/bcm6362.dtsi +6 -0
index 8ae6981735b8..443af6b4c838 100644
@@ -70,6 +70,12 @@ reboot: syscon-reboot@10000008 {
 			mask = <0x1>;
 		};
 
+		periph_rst: reset-controller@10000010 {
+			compatible = "brcm,bcm6345-reset";
+			reg = <0x10000010 0x4>;
+			#reset-cells = <1>;
+		};
+
 		periph_intc: interrupt-controller@10000020 {
 			compatible = "brcm,bcm6345-l1-intc";
 			reg = <0x10000020 0x10>,
include/dt-bindings/reset/bcm6362-reset.h new file +22 -0
new file mode 100644
index 000000000000..7ebb0546e0ab
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+#ifndef __DT_BINDINGS_RESET_BCM6362_H
+#define __DT_BINDINGS_RESET_BCM6362_H
+
+#define BCM6362_RST_SPI		0
+#define BCM6362_RST_IPSEC	1
+#define BCM6362_RST_EPHY	2
+#define BCM6362_RST_SAR		3
+#define BCM6362_RST_ENETSW	4
+#define BCM6362_RST_USBD	5
+#define BCM6362_RST_USBH	6
+#define BCM6362_RST_PCM		7
+#define BCM6362_RST_PCIE_CORE	8
+#define BCM6362_RST_PCIE	9
+#define BCM6362_RST_PCIE_EXT	10
+#define BCM6362_RST_WLAN_SHIM	11
+#define BCM6362_RST_DDR_PHY	12
+#define BCM6362_RST_FAP		13
+#define BCM6362_RST_WLAN_UBUS	14
+
+#endif /* __DT_BINDINGS_RESET_BCM6362_H */
Signature · 1 line
2.27.0
#65 lore raw

PATCH v5 7/9 mips: bmips: dts: add BCM6368 reset controller support

In reply to Álvaro Fernández Rojas

BCM6368 SoCs have a reset controller for certain components.

---
v5: no changes.
v4: no changes.
v3: add reset controller definitions header file.
v2: no changes.

 arch/mips/boot/dts/brcm/bcm6368.dtsi      |  6 ++++++
 include/dt-bindings/reset/bcm6368-reset.h | 16 ++++++++++++++++
 2 files changed, 22 insertions(+)
 create mode 100644 include/dt-bindings/reset/bcm6368-reset.h
arch/mips/boot/dts/brcm/bcm6368.dtsi +6 -0
index 449c167dd892..52c19f40b9cc 100644
@@ -70,6 +70,12 @@ reboot: syscon-reboot@10000008 {
 			mask = <0x1>;
 		};
 
+		periph_rst: reset-controller@10000010 {
+			compatible = "brcm,bcm6345-reset";
+			reg = <0x10000010 0x4>;
+			#reset-cells = <1>;
+		};
+
 		periph_intc: interrupt-controller@10000020 {
 			compatible = "brcm,bcm6345-l1-intc";
 			reg = <0x10000020 0x10>,
include/dt-bindings/reset/bcm6368-reset.h new file +16 -0
new file mode 100644
index 000000000000..c81d8eb6d173
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+#ifndef __DT_BINDINGS_RESET_BCM6368_H
+#define __DT_BINDINGS_RESET_BCM6368_H
+
+#define BCM6368_RST_SPI		0
+#define BCM6368_RST_MPI		3
+#define BCM6368_RST_IPSEC	4
+#define BCM6368_RST_EPHY	6
+#define BCM6368_RST_SAR		7
+#define BCM6368_RST_SWITCH	10
+#define BCM6368_RST_USBD	11
+#define BCM6368_RST_USBH	12
+#define BCM6368_RST_PCM		13
+
+#endif /* __DT_BINDINGS_RESET_BCM6368_H */
Signature · 1 line
2.27.0
#66 lore raw

PATCH v5 8/9 mips: bmips: dts: add BCM63268 reset controller support

In reply to Álvaro Fernández Rojas

BCM63268 SoCs have a reset controller for certain components.

---
v5: no changes.
v4: no changes.
v3: add new path with BCM63268 reset controller support.

 arch/mips/boot/dts/brcm/bcm63268.dtsi      |  6 +++++
 include/dt-bindings/reset/bcm63268-reset.h | 26 ++++++++++++++++++++++
 2 files changed, 32 insertions(+)
 create mode 100644 include/dt-bindings/reset/bcm63268-reset.h
arch/mips/boot/dts/brcm/bcm63268.dtsi +6 -0
index beec24145af7..0150da7e3905 100644
@@ -70,6 +70,12 @@ reboot: syscon-reboot@10000008 {
 			mask = <0x1>;
 		};
 
+		periph_rst: reset-controller@10000010 {
+			compatible = "brcm,bcm6345-reset";
+			reg = <0x10000010 0x4>;
+			#reset-cells = <1>;
+		};
+
 		periph_intc: interrupt-controller@10000020 {
 			compatible = "brcm,bcm6345-l1-intc";
 			reg = <0x10000020 0x20>,
include/dt-bindings/reset/bcm63268-reset.h new file +26 -0
new file mode 100644
index 000000000000..6a6403a4c2d5
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+#ifndef __DT_BINDINGS_RESET_BCM63268_H
+#define __DT_BINDINGS_RESET_BCM63268_H
+
+#define BCM63268_RST_SPI	0
+#define BCM63268_RST_IPSEC	1
+#define BCM63268_RST_EPHY	2
+#define BCM63268_RST_SAR	3
+#define BCM63268_RST_ENETSW	4
+#define BCM63268_RST_USBS	5
+#define BCM63268_RST_USBH	6
+#define BCM63268_RST_PCM	7
+#define BCM63268_RST_PCIE_CORE	8
+#define BCM63268_RST_PCIE	9
+#define BCM63268_RST_PCIE_EXT	10
+#define BCM63268_RST_WLAN_SHIM	11
+#define BCM63268_RST_DDR_PHY	12
+#define BCM63268_RST_FAP0	13
+#define BCM63268_RST_WLAN_UBUS	14
+#define BCM63268_RST_DECT	15
+#define BCM63268_RST_FAP1	16
+#define BCM63268_RST_PCIE_HARD	17
+#define BCM63268_RST_GPHY	18
+
+#endif /* __DT_BINDINGS_RESET_BCM63268_H */
Signature · 1 line
2.27.0
#67 lore raw

PATCH v5 9/9 mips: bmips: add BCM6318 reset controller definitions

In reply to Álvaro Fernández Rojas

BCM6318 SoCs have a reset controller for certain components.

---
v5: no changes.
v4: no changes.
v3: add new path with BCM6318 reset controller definitions.

 include/dt-bindings/reset/bcm6318-reset.h | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 include/dt-bindings/reset/bcm6318-reset.h
include/dt-bindings/reset/bcm6318-reset.h new file +20 -0
new file mode 100644
index 000000000000..f4fef7bfb06d
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+#ifndef __DT_BINDINGS_RESET_BCM6318_H
+#define __DT_BINDINGS_RESET_BCM6318_H
+
+#define BCM6318_RST_SPI		0
+#define BCM6318_RST_EPHY	1
+#define BCM6318_RST_SAR		2
+#define BCM6318_RST_ENETSW	3
+#define BCM6318_RST_USBD	4
+#define BCM6318_RST_USBH	5
+#define BCM6318_RST_PCIE_CORE	6
+#define BCM6318_RST_PCIE	7
+#define BCM6318_RST_PCIE_EXT	8
+#define BCM6318_RST_PCIE_HARD	9
+#define BCM6318_RST_ADSL	10
+#define BCM6318_RST_PHYMIPS	11
+#define BCM6318_RST_HOSTMIPS	11
+
+#endif /* __DT_BINDINGS_RESET_BCM6318_H */
Signature · 1 line
2.27.0