Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 226592
b: refs/heads/master
c: ff2516f
h: refs/heads/master
v: v3
  • Loading branch information
Paul Walmsley committed Dec 22, 2010
1 parent 8e9e84c commit 12e0e69
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 39 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 81fbc5ef9b22df2e2198dd0c530719a263a8d1c5
refs/heads/master: ff2516fbef20ed9edd9cc2fc8b8b48d5cb5a932f
15 changes: 0 additions & 15 deletions trunk/arch/arm/mach-omap2/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

#include "mux.h"
#include "control.h"
#include "wd_timer.h"

#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)

Expand Down Expand Up @@ -956,26 +955,12 @@ static inline void omap_init_vout(void) {}

/*-------------------------------------------------------------------------*/

static int omap2_disable_wdt(struct omap_hwmod *oh, void *unused)
{
return omap2_wd_timer_disable(oh);
}

static void __init omap_disable_wdt(void)
{
if (cpu_class_is_omap2())
omap_hwmod_for_each_by_class("wd_timer",
omap2_disable_wdt, NULL);
return;
}

static int __init omap2_init_devices(void)
{
/*
* please keep these calls, and their implementations above,
* in alphabetical order so they're easier to sort through.
*/
omap_disable_wdt();
omap_hsmmc_reset();
omap_init_audio();
omap_init_camera();
Expand Down
18 changes: 18 additions & 0 deletions trunk/arch/arm/mach-omap2/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,24 @@ void __init omap2_init_common_infrastructure(void)
#endif
omap_hwmod_for_each(_set_hwmod_postsetup_state, &postsetup_state);

/*
* Set the default postsetup state for unusual modules (like
* MPU WDT).
*
* The postsetup_state is not actually used until
* omap_hwmod_late_init(), so boards that desire full watchdog
* coverage of kernel initialization can reprogram the
* postsetup_state between the calls to
* omap2_init_common_infra() and omap2_init_common_devices().
*
* XXX ideally we could detect whether the MPU WDT was currently
* enabled here and make this conditional
*/
postsetup_state = _HWMOD_STATE_DISABLED;
omap_hwmod_for_each_by_class("wd_timer",
_set_hwmod_postsetup_state,
&postsetup_state);

omap_pm_if_early_init();

if (cpu_is_omap2420())
Expand Down
6 changes: 4 additions & 2 deletions trunk/arch/arm/mach-omap2/omap_hwmod_2420_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include "cm-regbits-24xx.h"
#include "prm-regbits-24xx.h"
#include "wd_timer.h"

/*
* OMAP2420 hardware module integration data
Expand Down Expand Up @@ -312,8 +313,9 @@ static struct omap_hwmod_class_sysconfig omap2420_wd_timer_sysc = {
};

static struct omap_hwmod_class omap2420_wd_timer_hwmod_class = {
.name = "wd_timer",
.sysc = &omap2420_wd_timer_sysc,
.name = "wd_timer",
.sysc = &omap2420_wd_timer_sysc,
.pre_shutdown = &omap2_wd_timer_disable
};

/* wd_timer2 */
Expand Down
6 changes: 4 additions & 2 deletions trunk/arch/arm/mach-omap2/omap_hwmod_2430_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include "prm-regbits-24xx.h"
#include "cm-regbits-24xx.h"
#include "wd_timer.h"

/*
* OMAP2430 hardware module integration data
Expand Down Expand Up @@ -311,8 +312,9 @@ static struct omap_hwmod_class_sysconfig omap2430_wd_timer_sysc = {
};

static struct omap_hwmod_class omap2430_wd_timer_hwmod_class = {
.name = "wd_timer",
.sysc = &omap2430_wd_timer_sysc,
.name = "wd_timer",
.sysc = &omap2430_wd_timer_sysc,
.pre_shutdown = &omap2_wd_timer_disable
};

/* wd_timer2 */
Expand Down
6 changes: 4 additions & 2 deletions trunk/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include "prm-regbits-34xx.h"
#include "cm-regbits-34xx.h"
#include "wd_timer.h"

/*
* OMAP3xxx hardware module integration data
Expand Down Expand Up @@ -423,8 +424,9 @@ static struct omap_hwmod_class_sysconfig i2c_sysc = {
};

static struct omap_hwmod_class omap3xxx_wd_timer_hwmod_class = {
.name = "wd_timer",
.sysc = &omap3xxx_wd_timer_sysc,
.name = "wd_timer",
.sysc = &omap3xxx_wd_timer_sysc,
.pre_shutdown = &omap2_wd_timer_disable
};

/* wd_timer2 */
Expand Down
6 changes: 4 additions & 2 deletions trunk/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include "cm.h"
#include "prm-regbits-44xx.h"
#include "wd_timer.h"

/* Base offset for all OMAP4 interrupts external to MPUSS */
#define OMAP44XX_IRQ_GIC_START 32
Expand Down Expand Up @@ -728,8 +729,9 @@ static struct omap_hwmod_class_sysconfig omap44xx_uart_sysc = {
};

static struct omap_hwmod_class omap44xx_wd_timer_hwmod_class = {
.name = "wd_timer",
.sysc = &omap44xx_wd_timer_sysc,
.name = "wd_timer",
.sysc = &omap44xx_wd_timer_sysc,
.pre_shutdown = &omap2_wd_timer_disable
};

/* wd_timer2 */
Expand Down
16 changes: 1 addition & 15 deletions trunk/arch/arm/mach-omap2/wd_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
int omap2_wd_timer_disable(struct omap_hwmod *oh)
{
void __iomem *base;
int ret;

if (!oh) {
pr_err("%s: Could not look up wdtimer_hwmod\n", __func__);
Expand All @@ -41,14 +40,6 @@ int omap2_wd_timer_disable(struct omap_hwmod *oh)
return -EINVAL;
}

/* Enable the clocks before accessing the WDT registers */
ret = omap_hwmod_enable(oh);
if (ret) {
pr_err("%s: Could not enable clocks for %s\n",
oh->name, __func__);
return ret;
}

/* sequence required to disable watchdog */
__raw_writel(0xAAAA, base + OMAP_WDT_SPR);
while (__raw_readl(base + OMAP_WDT_WPS) & 0x10)
Expand All @@ -58,11 +49,6 @@ int omap2_wd_timer_disable(struct omap_hwmod *oh)
while (__raw_readl(base + OMAP_WDT_WPS) & 0x10)
cpu_relax();

ret = omap_hwmod_idle(oh);
if (ret)
pr_err("%s: Could not disable clocks for %s\n",
oh->name, __func__);

return ret;
return 0;
}

0 comments on commit 12e0e69

Please sign in to comment.