Commit 4c4ca6cdd5836a416fcebe0d8dea585ad4a00681

Authored by Christophe Leroy
Committed by Tom Rini
1 parent 749c9aae9d

board: MCR3000: use new DM watchdog

This patch switches MCR3000 board to the new DM watchdog.

The change in u-boot.lds is because MCR3000.o grows a bit
with this patch and doesn't fit anymore below env_offset on
some versions of GCC.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

Showing 4 changed files with 22 additions and 1 deletions Side-by-side Diff

arch/powerpc/dts/mcr3000.dts
... ... @@ -9,5 +9,8 @@
9 9 /dts-v1/;
10 10  
11 11 / {
  12 + WDT: watchdog@0 {
  13 + compatible = "fsl,pq1-wdt";
  14 + };
12 15 };
board/cssi/MCR3000/MCR3000.c
... ... @@ -12,6 +12,8 @@
12 12 #include <mpc8xx.h>
13 13 #include <fdt_support.h>
14 14 #include <asm/io.h>
  15 +#include <dm/uclass.h>
  16 +#include <wdt.h>
15 17  
16 18 DECLARE_GLOBAL_DATA_PTR;
17 19  
... ... @@ -140,6 +142,20 @@
140 142 setbits_be32(&immr->im_cpm.cp_pbdir, 0x00020000); /* PROGFPGA output */
141 143 udelay(1); /* Wait more than 300ns */
142 144 setbits_be32(&immr->im_cpm.cp_pbdat, 0x00020000); /* PROGFPGA up */
  145 +
  146 + return 0;
  147 +}
  148 +
  149 +int board_early_init_r(void)
  150 +{
  151 + struct udevice *watchdog_dev = NULL;
  152 +
  153 + if (uclass_get_device(UCLASS_WDT, 0, &watchdog_dev)) {
  154 + puts("Cannot find watchdog!\n");
  155 + } else {
  156 + puts("Enabling watchdog.\n");
  157 + wdt_start(watchdog_dev, 0xffff, 0);
  158 + }
143 159  
144 160 return 0;
145 161 }
board/cssi/MCR3000/u-boot.lds
... ... @@ -19,7 +19,6 @@
19 19 arch/powerpc/cpu/mpc8xx/start.o (.text)
20 20 arch/powerpc/cpu/mpc8xx/traps.o (.text*)
21 21 arch/powerpc/lib/built-in.o (.text*)
22   - board/cssi/MCR3000/built-in.o (.text*)
23 22 drivers/net/built-in.o (.text*)
24 23  
25 24 . = DEFINED(env_offset) ? env_offset : .;
configs/MCR3000_defconfig
... ... @@ -42,6 +42,7 @@
42 42 CONFIG_USE_BOOTCOMMAND=y
43 43 CONFIG_BOOTCOMMAND="run flashboot"
44 44 CONFIG_MISC_INIT_R=y
  45 +CONFIG_BOARD_EARLY_INIT_R=y
45 46 CONFIG_HUSH_PARSER=y
46 47 # CONFIG_AUTO_COMPLETE is not set
47 48 CONFIG_SYS_PROMPT="S3K> "
... ... @@ -76,4 +77,6 @@
76 77 CONFIG_DM=y
77 78 CONFIG_OF_CONTROL=y
78 79 CONFIG_DEFAULT_DEVICE_TREE="mcr3000"
  80 +CONFIG_WDT=y
  81 +CONFIG_WDT_MPC8xx=y