ramips: fix patches after 3.14.32 bump
[openwrt.git] / target / linux / ramips / patches-3.14 / 999-pci-reset.patch
1 --- a/arch/mips/ralink/reset.c
2 +++ b/arch/mips/ralink/reset.c
3 @@ -11,6 +11,7 @@
4  #include <linux/pm.h>
5  #include <linux/io.h>
6  #include <linux/of.h>
7 +#include <linux/delay.h>
8  #include <linux/reset-controller.h>
9  
10  #include <asm/reboot.h>
11 @@ -18,8 +19,10 @@
12  #include <asm/mach-ralink/ralink_regs.h>
13  
14  /* Reset Control */
15 -#define SYSC_REG_RESET_CTRL     0x034
16 -#define RSTCTL_RESET_SYSTEM     BIT(0)
17 +#define SYSC_REG_RESET_CTRL    0x034
18 +
19 +#define RSTCTL_RESET_PCI       BIT(26)
20 +#define RSTCTL_RESET_SYSTEM    BIT(0)
21  
22  static int ralink_assert_device(struct reset_controller_dev *rcdev,
23                                 unsigned long id)
24 @@ -83,6 +86,11 @@ void ralink_rst_init(void)
25  
26  static void ralink_restart(char *command)
27  {
28 +       if (IS_ENABLED(CONFIG_PCI)) {
29 +               rt_sysc_m32(0, RSTCTL_RESET_PCI, SYSC_REG_RESET_CTRL);
30 +               mdelay(50);
31 +       }
32 +
33         local_irq_disable();
34         rt_sysc_w32(RSTCTL_RESET_SYSTEM, SYSC_REG_RESET_CTRL);
35         unreachable();