1 From d3c1e72c755cf67427b5d410039a096520d6537f Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Mon, 7 Dec 2015 17:19:55 +0100
4 Subject: [PATCH 18/53] arch: mips: ralink: reset pci prior to reboot
6 Signed-off-by: John Crispin <blogic@openwrt.org>
8 arch/mips/ralink/reset.c | 12 ++++++++++--
9 1 file changed, 10 insertions(+), 2 deletions(-)
11 --- a/arch/mips/ralink/reset.c
12 +++ b/arch/mips/ralink/reset.c
17 +#include <linux/delay.h>
18 #include <linux/reset-controller.h>
20 #include <asm/reboot.h>
22 #include <asm/mach-ralink/ralink_regs.h>
25 -#define SYSC_REG_RESET_CTRL 0x034
26 -#define RSTCTL_RESET_SYSTEM BIT(0)
27 +#define SYSC_REG_RESET_CTRL 0x034
29 +#define RSTCTL_RESET_PCI BIT(26)
30 +#define RSTCTL_RESET_SYSTEM BIT(0)
32 static int ralink_assert_device(struct reset_controller_dev *rcdev,
34 @@ -83,6 +86,11 @@ void ralink_rst_init(void)
36 static void ralink_restart(char *command)
38 + if (IS_ENABLED(CONFIG_PCI)) {
39 + rt_sysc_m32(0, RSTCTL_RESET_PCI, SYSC_REG_RESET_CTRL);
44 rt_sysc_w32(RSTCTL_RESET_SYSTEM, SYSC_REG_RESET_CTRL);