mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] MIPS: qemu-malta: use generic syscon reset driver
@ 2021-04-25  6:35 Antony Pavlov
  2021-04-28  4:39 ` Antony Pavlov
  2021-05-03 11:17 ` Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Antony Pavlov @ 2021-04-25  6:35 UTC (permalink / raw)
  To: barebox

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/mips/configs/qemu-malta_defconfig |  2 ++
 arch/mips/dts/qemu-malta.dts           | 13 +++++++++++
 arch/mips/mach-malta/Makefile          |  1 -
 arch/mips/mach-malta/reset.c           | 31 --------------------------
 4 files changed, 15 insertions(+), 32 deletions(-)

diff --git a/arch/mips/configs/qemu-malta_defconfig b/arch/mips/configs/qemu-malta_defconfig
index b9994f392c..ab3abb7a2a 100644
--- a/arch/mips/configs/qemu-malta_defconfig
+++ b/arch/mips/configs/qemu-malta_defconfig
@@ -75,6 +75,8 @@ CONFIG_DRIVER_VIDEO_BOCHS_PCI=y
 CONFIG_GPIO_MALTA_FPGA_I2C=y
 CONFIG_PCI=y
 CONFIG_PCI_DEBUG=y
+CONFIG_SYSCON_REBOOT_MODE=y
+CONFIG_POWER_RESET_SYSCON=y
 CONFIG_FS_CRAMFS=y
 CONFIG_FS_TFTP=y
 CONFIG_FS_FAT=y
diff --git a/arch/mips/dts/qemu-malta.dts b/arch/mips/dts/qemu-malta.dts
index 32e473cac0..2d6f4a0ca3 100644
--- a/arch/mips/dts/qemu-malta.dts
+++ b/arch/mips/dts/qemu-malta.dts
@@ -27,6 +27,19 @@
 		clock-frequency = <1843200>;
 	};
 
