Skip to content

Commit

Permalink
watchdog: mpc8xxx: Add support for mpc83xx
Browse files Browse the repository at this point in the history
Introduce a new compatible "fsl,pq2pro-wdt"
On mpc83xx, the prescaling factor is 0x10000.

Don't write the watchdog configuration register in
start.S as it can be written only once.

Signed-off-by: Christophe Leroy <[email protected]>
  • Loading branch information
chleroy committed Apr 6, 2023
1 parent 26e8ebc commit 0fd7913
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/powerpc/cpu/mpc83xx/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ unsigned long get_tbclk(void)
}
#endif

#if defined(CONFIG_WATCHDOG)
#if defined(CONFIG_WATCHDOG) && !defined(CONFIG_WDT)
void watchdog_reset (void)
{
int re_enable = disable_interrupts();
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/cpu/mpc83xx/start.S
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ init_e300_core: /* time t 10 */


lis r3, CONFIG_SYS_IMMR@h
#ifndef CONFIG_WDT_MPC8xxx
#if defined(CONFIG_WATCHDOG)
/* Initialise the Watchdog values and reset it (if req) */
/*------------------------------------------------------*/
Expand All @@ -508,6 +509,7 @@ init_e300_core: /* time t 10 */
stw r4, SWCRR(r3)
1:
#endif /* CONFIG_WATCHDOG */
#endif

#if defined(CONFIG_MASK_AER_AO)
/* Write the Arbiter Event Enable to mask Address Only traps. */
Expand Down
2 changes: 1 addition & 1 deletion drivers/watchdog/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ config WDT_MESON_GXBB

config WDT_MPC8xxx
bool "MPC8xxx watchdog timer support"
depends on WDT && MPC8xx
depends on WDT && (MPC8xx || MPC83xx)
help
Select this to enable mpc8xxx watchdog timer

Expand Down
1 change: 1 addition & 0 deletions drivers/watchdog/mpc8xxx_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ static const struct wdt_ops mpc8xxx_wdt_ops = {

static const struct udevice_id mpc8xxx_wdt_ids[] = {
{ .compatible = "fsl,pq1-wdt", .data = 0x800 },
{ .compatible = "fsl,pq2pro-wdt", .data = 0x10000 },
{}
};

Expand Down

0 comments on commit 0fd7913

Please sign in to comment.