diff options
author | Arnd Bergmann <arnd@arndb.de> | 2012-11-15 17:08:51 +0100 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-11-15 17:08:51 +0100 |
commit | cb64babf9ebe06984d87c08d241d05e2f6a7eb5b (patch) | |
tree | 61cd54de0b0dc5c42a99ee733e9984700b0732b7 /arch/arm/mach-omap2/wd_timer.c | |
parent | 809a3226ad7cf0807f79ddc31ed2094dbb9911fd (diff) | |
parent | cc4b1e24b93dd529b1d49258bee044d319b5b129 (diff) | |
download | talos-obmc-linux-cb64babf9ebe06984d87c08d241d05e2f6a7eb5b.tar.gz talos-obmc-linux-cb64babf9ebe06984d87c08d241d05e2f6a7eb5b.zip |
Merge tag 'omap-for-v3.8/cleanup-prcm-part2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/cleanup
From Tony Lindgren <tony@atomide.com>:
More PRCM cleanups via Paul Walmsley <paul@pwsan.com>:
Second set of OMAP PRCM cleanups for 3.8.
These patches remove the use of omap_prcm_get_reset_sources() from the
OMAP watchdog driver, and remove mach-omap2/prcm.c and
plat-omap/include/plat/prcm.h.
Basic test logs for this branch on top of Tony's cleanup-prcm branch
at commit 7fc54fd3084457c7f11b9e2e1e3fcd19a3badc33 are here:
http://www.pwsan.com/omap/testlogs/prcm_cleanup_b_3.8/20121108151646/
However, cleanup-prcm at 7fc54fd3 does not include some fixes
that are needed for a successful test. With several reverts,
fixes, and workarounds applied, the following test logs were
obtained:
http://www.pwsan.com/omap/testlogs/TEST_prcm_cleanup_b_3.8/20121108151930/
which indicate that the series tests cleanly.
This second pull request updates one of the patches which broke
with rmk's allnoconfigs, and also updates the tag description to
indicate that 7fc54fd3 is building cleanly here.
* tag 'omap-for-v3.8/cleanup-prcm-part2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: (27 commits)
ARM: OMAP2: Fix compillation error in cm_common
ARM: OMAP2+: PRCM: remove obsolete prcm.[ch]
ARM: OMAP2+: hwmod: call to _omap4_disable_module() should use the SoC-specific call
ARM: OMAP2+: PRCM: consolidate PRCM-related timeout macros
ARM: OMAP2+: PRCM: split and relocate the PRM/CM globals setup
ARM: OMAP2+: PRCM: remove omap2_cm_wait_idlest()
ARM: OMAP2+: CM/clock: convert _omap2_module_wait_ready() to use SoC-independent CM functions
ARM: OMAP2xxx: APLL/CM: convert to use omap2_cm_wait_module_ready()
ARM: OMAP2+: board files: use SoC-specific system restart functions
ARM: OMAP2+: PRCM: create SoC-specific chip restart functions
ARM: OMAP2xxx: clock: move virt_prcm_set code into clkt2xxx_virt_prcm_set.c
ARM: OMAP2xxx: clock: remove global 'dclk' variable
ARM: OMAP2/3: PRM: add SoC reset functions (using the CORE DPLL method)
ARM: OMAP2+: common: remove mach-omap2/common.c globals and map_common_io code
ARM: OMAP2+: PRCM: remove omap_prcm_get_reset_sources()
watchdog: OMAP: use standard GETBOOTSTATUS interface; use platform_data fn ptr
ARM: OMAP2+: WDT: move init; add read_reset_sources pdata function pointer
ARM: OMAP1: CGRM: fix omap1_get_reset_sources() return type
ARM: OMAP2+: PRM: create PRM reset source API for the watchdog timer driver
ARM: OMAP1: create read_reset_sources() function (for initial use by watchdog)
...
Conflicts:
arch/arm/mach-omap2/cm33xx.c
arch/arm/mach-omap2/io.c
arch/arm/mach-omap2/prm_common.c
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-omap2/wd_timer.c')
-rw-r--r-- | arch/arm/mach-omap2/wd_timer.c | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/wd_timer.c b/arch/arm/mach-omap2/wd_timer.c index f6b6c37ac3f4..7c2b4ed38f02 100644 --- a/arch/arm/mach-omap2/wd_timer.c +++ b/arch/arm/mach-omap2/wd_timer.c @@ -1,6 +1,8 @@ /* * OMAP2+ MPU WD_TIMER-specific code * + * Copyright (C) 2012 Texas Instruments, Inc. + * * 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; either version 2 of the License, or @@ -11,10 +13,14 @@ #include <linux/io.h> #include <linux/err.h> -#include "omap_hwmod.h" +#include <linux/platform_data/omap-wd-timer.h> +#include "omap_hwmod.h" +#include "omap_device.h" #include "wd_timer.h" #include "common.h" +#include "prm.h" +#include "soc.h" /* * In order to avoid any assumptions from bootloader regarding WDT @@ -26,9 +32,6 @@ #define OMAP_WDT_WPS 0x34 #define OMAP_WDT_SPR 0x48 -/* Maximum microseconds to wait for OMAP module to softreset */ -#define MAX_MODULE_SOFTRESET_WAIT 10000 - int omap2_wd_timer_disable(struct omap_hwmod *oh) { void __iomem *base; @@ -99,3 +102,32 @@ int omap2_wd_timer_reset(struct omap_hwmod *oh) return (c == MAX_MODULE_SOFTRESET_WAIT) ? -ETIMEDOUT : omap2_wd_timer_disable(oh); } + +static int __init omap_init_wdt(void) +{ + int id = -1; + struct platform_device *pdev; + struct omap_hwmod *oh; + char *oh_name = "wd_timer2"; + char *dev_name = "omap_wdt"; + struct omap_wd_timer_platform_data pdata; + + if (!cpu_class_is_omap2() || of_have_populated_dt()) + return 0; + + oh = omap_hwmod_lookup(oh_name); + if (!oh) { + pr_err("Could not look up wd_timer%d hwmod\n", id); + return -EINVAL; + } + + pdata.read_reset_sources = prm_read_reset_sources; + + pdev = omap_device_build(dev_name, id, oh, &pdata, + sizeof(struct omap_wd_timer_platform_data), + NULL, 0, 0); + WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s.\n", + dev_name, oh->name); + return 0; +} +subsys_initcall(omap_init_wdt); |