aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-31 23:43:52 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-31 23:43:52 -0400
commit2f63251ed0a803ddbe7bf2577b69d467aa872f68 (patch)
tree960ba4e27bb2cffdda0841ee701515c4bd75143a /arch
parentd6dd9e93c7531fa31370e27d053a3940d8d662fb (diff)
parent647e50f38345525d8261c295a0d0629dcea23a9b (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
* git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog: (28 commits) [WATCHDOG] Fix pcwd_init_module crash [WATCHDOG] ICH9 support for iTCO_wdt [WATCHDOG] 631xESB/632xESB support for iTCO_wdt - add all LPC bridges [WATCHDOG] 631xESB/632xESB support for iTCO_wdt [WATCHDOG] omap_wdt.c - default error for IOCTL is -ENOTTY [WATCHDOG] Return value of nonseekable_open [WATCHDOG] mv64x60_wdt: Rework the timeout register manipulation [WATCHDOG] mv64x60_wdt: disable watchdog timer when driver is probed [WATCHDOG] mv64x60_wdt: Support the WDIOF_MAGICCLOSE feature [WATCHDOG] mv64x60_wdt: Add a module parameter to change nowayout setting [WATCHDOG] mv64x60_wdt: Add WDIOC_SETOPTIONS ioctl support [WATCHDOG] mv64x60_wdt: Support for WDIOC_SETTIMEOUT ioctl [WATCHDOG] mv64x60_wdt: Fix WDIOC_GETTIMEOUT return value [WATCHDOG] mv64x60_wdt: Check return value of nonseekable_open [WATCHDOG] mv64x60_wdt: Add arch/powerpc platform support [WATCHDOG] mv64x60_wdt: Get register address from platform data [WATCHDOG] mv64x60_wdt: set up platform_device in platform code [WATCHDOG] ensure mouse and keyboard ignored in w83627hf_wdt [WATCHDOG] s3c2410_wdt: fixup after arch include moves [WATCHDOG] git-watchdog-typo ...
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/boot/dts/prpmc2800.dts6
-rw-r--r--arch/powerpc/sysdev/mv64x60_dev.c64
-rw-r--r--arch/ppc/syslib/mv64x60.c29
3 files changed, 99 insertions, 0 deletions
diff --git a/arch/powerpc/boot/dts/prpmc2800.dts b/arch/powerpc/boot/dts/prpmc2800.dts
index 699d0df574d5..5300b50cdc2f 100644
--- a/arch/powerpc/boot/dts/prpmc2800.dts
+++ b/arch/powerpc/boot/dts/prpmc2800.dts
@@ -207,6 +207,12 @@
207 interrupt-parent = <&/mv64x60/pic>; 207 interrupt-parent = <&/mv64x60/pic>;
208 }; 208 };
209 209
210 wdt@b410 { /* watchdog timer */
211 compatible = "marvell,mv64x60-wdt";
212 reg = <b410 8>;
213 timeout = <a>; /* wdt timeout in seconds */
214 };
215
210 i2c@c000 { 216 i2c@c000 {
211 device_type = "i2c"; 217 device_type = "i2c";
212 compatible = "marvell,mv64x60-i2c"; 218 compatible = "marvell,mv64x60-i2c";
diff --git a/arch/powerpc/sysdev/mv64x60_dev.c b/arch/powerpc/sysdev/mv64x60_dev.c
index b618fa60aef3..548a32082e4a 100644
--- a/arch/powerpc/sysdev/mv64x60_dev.c
+++ b/arch/powerpc/sysdev/mv64x60_dev.c
@@ -390,6 +390,61 @@ error:
390 return err; 390 return err;
391} 391}
392 392
393/*
394 * Create mv64x60_wdt platform devices
395 */
396static int __init mv64x60_wdt_device_setup(struct device_node *np, int id)
397{
398 struct resource r;
399 struct platform_device *pdev;
400 struct mv64x60_wdt_pdata pdata;
401 const unsigned int *prop;
402 int err;
403
404 err = of_address_to_resource(np, 0, &r);
405 if (err)
406 return err;
407
408 memset(&pdata, 0, sizeof(pdata));
409
410 prop = of_get_property(np, "timeout", NULL);
411 if (!prop)
412 return -ENODEV;
413 pdata.timeout = *prop;
414
415 np = of_get_parent(np);
416 if (!np)
417 return -ENODEV;
418
419 prop = of_get_property(np, "clock-frequency", NULL);
420 of_node_put(np);
421 if (!prop)
422 return -ENODEV;
423 pdata.bus_clk = *prop / 1000000; /* wdt driver wants freq in MHz */
424
425 pdev = platform_device_alloc(MV64x60_WDT_NAME, id);
426 if (!pdev)
427 return -ENOMEM;
428
429 err = platform_device_add_resources(pdev, &r, 1);
430 if (err)
431 goto error;
432
433 err = platform_device_add_data(pdev, &pdata, sizeof(pdata));
434 if (err)
435 goto error;
436
437 err = platform_device_add(pdev);
438 if (err)
439 goto error;
440
441 return 0;
442
443error:
444 platform_device_put(pdev);
445 return err;
446}
447
393static int __init mv64x60_device_setup(void) 448static int __init mv64x60_device_setup(void)
394{ 449{
395 struct device_node *np = NULL; 450 struct device_node *np = NULL;
@@ -414,6 +469,15 @@ static int __init mv64x60_device_setup(void)
414 if ((err = mv64x60_i2c_device_setup(np, id))) 469 if ((err = mv64x60_i2c_device_setup(np, id)))
415 goto error; 470 goto error;
416 471
472 /* support up to one watchdog timer */
473 np = of_find_compatible_node(np, NULL, "marvell,mv64x60-wdt");
474 if (np) {
475 if ((err = mv64x60_wdt_device_setup(np, id)))
476 goto error;
477 of_node_put(np);
478 }
479
480
417 return 0; 481 return 0;
418 482
419error: 483error:
diff --git a/arch/ppc/syslib/mv64x60.c b/arch/ppc/syslib/mv64x60.c
index d212b1c418a9..2744b8a6f66a 100644
--- a/arch/ppc/syslib/mv64x60.c
+++ b/arch/ppc/syslib/mv64x60.c
@@ -441,6 +441,32 @@ static struct platform_device i2c_device = {
441}; 441};
442#endif 442#endif
443 443
444#ifdef CONFIG_WATCHDOG
445static struct mv64x60_wdt_pdata mv64x60_wdt_pdata = {
446 .timeout = 10, /* default watchdog expiry in seconds */
447 .bus_clk = 133, /* default bus clock in MHz */
448};
449
450static struct resource mv64x60_wdt_resources[] = {
451 [0] = {
452 .name = "mv64x60 wdt base",
453 .start = MV64x60_WDT_WDC,
454 .end = MV64x60_WDT_WDC + 8 - 1, /* two 32-bit registers */
455 .flags = IORESOURCE_MEM,
456 },
457};
458
459static struct platform_device wdt_device = {
460 .name = MV64x60_WDT_NAME,
461 .id = 0,
462 .num_resources = ARRAY_SIZE(mv64x60_wdt_resources),
463 .resource = mv64x60_wdt_resources,
464 .dev = {
465 .platform_data = &mv64x60_wdt_pdata,
466 },
467};
468#endif
469
444#if defined(CONFIG_SYSFS) && !defined(CONFIG_GT64260) 470#if defined(CONFIG_SYSFS) && !defined(CONFIG_GT64260)
445static struct mv64xxx_pdata mv64xxx_pdata = { 471static struct mv64xxx_pdata mv64xxx_pdata = {
446 .hs_reg_valid = 0, 472 .hs_reg_valid = 0,
@@ -476,6 +502,9 @@ static struct platform_device *mv64x60_pd_devs[] __initdata = {
476#ifdef CONFIG_I2C_MV64XXX 502#ifdef CONFIG_I2C_MV64XXX
477 &i2c_device, 503 &i2c_device,
478#endif 504#endif
505#ifdef CONFIG_MV64X60_WDT
506 &wdt_device,
507#endif
479#if defined(CONFIG_SYSFS) && !defined(CONFIG_GT64260) 508#if defined(CONFIG_SYSFS) && !defined(CONFIG_GT64260)
480 &mv64xxx_device, 509 &mv64xxx_device,
481#endif 510#endif