bool "MPC8xx"
select BOARD_EARLY_INIT_F
imply CMD_REGINFO
- imply HW_WATCHDOG
+ imply MPC8xx_WATCHDOG
endchoice
endchoice
+config MPC8xx_WATCHDOG
+ bool "Watchdog"
+ select HW_WATCHDOG
+
config 8xx_GCLK_FREQ
int "CPU GCLK Frequency"
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()
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
--- /dev/null
+/*
+ * 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 */
+}
+