+	fpga_regs: system-controller@1f000000 {
+		compatible = "mti,malta-fpga", "syscon", "simple-mfd";
+		reg = <0x1f000000 0x600>;
+		native-endian;
+
+		reboot {
+			compatible = "syscon-reboot";
+			regmap = <&fpga_regs>;
+			offset = <0x500>;
+			mask = <0x42>;
+		};
+	};
+
 	gpio: gpio@1f000b00 {
 		compatible = "mti,malta-fpga-i2c-gpio";
 		gpio-controller;
diff --git a/arch/mips/mach-malta/Makefile b/arch/mips/mach-malta/Makefile
index 0c5a7018d4..7d56f215b0 100644
--- a/arch/mips/mach-malta/Makefile
+++ b/arch/mips/mach-malta/Makefile
@@ -1,2 +1 @@
-obj-y += reset.o
 obj-$(CONFIG_PCI) += pci.o
diff --git a/arch/mips/mach-malta/reset.c b/arch/mips/mach-malta/reset.c
deleted file mode 100644
index ad0de2741b..0000000000
--- a/arch/mips/mach-malta/reset.c
+++ /dev/null
@@ -1,31 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Copyright (C) 2011 Antony Pavlov <antonynpavlov@gmail.com>
- */
-
-/**
- * @file
- * @brief Resetting an malta board
- */
-
-#include <common.h>
-#include <io.h>
-#include <init.h>
-#include <restart.h>
-#include <mach/hardware.h>
-
-static void __noreturn malta_restart_soc(struct restart_handler *rst)
-{
-	__raw_writel(GORESET, (char *)SOFTRES_REG);
-
-	hang();
-	/*NOTREACHED*/
-}
-
-static int restart_register_feature(void)
-{
-	restart_handler_register_fn("soc", malta_restart_soc);
-
-	return 0;
-}
-coredevice_initcall(restart_register_feature);
-- 
2.31.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Re: [PATCH] MIPS: qemu-malta: use generic syscon reset driver
  2021-04-25  6:35 [PATCH] MIPS: qemu-malta: use generic syscon reset driver Antony Pavlov
@ 2021-04-28  4:39 ` Antony Pavlov
  2021-05-03 11:17 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Antony Pavlov @ 2021-04-28  4:39 UTC (permalink / raw)
  To: barebox, Sascha Hauer

On Sun, 25 Apr 2021 09:35:17 +0300
Antony Pavlov <antonynpavlov@gmail.com> wrote:

ping

> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
> ---
>  arch/mips/configs/qemu-malta_defconfig |  2 ++
>  arch/mips/dts/qemu-malta.dts           | 13 +++++++++++
>  arch/mips/mach-malta/Makefile          |  1 -
>  arch/mips/mach-malta/reset.c           | 31 --------------------------
>  4 files changed, 15 insertions(+), 32 deletions(-)
> 
> diff --git a/arch/mips/configs/qemu-malta_defconfig b/arch/mips/configs/qemu-malta_defconfig
> index b9994f392c..ab3abb7a2a 100644
> --- a/arch/mips/configs/qemu-malta_defconfig
> +++ b/arch/mips/configs/qemu-malta_defconfig
> @@ -75,6 +75,8 @@ CONFIG_DRIVER_VIDEO_BOCHS_PCI=y
>  CONFIG_GPIO_MALTA_FPGA_I2C=y
>  CONFIG_PCI=y
>  CONFIG_PCI_DEBUG=y
> +CONFIG_SYSCON_REBOOT_MODE=y
> +CONFIG_POWER_RESET_SYSCON=y
>  CONFIG_FS_CRAMFS=y
>  CONFIG_FS_TFTP=y
>  CONFIG_FS_FAT=y
> diff --git a/arch/mips/dts/qemu-malta.dts b/arch/mips/dts/qemu-malta.dts
> index 32e473cac0..2d6f4a0ca3 100644
> --- a/arch/mips/dts/qemu-malta.dts
> +++ b/arch/mips/dts/qemu-malta.dts
> @@ -27,6 +27,19 @@
>  		clock-frequency = <1843200>;
>  	};
>  
> +	fpga_regs: system-controller@1f000000 {
> +		compatible = "mti,malta-fpga", "syscon", "simple-mfd";
> +		reg = <0x1f000000 0x600>;
> +		native-endian;
> +
> +		reboot {
> +			compatible = "syscon-reboot";
> +			regmap = <&fpga_regs>;
> +			offset = <0x500>;
> +			mask = <0x42>;
> +		};
> +	};
> +
>  	gpio: gpio@1f000b00 {
>  		compatible = "mti,malta-fpga-i2c-gpio";
>  		gpio-controller;
> diff --git a/arch/mips/mach-malta/Makefile b/arch/mips/mach-malta/Makefile
> index 0c5a7018d4..7d56f215b0 100644
> --- a/arch/mips/mach-malta/Makefile
> +++ b/arch/mips/mach-malta/Makefile
> @@ -1,2 +1 @@
> -obj-y += reset.o
>  obj-$(CONFIG_PCI) += pci.o
> diff --git a/arch/mips/mach-malta/reset.c b/arch/mips/mach-malta/reset.c
> deleted file mode 100644
> index ad0de2741b..0000000000
> --- a/arch/mips/mach-malta/reset.c
> +++ /dev/null
> @@ -1,31 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - * Copyright (C) 2011 Antony Pavlov <antonynpavlov@gmail.com>
> - */
> -
> -/**
> - * @file
> - * @brief Resetting an malta board
> - */
> -
> -#include <common.h>
> -#include <io.h>
> -#include <init.h>
> -#include <restart.h>
> -#include <mach/hardware.h>
> -
> -static void __noreturn malta_restart_soc(struct restart_handler *rst)
> -{
> -	__raw_writel(GORESET, (char *)SOFTRES_REG);
> -
> -	hang();
> -	/*NOTREACHED*/
> -}
> -
> -static int restart_register_feature(void)
> -{
> -	restart_handler_register_fn("soc", malta_restart_soc);
> -
> -	return 0;
> -}
> -coredevice_initcall(restart_register_feature);
> -- 
> 2.31.1
> 


-- 
Best regards,
  Antony Pavlov

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Re: [PATCH] MIPS: qemu-malta: use generic syscon reset driver
  2021-04-25  6:35 [PATCH] MIPS: qemu-malta: use generic syscon reset driver Antony Pavlov
  2021-04-28  4:39 ` Antony Pavlov
@ 2021-05-03 11:17 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2021-05-03 11:17 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: barebox

On Sun, Apr 25, 2021 at 09:35:17AM +0300, Antony Pavlov wrote:
> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
> ---
>  arch/mips/configs/qemu-malta_defconfig |  2 ++
>  arch/mips/dts/qemu-malta.dts           | 13 +++++++++++
>  arch/mips/mach-malta/Makefile          |  1 -
>  arch/mips/mach-malta/reset.c           | 31 --------------------------
>  4 files changed, 15 insertions(+), 32 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/arch/mips/configs/qemu-malta_defconfig b/arch/mips/configs/qemu-malta_defconfig
> index b9994f392c..ab3abb7a2a 100644
> --- a/arch/mips/configs/qemu-malta_defconfig
> +++ b/arch/mips/configs/qemu-malta_defconfig
> @@ -75,6 +75,8 @@ CONFIG_DRIVER_VIDEO_BOCHS_PCI=y
>  CONFIG_GPIO_MALTA_FPGA_I2C=y
>  CONFIG_PCI=y
>  CONFIG_PCI_DEBUG=y
> +CONFIG_SYSCON_REBOOT_MODE=y
> +CONFIG_POWER_RESET_SYSCON=y
>  CONFIG_FS_CRAMFS=y
>  CONFIG_FS_TFTP=y
>  CONFIG_FS_FAT=y
> diff --git a/arch/mips/dts/qemu-malta.dts b/arch/mips/dts/qemu-malta.dts
> index 32e473cac0..2d6f4a0ca3 100644
> --- a/arch/mips/dts/qemu-malta.dts
> +++ b/arch/mips/dts/qemu-malta.dts
> @@ -27,6 +27,19 @@
>  		clock-frequency = <1843200>;
>  	};
>  
> +	fpga_regs: system-controller@1f000000 {
> +		compatible = "mti,malta-fpga", "syscon", "simple-mfd";
> +		reg = <0x1f000000 0x600>;
> +		native-endian;
> +
> +		reboot {
> +			compatible = "syscon-reboot";
> +			regmap = <&fpga_regs>;
> +			offset = <0x500>;
> +			mask = <0x42>;
> +		};
> +	};
> +
>  	gpio: gpio@1f000b00 {
>  		compatible = "mti,malta-fpga-i2c-gpio";
>  		gpio-controller;
> diff --git a/arch/mips/mach-malta/Makefile b/arch/mips/mach-malta/Makefile
> index 0c5a7018d4..7d56f215b0 100644
> --- a/arch/mips/mach-malta/Makefile
> +++ b/arch/mips/mach-malta/Makefile
> @@ -1,2 +1 @@
> -obj-y += reset.o
>  obj-$(CONFIG_PCI) += pci.o
> diff --git a/arch/mips/mach-malta/reset.c b/arch/mips/mach-malta/reset.c
> deleted file mode 100644
> index ad0de2741b..0000000000
> --- a/arch/mips/mach-malta/reset.c
> +++ /dev/null
> @@ -1,31 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - * Copyright (C) 2011 Antony Pavlov <antonynpavlov@gmail.com>
> - */
> -
> -/**
> - * @file
> - * @brief Resetting an malta board
> - */
> -
> -#include <common.h>
> -#include <io.h>
> -#include <init.h>
> -#include <restart.h>
> -#include <mach/hardware.h>
> -
> -static void __noreturn malta_restart_soc(struct restart_handler *rst)
> -{
> -	__raw_writel(GORESET, (char *)SOFTRES_REG);
> -
> -	hang();
> -	/*NOTREACHED*/
> -}
> -
> -static int restart_register_feature(void)
> -{
> -	restart_handler_register_fn("soc", malta_restart_soc);
> -
> -	return 0;
> -}
> -coredevice_initcall(restart_register_feature);
> -- 
> 2.31.1
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

end of thread, other threads:[~2021-05-03 11:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-25  6:35 [PATCH] MIPS: qemu-malta: use generic syscon reset driver Antony Pavlov
2021-04-28  4:39 ` Antony Pavlov
2021-05-03 11:17 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox