powerpc: mpc8xx: move watchdog into drivers/watchdog

In preparation of DM watchdog, move basic actions into drivers/watchdog

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
master
Christophe Leroy 7 years ago committed by Tom Rini
parent 5c5da4318b
commit c0bc2a7e06
  1. 2
      arch/powerpc/Kconfig
  2. 4
      arch/powerpc/cpu/mpc8xx/Kconfig
  3. 12
      arch/powerpc/cpu/mpc8xx/cpu.c
  4. 1
      drivers/watchdog/Makefile
  5. 21
      drivers/watchdog/mpc8xx_wdt.c

@ -34,7 +34,7 @@ config MPC8xx
bool "MPC8xx"
select BOARD_EARLY_INIT_F
imply CMD_REGINFO
imply HW_WATCHDOG
imply MPC8xx_WATCHDOG
endchoice

@ -25,6 +25,10 @@ config MPC885
endchoice
config MPC8xx_WATCHDOG
bool "Watchdog"
select HW_WATCHDOG
config 8xx_GCLK_FREQ
int "CPU GCLK Frequency"

@ -270,18 +270,6 @@ unsigned long get_tbclk(void)
return oscclk / 16;
}
/* ------------------------------------------------------------------------- */
#if defined(CONFIG_HW_WATCHDOG)
void hw_watchdog_reset(void)
{
immap_t __iomem *immr = (immap_t __iomem *)CONFIG_SYS_IMMR;
out_be16(&immr->im_siu_conf.sc_swsr, 0x556c); /* write magic1 */
out_be16(&immr->im_siu_conf.sc_swsr, 0xaa39); /* write magic2 */
}
#endif /* CONFIG_WATCHDOG */
/*
* Initializes on-chip ethernet controllers.
* to override, implement board_eth_init()

@ -23,3 +23,4 @@ obj-$(CONFIG_WDT_BCM6345) += bcm6345_wdt.o
obj-$(CONFIG_BCM2835_WDT) += bcm2835_wdt.o
obj-$(CONFIG_WDT_ORION) += orion_wdt.o
obj-$(CONFIG_WDT_CDNS) += cdns_wdt.o
obj-$(CONFIG_MPC8xx_WATCHDOG) += mpc8xx_wdt.o

@ -0,0 +1,21 @@
/*
* Copyright 2017 CS Systemes d'Information
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <mpc8xx.h>
#include <asm/cpm_8xx.h>
#include <asm/io.h>
DECLARE_GLOBAL_DATA_PTR;
void hw_watchdog_reset(void)
{
immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
out_be16(&immap->im_siu_conf.sc_swsr, 0x556c); /* write magic1 */
out_be16(&immap->im_siu_conf.sc_swsr, 0xaa39); /* write magic2 */
}
Loading…
Cancel
Save