1 --- a/arch/mips/bcm47xx/setup.c
2 +++ b/arch/mips/bcm47xx/setup.c
4 #include <linux/bcma/bcma_soc.h>
5 #include <linux/serial.h>
6 #include <linux/serial_8250.h>
7 +#include <linux/gpio_wdt.h>
8 #include <asm/bootinfo.h>
10 #include <asm/reboot.h>
11 @@ -260,6 +261,33 @@ void __init plat_mem_setup(void)
12 mips_set_machine_name(bcm47xx_board_get_name());
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 @@ -274,6 +302,8 @@ static int __init bcm47xx_register_bus_c
49 + bcm47xx_register_gpio_watchdog();
53 device_initcall(bcm47xx_register_bus_complete);
54 --- a/arch/mips/configs/bcm47xx_defconfig
55 +++ b/arch/mips/configs/bcm47xx_defconfig
56 @@ -379,6 +379,7 @@ CONFIG_THERMAL=y
58 CONFIG_WATCHDOG_NOWAYOUT=y
61 CONFIG_SSB_DRIVER_GIGE=y
62 CONFIG_DISPLAY_SUPPORT=m
64 --- a/drivers/ssb/embedded.c
65 +++ b/drivers/ssb/embedded.c
66 @@ -34,11 +34,36 @@ int ssb_watchdog_timer_set(struct ssb_bu
68 EXPORT_SYMBOL(ssb_watchdog_timer_set);
70 +#ifdef CONFIG_BCM47XX
71 +#include <bcm47xx_board.h>
73 +static bool ssb_watchdog_supported(void)
75 + enum bcm47xx_board board = bcm47xx_board_get();
77 + /* The Huawei E970 has a hardware watchdog using a GPIO */
79 + case BCM47XX_BOARD_HUAWEI_E970:
86 +static bool ssb_watchdog_supported(void)
92 int ssb_watchdog_register(struct ssb_bus *bus)
94 struct bcm47xx_wdt wdt = {};
95 struct platform_device *pdev;
97 + if (!ssb_watchdog_supported())
100 if (ssb_chipco_available(&bus->chipco)) {
101 wdt.driver_data = &bus->chipco;
102 wdt.timer_set = ssb_chipco_watchdog_timer_set_wdt;