xref: /OK3568_Linux_fs/kernel/arch/mips/bcm63xx/dev-wdt.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * This file is subject to the terms and conditions of the GNU General Public
3*4882a593Smuzhiyun  * License.  See the file "COPYING" in the main directory of this archive
4*4882a593Smuzhiyun  * for more details.
5*4882a593Smuzhiyun  *
6*4882a593Smuzhiyun  * Copyright (C) 2008 Florian Fainelli <florian@openwrt.org>
7*4882a593Smuzhiyun  */
8*4882a593Smuzhiyun 
9*4882a593Smuzhiyun #include <linux/init.h>
10*4882a593Smuzhiyun #include <linux/kernel.h>
11*4882a593Smuzhiyun #include <linux/platform_device.h>
12*4882a593Smuzhiyun #include <bcm63xx_cpu.h>
13*4882a593Smuzhiyun 
14*4882a593Smuzhiyun static struct resource wdt_resources[] = {
15*4882a593Smuzhiyun 	{
16*4882a593Smuzhiyun 		.start		= -1, /* filled at runtime */
17*4882a593Smuzhiyun 		.end		= -1, /* filled at runtime */
18*4882a593Smuzhiyun 		.flags		= IORESOURCE_MEM,
19*4882a593Smuzhiyun 	},
20*4882a593Smuzhiyun };
21*4882a593Smuzhiyun 
22*4882a593Smuzhiyun static struct platform_device bcm63xx_wdt_device = {
23*4882a593Smuzhiyun 	.name		= "bcm63xx-wdt",
24*4882a593Smuzhiyun 	.id		= -1,
25*4882a593Smuzhiyun 	.num_resources	= ARRAY_SIZE(wdt_resources),
26*4882a593Smuzhiyun 	.resource	= wdt_resources,
27*4882a593Smuzhiyun };
28*4882a593Smuzhiyun 
bcm63xx_wdt_register(void)29*4882a593Smuzhiyun int __init bcm63xx_wdt_register(void)
30*4882a593Smuzhiyun {
31*4882a593Smuzhiyun 	wdt_resources[0].start = bcm63xx_regset_address(RSET_WDT);
32*4882a593Smuzhiyun 	wdt_resources[0].end = wdt_resources[0].start;
33*4882a593Smuzhiyun 	wdt_resources[0].end += RSET_WDT_SIZE - 1;
34*4882a593Smuzhiyun 
35*4882a593Smuzhiyun 	return platform_device_register(&bcm63xx_wdt_device);
36*4882a593Smuzhiyun }
37*4882a593Smuzhiyun arch_initcall(bcm63xx_wdt_register);
38