* [PATCH 0/3] power: reset: BCM63xx reboot support
@ 2015-03-25 0:17 Florian Fainelli
2015-03-25 0:17 ` [PATCH 1/3] Documentation: bindings: add BCM6328-style soft reset binding Florian Fainelli
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Florian Fainelli @ 2015-03-25 0:17 UTC (permalink / raw)
To: linux-kernel
Cc: Florian Fainelli, jogo, cernekee, computersforpeace,
gregory.0xf0, Sebastian Reichel, Dmitry Eremin-Solenikov,
David Woodhouse, linux-pm, linux-arm-kernel,
bcm-kernel-feedback-list
Hi all,
This patch series adds support for the BCM6328-style software reset hardware
block commonly found on Broadcom BCM63xx DSL SoCs.
Thanks!
Florian Fainelli (3):
Documentation: bindings: add BCM6328-style soft reset binding
power: reset: add Broadcom BCM63xx software reset driver
ARM: dts: BCM63xx: add soft-reset node
.../devicetree/bindings/arm/bcm/bcm63138.txt | 16 +++++
arch/arm/boot/dts/bcm63138.dtsi | 5 ++
drivers/power/reset/Kconfig | 7 ++
drivers/power/reset/Makefile | 1 +
drivers/power/reset/bcm63xx-reboot.c | 80 ++++++++++++++++++++++
5 files changed, 109 insertions(+)
create mode 100644 drivers/power/reset/bcm63xx-reboot.c
--
2.1.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/3] Documentation: bindings: add BCM6328-style soft reset binding
2015-03-25 0:17 [PATCH 0/3] power: reset: BCM63xx reboot support Florian Fainelli
@ 2015-03-25 0:17 ` Florian Fainelli
2015-03-25 0:17 ` [PATCH 2/3] power: reset: add Broadcom BCM63xx software reset driver Florian Fainelli
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2015-03-25 0:17 UTC (permalink / raw)
To: linux-kernel
Cc: Florian Fainelli, jogo, cernekee, computersforpeace,
gregory.0xf0, Sebastian Reichel, Dmitry Eremin-Solenikov,
David Woodhouse, linux-pm, linux-arm-kernel,
bcm-kernel-feedback-list
Add a binding document for the BCM6328-style software reset block found
in MIPS and ARM based Broadcom BCM63xx DSL SoCs.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
Documentation/devicetree/bindings/arm/bcm/bcm63138.txt | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/Documentation/devicetree/bindings/arm/bcm/bcm63138.txt b/Documentation/devicetree/bindings/arm/bcm/bcm63138.txt
index bd49987a8812..bddf76d8dda4 100644
--- a/Documentation/devicetree/bindings/arm/bcm/bcm63138.txt
+++ b/Documentation/devicetree/bindings/arm/bcm/bcm63138.txt
@@ -7,3 +7,19 @@ following properties:
Required root node property:
compatible: should be "brcm,bcm63138"
+
+
+reboot node
+-----------
+
+Required properties
+
+- compatible: sould be "brcm,bcm6328-soft-reset"
+- reg: should be the base register addresse and length
+
+Example:
+
+reboot@b0 {
+ compatible = "brcm,bcm6328-soft-reset";
+ reg = <0xb0 0x4>;
+};
--
2.1.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] power: reset: add Broadcom BCM63xx software reset driver
2015-03-25 0:17 [PATCH 0/3] power: reset: BCM63xx reboot support Florian Fainelli
2015-03-25 0:17 ` [PATCH 1/3] Documentation: bindings: add BCM6328-style soft reset binding Florian Fainelli
@ 2015-03-25 0:17 ` Florian Fainelli
2015-03-25 0:17 ` [PATCH 3/3] ARM: dts: BCM63xx: add soft-reset node Florian Fainelli
2015-04-21 18:51 ` [PATCH 0/3] power: reset: BCM63xx reboot support Florian Fainelli
3 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2015-03-25 0:17 UTC (permalink / raw)
To: linux-kernel
Cc: Florian Fainelli, jogo, cernekee, computersforpeace,
gregory.0xf0, Sebastian Reichel, Dmitry Eremin-Solenikov,
David Woodhouse, linux-pm, linux-arm-kernel,
bcm-kernel-feedback-list
Add a sofware reset driver for the Broadcom BCM63xx DSL SoCs, starting
with 6328 all the way through newer chips such as 63138.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/power/reset/Kconfig | 7 ++++
drivers/power/reset/Makefile | 1 +
drivers/power/reset/bcm63xx-reboot.c | 80 ++++++++++++++++++++++++++++++++++++
3 files changed, 88 insertions(+)
create mode 100644 drivers/power/reset/bcm63xx-reboot.c
diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
index 27f6646731b0..c20c76870f42 100644
--- a/drivers/power/reset/Kconfig
+++ b/drivers/power/reset/Kconfig
@@ -38,6 +38,13 @@ config POWER_RESET_AXXIA
Say Y if you have an Axxia family SoC.
+config POWER_RESET_BCM63XX
+ bool "Broadcom BCM63xx reset driver"
+ depends on ARM || MIPS || COMPILE_TEST
+ default ARCH_BCM_63XX
+ help
+ This driver provides restart support for the Broadcom DSL SoCs.
+
config POWER_RESET_BRCMSTB
bool "Broadcom STB reset driver"
depends on ARM || MIPS || COMPILE_TEST
diff --git a/drivers/power/reset/Makefile b/drivers/power/reset/Makefile
index 11de15bae52e..7d28eaff4cd1 100644
--- a/drivers/power/reset/Makefile
+++ b/drivers/power/reset/Makefile
@@ -2,6 +2,7 @@ obj-$(CONFIG_POWER_RESET_AS3722) += as3722-poweroff.o
obj-$(CONFIG_POWER_RESET_AT91_POWEROFF) += at91-poweroff.o
obj-$(CONFIG_POWER_RESET_AT91_RESET) += at91-reset.o
obj-$(CONFIG_POWER_RESET_AXXIA) += axxia-reset.o
+obj-$(CONFIG_POWER_RESET_BCM63XX) += bcm63xx-reboot.o
obj-$(CONFIG_POWER_RESET_BRCMSTB) += brcmstb-reboot.o
obj-$(CONFIG_POWER_RESET_GPIO) += gpio-poweroff.o
obj-$(CONFIG_POWER_RESET_GPIO_RESTART) += gpio-restart.o
diff --git a/drivers/power/reset/bcm63xx-reboot.c b/drivers/power/reset/bcm63xx-reboot.c
new file mode 100644
index 000000000000..1e3a93c38784
--- /dev/null
+++ b/drivers/power/reset/bcm63xx-reboot.c
@@ -0,0 +1,80 @@
+/*
+ * Broadcom BCM63xx DSL SoCs reboot handler
+ *
+ * Copyright (C) 2015, Broadcom Corporation
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/device.h>
+#include <linux/io.h>
+#include <linux/platform_device.h>
+#include <linux/reboot.h>
+#include <linux/of.h>
+
+static void __iomem *rst_base;
+
+#define SOFT_RESET BIT(0)
+
+static int bcm63xx_restart_handler(struct notifier_block *this,
+ unsigned long mdoe, void *cmd)
+{
+ u32 reg;
+
+ reg = __raw_readl(rst_base);
+ reg |= SOFT_RESET;
+ __raw_writel(reg, rst_base);
+
+ while (1)
+ ;
+
+ return NOTIFY_DONE;
+}
+
+static struct notifier_block bcm63xx_restart_nb = {
+ .notifier_call = bcm63xx_restart_handler,
+ .priority = 128,
+};
+
+#ifdef CONFIG_OF
+static const struct of_device_id bcm63xx_reboot_of_match[] = {
+ { .compatible = "brcm,bcm6328-soft-reset", },
+ { /* sentinel */ },
+};
+#endif
+
+static int bcm63xx_reboot_probe(struct platform_device *pdev)
+{
+ struct resource *r;
+
+ r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ rst_base = devm_ioremap_resource(&pdev->dev, r);
+ if (IS_ERR(rst_base)) {
+ dev_err(&pdev->dev, "failed to remap registers\n");
+ return PTR_ERR(rst_base);
+ }
+
+ return register_restart_handler(&bcm63xx_restart_nb);
+}
+
+static struct platform_driver bcm63xx_reboot_driver = {
+ .probe = bcm63xx_reboot_probe,
+ .driver = {
+ .name = "bcm63xx-soft-reset",
+ .of_match_table = of_match_ptr(bcm63xx_reboot_of_match),
+ },
+};
+
+static int __init bcm63xx_reboot_init(void)
+{
+ return platform_driver_probe(&bcm63xx_reboot_driver,
+ bcm63xx_reboot_probe);
+}
+subsys_initcall(bcm63xx_reboot_init);
--
2.1.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] ARM: dts: BCM63xx: add soft-reset node
2015-03-25 0:17 [PATCH 0/3] power: reset: BCM63xx reboot support Florian Fainelli
2015-03-25 0:17 ` [PATCH 1/3] Documentation: bindings: add BCM6328-style soft reset binding Florian Fainelli
2015-03-25 0:17 ` [PATCH 2/3] power: reset: add Broadcom BCM63xx software reset driver Florian Fainelli
@ 2015-03-25 0:17 ` Florian Fainelli
2015-04-21 18:51 ` [PATCH 0/3] power: reset: BCM63xx reboot support Florian Fainelli
3 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2015-03-25 0:17 UTC (permalink / raw)
To: linux-kernel
Cc: Florian Fainelli, jogo, cernekee, computersforpeace,
gregory.0xf0, Sebastian Reichel, Dmitry Eremin-Solenikov,
David Woodhouse, linux-pm, linux-arm-kernel,
bcm-kernel-feedback-list
Add the software reset Device Tree node allowing us to software reset a
BCM63138 device using bcm6328-soft-reset.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
arch/arm/boot/dts/bcm63138.dtsi | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/boot/dts/bcm63138.dtsi b/arch/arm/boot/dts/bcm63138.dtsi
index f46329c8ad75..cfd7f67fed02 100644
--- a/arch/arm/boot/dts/bcm63138.dtsi
+++ b/arch/arm/boot/dts/bcm63138.dtsi
@@ -114,6 +114,11 @@
#size-cells = <1>;
ranges = <0 0xfffe8000 0x8100>;
+ reset: soft-reset@b4 {
+ compatible = "brcm,bcm6328-soft-reset";
+ reg = <0xb4 0x4>;
+ };
+
serial0: serial@600 {
compatible = "brcm,bcm6345-uart";
reg = <0x600 0x1b>;
--
2.1.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3] power: reset: BCM63xx reboot support
2015-03-25 0:17 [PATCH 0/3] power: reset: BCM63xx reboot support Florian Fainelli
` (2 preceding siblings ...)
2015-03-25 0:17 ` [PATCH 3/3] ARM: dts: BCM63xx: add soft-reset node Florian Fainelli
@ 2015-04-21 18:51 ` Florian Fainelli
2015-04-30 15:25 ` Sebastian Reichel
3 siblings, 1 reply; 6+ messages in thread
From: Florian Fainelli @ 2015-04-21 18:51 UTC (permalink / raw)
To: Florian Fainelli, linux-kernel
Cc: jogo, cernekee, computersforpeace, gregory.0xf0,
Sebastian Reichel, Dmitry Eremin-Solenikov, David Woodhouse,
linux-pm, linux-arm-kernel, bcm-kernel-feedback-list
On 24/03/15 17:17, Florian Fainelli wrote:
> Hi all,
>
> This patch series adds support for the BCM6328-style software reset hardware
> block commonly found on Broadcom BCM63xx DSL SoCs.
Looks like we can utilize the generic syscon reboot driver instead of
open-coding one, let's do that instead.
>
> Thanks!
>
> Florian Fainelli (3):
> Documentation: bindings: add BCM6328-style soft reset binding
> power: reset: add Broadcom BCM63xx software reset driver
> ARM: dts: BCM63xx: add soft-reset node
>
> .../devicetree/bindings/arm/bcm/bcm63138.txt | 16 +++++
> arch/arm/boot/dts/bcm63138.dtsi | 5 ++
> drivers/power/reset/Kconfig | 7 ++
> drivers/power/reset/Makefile | 1 +
> drivers/power/reset/bcm63xx-reboot.c | 80 ++++++++++++++++++++++
> 5 files changed, 109 insertions(+)
> create mode 100644 drivers/power/reset/bcm63xx-reboot.c
>
--
Florian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3] power: reset: BCM63xx reboot support
2015-04-21 18:51 ` [PATCH 0/3] power: reset: BCM63xx reboot support Florian Fainelli
@ 2015-04-30 15:25 ` Sebastian Reichel
0 siblings, 0 replies; 6+ messages in thread
From: Sebastian Reichel @ 2015-04-30 15:25 UTC (permalink / raw)
To: Florian Fainelli
Cc: Florian Fainelli, linux-kernel, jogo, cernekee,
computersforpeace, gregory.0xf0, Dmitry Eremin-Solenikov,
David Woodhouse, linux-pm, linux-arm-kernel,
bcm-kernel-feedback-list
[-- Attachment #1: Type: text/plain, Size: 442 bytes --]
Hi,
On Tue, Apr 21, 2015 at 11:51:32AM -0700, Florian Fainelli wrote:
> On 24/03/15 17:17, Florian Fainelli wrote:
> > Hi all,
> >
> > This patch series adds support for the BCM6328-style software reset hardware
> > block commonly found on Broadcom BCM63xx DSL SoCs.
>
> Looks like we can utilize the generic syscon reboot driver instead of
> open-coding one, let's do that instead.
Thanks, that's preferred.
-- Sebastian
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-04-30 15:25 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-25 0:17 [PATCH 0/3] power: reset: BCM63xx reboot support Florian Fainelli
2015-03-25 0:17 ` [PATCH 1/3] Documentation: bindings: add BCM6328-style soft reset binding Florian Fainelli
2015-03-25 0:17 ` [PATCH 2/3] power: reset: add Broadcom BCM63xx software reset driver Florian Fainelli
2015-03-25 0:17 ` [PATCH 3/3] ARM: dts: BCM63xx: add soft-reset node Florian Fainelli
2015-04-21 18:51 ` [PATCH 0/3] power: reset: BCM63xx reboot support Florian Fainelli
2015-04-30 15:25 ` Sebastian Reichel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).