Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * This file is subject to the terms and conditions of the GNU General Public
0003  * License.  See the file "COPYING" in the main directory of this archive
0004  * for more details.
0005  *
0006  * Copyright (C) 2008 Florian Fainelli <florian@openwrt.org>
0007  */
0008 
0009 #include <linux/init.h>
0010 #include <linux/kernel.h>
0011 #include <linux/platform_device.h>
0012 #include <linux/platform_data/bcm7038_wdt.h>
0013 #include <bcm63xx_cpu.h>
0014 
0015 static struct resource wdt_resources[] = {
0016     {
0017         .start      = -1, /* filled at runtime */
0018         .end        = -1, /* filled at runtime */
0019         .flags      = IORESOURCE_MEM,
0020     },
0021 };
0022 
0023 static struct bcm7038_wdt_platform_data bcm63xx_wdt_pdata = {
0024     .clk_name   = "periph",
0025 };
0026 
0027 static struct platform_device bcm63xx_wdt_device = {
0028     .name       = "bcm63xx-wdt",
0029     .id     = -1,
0030     .num_resources  = ARRAY_SIZE(wdt_resources),
0031     .resource   = wdt_resources,
0032     .dev        = {
0033         .platform_data = &bcm63xx_wdt_pdata,
0034     },
0035 };
0036 
0037 int __init bcm63xx_wdt_register(void)
0038 {
0039     wdt_resources[0].start = bcm63xx_regset_address(RSET_WDT);
0040     wdt_resources[0].end = wdt_resources[0].start;
0041     wdt_resources[0].end += RSET_WDT_SIZE - 1;
0042 
0043     return platform_device_register(&bcm63xx_wdt_device);
0044 }
0045 arch_initcall(bcm63xx_wdt_register);