1 --- a/arch/mips/bcm47xx/setup.c
2 +++ b/arch/mips/bcm47xx/setup.c
4 #include <linux/ssb/ssb.h>
5 #include <linux/ssb/ssb_embedded.h>
6 #include <linux/bcma/bcma_soc.h>
7 +#include <linux/old_gpio_wdt.h>
8 #include <asm/bootinfo.h>
11 @@ -269,6 +270,33 @@ static struct fixed_phy_status bcm47xx_f
12 .duplex = DUPLEX_FULL,
15 +static struct gpio_wdt_platform_data gpio_wdt_data;
17 +static struct platform_device gpio_wdt_device = {
21 + .platform_data = &gpio_wdt_data,
25 +static int __init bcm47xx_register_gpio_watchdog(void)
27 + enum bcm47xx_board board = bcm47xx_board_get();
30 + case BCM47XX_BOARD_HUAWEI_E970:
31 + pr_info("bcm47xx: detected Huawei E970 or similar, starting early gpio_wdt timer\n");
32 + gpio_wdt_data.gpio = 7;
33 + gpio_wdt_data.interval = HZ;
34 + gpio_wdt_data.first_interval = HZ / 5;
35 + return platform_device_register(&gpio_wdt_device);
42 static int __init bcm47xx_register_bus_complete(void)
44 switch (bcm47xx_bus_type) {
45 @@ -288,6 +316,7 @@ static int __init bcm47xx_register_bus_c
46 bcm47xx_workarounds();
48 fixed_phy_add(PHY_POLL, 0, &bcm47xx_fixed_phy_status);
49 + bcm47xx_register_gpio_watchdog();
52 device_initcall(bcm47xx_register_bus_complete);
53 --- a/arch/mips/configs/bcm47xx_defconfig
54 +++ b/arch/mips/configs/bcm47xx_defconfig
55 @@ -67,6 +67,7 @@ CONFIG_HW_RANDOM=y
61 CONFIG_SSB_DRIVER_GIGE=y
62 CONFIG_BCMA_DRIVER_GMAC_CMN=y
63 --- a/drivers/ssb/embedded.c
64 +++ b/drivers/ssb/embedded.c
65 @@ -34,11 +34,36 @@ int ssb_watchdog_timer_set(struct ssb_bu
67 EXPORT_SYMBOL(ssb_watchdog_timer_set);
69 +#ifdef CONFIG_BCM47XX
70 +#include <bcm47xx_board.h>
72 +static bool ssb_watchdog_supported(void)
74 + enum bcm47xx_board board = bcm47xx_board_get();
76 + /* The Huawei E970 has a hardware watchdog using a GPIO */
78 + case BCM47XX_BOARD_HUAWEI_E970:
85 +static bool ssb_watchdog_supported(void)
91 int ssb_watchdog_register(struct ssb_bus *bus)
93 struct bcm47xx_wdt wdt = {};
94 struct platform_device *pdev;
96 + if (!ssb_watchdog_supported())
99 if (ssb_chipco_available(&bus->chipco)) {
100 wdt.driver_data = &bus->chipco;
101 wdt.timer_set = ssb_chipco_watchdog_timer_set_wdt;