3e1a4bb56a36bea685643f39b720d1483974fa6f
[openwrt.git] / target / linux / brcm47xx / patches-3.14 / 144-make-reboot-more-reliable.patch
1 From 26db431400c336c4cc658cb4888bab18d254c64a Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Sat, 9 Aug 2014 00:00:09 +0200
4 Subject: [PATCH] MIPS: BCM47XX: fix reboot problem on BCM4705/BCM4785
5
6 This adds some code based on code from the Broadcom GPL tar to fix the
7 reboot problems on BCM4705/BCM4785. I tried rebooting my device for ~10
8 times and have never seen a problem. This reverts the changes in the
9 previous commit and adds the real fix as suggested by RafaƂ.
10
11 Setting bit 22 in Reg 22, sel 4 puts the BIU (Bus Interface Unit) into
12 async mode.
13
14 The previous try was this:
15 commit 316cad5c1d4daee998cd1f83ccdb437f6f20d45c
16 Author: Hauke Mehrtens <hauke@hauke-m.de>
17 Date:   Mon Jul 28 23:53:57 2014 +0200
18
19     MIPS: BCM47XX: make reboot more relaiable
20
21 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
22 --- a/arch/mips/bcm47xx/setup.c
23 +++ b/arch/mips/bcm47xx/setup.c
24 @@ -59,7 +59,16 @@ static void bcm47xx_machine_restart(char
25         switch (bcm47xx_bus_type) {
26  #ifdef CONFIG_BCM47XX_SSB
27         case BCM47XX_BUS_TYPE_SSB:
28 +               if (bcm47xx_bus.ssb.chip_id == 0x4785)
29 +                       write_c0_diag4(1 << 22);
30                 ssb_watchdog_timer_set(&bcm47xx_bus.ssb, 1);
31 +               if (bcm47xx_bus.ssb.chip_id == 0x4785) {
32 +                       __asm__ __volatile__(
33 +                               ".set\tmips3\n\t"
34 +                               "sync\n\t"
35 +                               "wait\n\t"
36 +                               ".set\tmips0");
37 +               }
38                 break;
39  #endif
40  #ifdef CONFIG_BCM47XX_BCMA