diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-10 19:16:36 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-10 19:16:36 -0700 |
commit | dfb945473ae8528fd885607b6fa843c676745e0c (patch) | |
tree | 5f3c17787f90c2d2112e3c93d944e067c8f8c1f7 /arch | |
parent | c5aec4c76af1a2d89ee2f2d4d5463b2ad2d85de5 (diff) | |
parent | 78a3bb9e408be6aadcd4a609d14a05038f2a132a (diff) |
Merge git://www.linux-watchdog.org/linux-watchdog
Pull watchdog updates from Wim Van Sebroeck:
"This contains:
- addition of the Intel MID watchdog
- removal of W83697HF and W83697UG drivers (code was merged into
w83627hf_wdt driver)
- addition of Armada 375/380 SoC support
- conversion of imx2_wdt to regmap API and to watchdog core API
- lots of other small improvements and fixes"
[ Wim was also tagged by gmail as a spammer, but not delayed by days
unlike Ben ]
* git://www.linux-watchdog.org/linux-watchdog: (25 commits)
x86: intel-mid: add watchdog platform code for Merrifield
watchdog: add Intel MID watchdog driver support
watchdog: sp805: Set watchdog_device->timeout from ->set_timeout()
booke/watchdog: refine and clean up the codes
watchdog: iop_wdt only builds for mach-iop13xx
watchdog: Remove drivers for W83697HF and W83697UG
watchdog: w83627hf_wdt: Add early_disable module parameter
ARM: mvebu: Add A375/A380 watchdog binding documentation
watchdog: orion: Add Armada 375/380 SoC support
watchdog: orion: Introduce per-SoC enabled() function
watchdog: orion: Introduce per-SoC stop() function
watchdog: orion: Remove unneeded atomic access
watchdog: orion: Introduce a SoC-specific RSTOUT mapping
watchdog: orion: Move the register ioremap'ing to its own function
watchdog: xilinx: Make of_device_id array const
watchdog: imx2_wdt: convert to watchdog core api
watchdog: imx2_wdt: convert to use regmap API.
watchdog: imx2_wdt: Sort the header files alphabetically
watchdog: ath79_wdt: switch to clk_prepare/clk_disable
watchdog: ath79_wdt: avoid spurious restarts on AR934x
...
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/kernel/setup-common.c | 27 | ||||
-rw-r--r-- | arch/x86/platform/intel-mid/device_libs/Makefile | 1 | ||||
-rw-r--r-- | arch/x86/platform/intel-mid/device_libs/platform_wdt.c | 72 |
3 files changed, 73 insertions, 27 deletions
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index aa0f5edd8570..d4d418376f99 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c @@ -728,33 +728,6 @@ static int powerpc_debugfs_init(void) arch_initcall(powerpc_debugfs_init); #endif -#ifdef CONFIG_BOOKE_WDT -extern u32 booke_wdt_enabled; -extern u32 booke_wdt_period; - -/* Checks wdt=x and wdt_period=xx command-line option */ -notrace int __init early_parse_wdt(char *p) -{ - if (p && strncmp(p, "0", 1) != 0) - booke_wdt_enabled = 1; - - return 0; -} -early_param("wdt", early_parse_wdt); - -int __init early_parse_wdt_period(char *p) -{ - unsigned long ret; - if (p) { - if (!kstrtol(p, 0, &ret)) - booke_wdt_period = ret; - } - - return 0; -} -early_param("wdt_period", early_parse_wdt_period); -#endif /* CONFIG_BOOKE_WDT */ - void ppc_printk_progress(char *s, unsigned short hex) { pr_info("%s\n", s); diff --git a/arch/x86/platform/intel-mid/device_libs/Makefile b/arch/x86/platform/intel-mid/device_libs/Makefile index 097e7a7940d8..af9307f2cc28 100644 --- a/arch/x86/platform/intel-mid/device_libs/Makefile +++ b/arch/x86/platform/intel-mid/device_libs/Makefile @@ -20,3 +20,4 @@ obj-$(subst m,y,$(CONFIG_DRM_MEDFIELD)) += platform_tc35876x.o obj-$(subst m,y,$(CONFIG_SERIAL_MRST_MAX3110)) += platform_max3111.o # MISC Devices obj-$(subst m,y,$(CONFIG_KEYBOARD_GPIO)) += platform_gpio_keys.o +obj-$(subst m,y,$(CONFIG_INTEL_MID_WATCHDOG)) += platform_wdt.o diff --git a/arch/x86/platform/intel-mid/device_libs/platform_wdt.c b/arch/x86/platform/intel-mid/device_libs/platform_wdt.c new file mode 100644 index 000000000000..973cf3bfa9fd --- /dev/null +++ b/arch/x86/platform/intel-mid/device_libs/platform_wdt.c @@ -0,0 +1,72 @@ +/* + * platform_wdt.c: Watchdog platform library file + * + * (C) Copyright 2014 Intel Corporation + * Author: David Cohen <david.a.cohen@linux.intel.com> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; version 2 + * of the License. + */ + +#include <linux/init.h> +#include <linux/interrupt.h> +#include <linux/platform_device.h> +#include <linux/platform_data/intel-mid_wdt.h> +#include <asm/intel-mid.h> +#include <asm/io_apic.h> + +#define TANGIER_EXT_TIMER0_MSI 15 + +static struct platform_device wdt_dev = { + .name = "intel_mid_wdt", + .id = -1, +}; + +static int tangier_probe(struct platform_device *pdev) +{ + int ioapic; + int irq; + struct intel_mid_wdt_pdata *pdata = pdev->dev.platform_data; + struct io_apic_irq_attr irq_attr = { 0 }; + + if (!pdata) + return -EINVAL; + + irq = pdata->irq; + ioapic = mp_find_ioapic(irq); + if (ioapic >= 0) { + int ret; + irq_attr.ioapic = ioapic; + irq_attr.ioapic_pin = irq; + irq_attr.trigger = 1; + /* irq_attr.polarity = 0; -> Active high */ + ret = io_apic_set_pci_routing(NULL, irq, &irq_attr); + if (ret) + return ret; + } else { + dev_warn(&pdev->dev, "cannot find interrupt %d in ioapic\n", + irq); + return -EINVAL; + } + + return 0; +} + +static struct intel_mid_wdt_pdata tangier_pdata = { + .irq = TANGIER_EXT_TIMER0_MSI, + .probe = tangier_probe, +}; + +static int __init register_mid_wdt(void) +{ + if (intel_mid_identify_cpu() == INTEL_MID_CPU_CHIP_TANGIER) { + wdt_dev.dev.platform_data = &tangier_pdata; + return platform_device_register(&wdt_dev); + } + + return -ENODEV; +} + +rootfs_initcall(register_mid_wdt); |