]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
sysreset: socfpga: stratix10: add sysreset driver
authorSimon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Mon, 15 Jul 2019 19:47:54 +0000 (21:47 +0200)
committerMarek Vasut <marex@denx.de>
Sun, 21 Jul 2019 10:45:10 +0000 (12:45 +0200)
This adds a UCLASS_SYSRESET sysreset driver for socfgpa stratix10.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
MAINTAINERS
drivers/sysreset/Kconfig
drivers/sysreset/Makefile
drivers/sysreset/sysreset_socfpga_s10.c [new file with mode: 0644]

index 8031cc92f55dce9202c3826eff964b780ca903ad..495510863f62a35003d1867703f8538e60b4b980 100644 (file)
@@ -94,7 +94,7 @@ M:    Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
 S:     Maintainted
 T:     git https://gitlab.denx.de/u-boot/custodians/u-boot-socfpga.git
 F:     arch/arm/mach-socfpga/
-F:     drivers/sysreset/sysreset_socfpga.c
+F:     drivers/sysreset/sysreset_socfpga*
 
 ARM AMLOGIC SOC SUPPORT
 M:     Neil Armstrong <narmstrong@baylibre.com>
index 6b4bec12ad851fc2d99dab809eec72b3aa26aef4..024404d51d022dbd8b9651d534bdbe70e87fd018 100644 (file)
@@ -61,6 +61,13 @@ config SYSRESET_SOCFPGA
          This enables the system reset driver support for Intel SOCFPGA SoCs
          (Cyclone 5, Arria 5 and Arria 10).
 
+config SYSRESET_SOCFPGA_S10
+       bool "Enable support for Intel SOCFPGA Stratix 10"
+       depends on ARCH_SOCFPGA && TARGET_SOCFPGA_STRATIX10
+       help
+         This enables the system reset driver support for Intel SOCFPGA
+         Stratix SoCs.
+
 config SYSRESET_TI_SCI
        bool "TI System Control Interface (TI SCI) system reset driver"
        depends on TI_SCI_PROTOCOL
index 180e46301d2dd2a03adba28174c96d84080c5e2d..cf01492295f7dccbafaa6a3fd6198e68c37c2cef 100644 (file)
@@ -12,6 +12,7 @@ obj-$(CONFIG_SYSRESET_MCP83XX) += sysreset_mpc83xx.o
 obj-$(CONFIG_SYSRESET_MICROBLAZE) += sysreset_microblaze.o
 obj-$(CONFIG_SYSRESET_PSCI) += sysreset_psci.o
 obj-$(CONFIG_SYSRESET_SOCFPGA) += sysreset_socfpga.o
+obj-$(CONFIG_SYSRESET_SOCFPGA_S10) += sysreset_socfpga_s10.o
 obj-$(CONFIG_SYSRESET_TI_SCI) += sysreset-ti-sci.o
 obj-$(CONFIG_SYSRESET_SYSCON) += sysreset_syscon.o
 obj-$(CONFIG_SYSRESET_WATCHDOG) += sysreset_watchdog.o
diff --git a/drivers/sysreset/sysreset_socfpga_s10.c b/drivers/sysreset/sysreset_socfpga_s10.c
new file mode 100644 (file)
index 0000000..9837aad
--- /dev/null
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2019 Pepperl+Fuchs
+ * Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <errno.h>
+#include <sysreset.h>
+#include <asm/arch/mailbox_s10.h>
+
+static int socfpga_sysreset_request(struct udevice *dev,
+                                   enum sysreset_t type)
+{
+       puts("Mailbox: Issuing mailbox cmd REBOOT_HPS\n");
+       mbox_reset_cold();
+       return -EINPROGRESS;
+}
+
+static struct sysreset_ops socfpga_sysreset = {
+       .request = socfpga_sysreset_request,
+};
+
+U_BOOT_DRIVER(sysreset_socfpga) = {
+       .id     = UCLASS_SYSRESET,
+       .name   = "socfpga_sysreset",
+       .ops    = &socfpga_sysreset,
+};