Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Loongson1: Add watchdog support for Loongson1 board

The patch adds watchdog support for Loongson1 board.

Signed-off-by: Yang Ling <gnaygnil@gmail.com>
Cc: keguang.zhang@gmail.com
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/14644/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Yang Ling and committed by
Ralf Baechle
5e73ad3f e31e4505

+37 -10
+4
arch/mips/configs/loongson1b_defconfig
··· 74 74 CONFIG_GPIOLIB=y 75 75 CONFIG_GPIO_LOONGSON1=y 76 76 # CONFIG_HWMON is not set 77 + CONFIG_WATCHDOG=y 78 + CONFIG_WATCHDOG_NOWAYOUT=y 79 + CONFIG_WATCHDOG_SYSFS=y 80 + CONFIG_LOONGSON1_WDT=y 77 81 # CONFIG_VGA_CONSOLE is not set 78 82 CONFIG_HID_GENERIC=m 79 83 CONFIG_USB_HID=m
+4
arch/mips/configs/loongson1c_defconfig
··· 75 75 CONFIG_GPIOLIB=y 76 76 CONFIG_GPIO_LOONGSON1=y 77 77 # CONFIG_HWMON is not set 78 + CONFIG_WATCHDOG=y 79 + CONFIG_WATCHDOG_NOWAYOUT=y 80 + CONFIG_WATCHDOG_SYSFS=y 81 + CONFIG_LOONGSON1_WDT=y 78 82 # CONFIG_VGA_CONSOLE is not set 79 83 CONFIG_HID_GENERIC=m 80 84 CONFIG_USB_HID=m
+5 -4
arch/mips/include/asm/mach-loongson32/platform.h
··· 1 1 /* 2 2 * Copyright (c) 2011 Zhang, Keguang <keguang.zhang@gmail.com> 3 3 * 4 - * This program is free software; you can redistribute it and/or modify it 5 - * under the terms of the GNU General Public License as published by the 6 - * Free Software Foundation; either version 2 of the License, or (at your 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms of the GNU General Public License as published by the 6 + * Free Software Foundation; either version 2 of the License, or (at your 7 7 * option) any later version. 8 8 */ 9 9 ··· 25 25 extern struct platform_device ls1x_gpio1_pdev; 26 26 extern struct platform_device ls1x_nand_pdev; 27 27 extern struct platform_device ls1x_rtc_pdev; 28 + extern struct platform_device ls1x_wdt_pdev; 28 29 29 30 void __init ls1x_clk_init(void); 30 31 void __init ls1x_dma_set_platdata(struct plat_ls1x_dma *pdata); 31 32 void __init ls1x_nand_set_platdata(struct plat_ls1x_nand *pdata); 32 - void __init ls1x_serial_set_uartclk(struct platform_device *pdev); 33 33 void __init ls1x_rtc_set_extclk(struct platform_device *pdev); 34 + void __init ls1x_serial_set_uartclk(struct platform_device *pdev); 34 35 35 36 #endif /* __ASM_MACH_LOONGSON32_PLATFORM_H */
+16
arch/mips/loongson32/common/platform.c
··· 356 356 .name = "ls1x-rtc", 357 357 .id = -1, 358 358 }; 359 + 360 + /* Watchdog */ 361 + static struct resource ls1x_wdt_resources[] = { 362 + { 363 + .start = LS1X_WDT_BASE, 364 + .end = LS1X_WDT_BASE + SZ_16 - 1, 365 + .flags = IORESOURCE_MEM, 366 + }, 367 + }; 368 + 369 + struct platform_device ls1x_wdt_pdev = { 370 + .name = "ls1x-wdt", 371 + .id = -1, 372 + .num_resources = ARRAY_SIZE(ls1x_wdt_resources), 373 + .resource = ls1x_wdt_resources, 374 + };
+4 -3
arch/mips/loongson32/ls1b/board.c
··· 1 1 /* 2 2 * Copyright (c) 2011-2016 Zhang, Keguang <keguang.zhang@gmail.com> 3 3 * 4 - * This program is free software; you can redistribute it and/or modify it 5 - * under the terms of the GNU General Public License as published by the 6 - * Free Software Foundation; either version 2 of the License, or (at your 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms of the GNU General Public License as published by the 6 + * Free Software Foundation; either version 2 of the License, or (at your 7 7 * option) any later version. 8 8 */ 9 9 ··· 72 72 &ls1x_gpio1_pdev, 73 73 &ls1x_nand_pdev, 74 74 &ls1x_rtc_pdev, 75 + &ls1x_wdt_pdev, 75 76 }; 76 77 77 78 static int __init ls1b_platform_init(void)
+4 -3
arch/mips/loongson32/ls1c/board.c
··· 1 1 /* 2 2 * Copyright (c) 2016 Yang Ling <gnaygnil@gmail.com> 3 3 * 4 - * This program is free software; you can redistribute it and/or modify it 5 - * under the terms of the GNU General Public License as published by the 6 - * Free Software Foundation; either version 2 of the License, or (at your 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms of the GNU General Public License as published by the 6 + * Free Software Foundation; either version 2 of the License, or (at your 7 7 * option) any later version. 8 8 */ 9 9 ··· 13 13 &ls1x_uart_pdev, 14 14 &ls1x_eth0_pdev, 15 15 &ls1x_rtc_pdev, 16 + &ls1x_wdt_pdev, 16 17 }; 17 18 18 19 static int __init ls1c_platform_init(void)