blob: 29a17c57fcea0f382415eb3cc7f2023cc6becec5 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
wdenke65527f2004-02-12 00:47:09 +00002/*
3 * (C) Copyright 2003
4 * Josef Baumgartner <josef.baumgartner@telex.de>
5 *
Heiko Schocherac1956e2006-04-20 08:42:42 +02006 * MCF5282 additionals
7 * (C) Copyright 2005
8 * BuS Elektronik GmbH & Co. KG <esw@bus-elektronik.de>
9 *
Matthew Fettke761e2e92008-02-04 15:38:20 -060010 * MCF5275 additions
11 * Copyright (C) 2008 Arthur Shipkowski (art@videon-central.com)
12 *
Alison Wang95bed1f2012-03-26 21:49:04 +000013 * Copyright (C) 2012 Freescale Semiconductor, Inc. All Rights Reserved.
wdenke65527f2004-02-12 00:47:09 +000014 */
15
16#include <common.h>
17#include <watchdog.h>
18#include <command.h>
TsiChungLiew8cd73be2007-08-15 19:21:21 -050019#include <asm/immap.h>
Alison Wang95bed1f2012-03-26 21:49:04 +000020#include <asm/io.h>
Ben Warren2f2b6b62008-08-31 22:22:04 -070021#include <netdev.h>
Richard Retanubun5ffa65b2009-10-26 14:19:17 -040022#include "cpu.h"
wdenke65527f2004-02-12 00:47:09 +000023
TsiChung Liewb354aef2009-06-12 11:29:00 +000024DECLARE_GLOBAL_DATA_PTR;
25
26#ifdef CONFIG_M5208
Mike Frysinger6d1f6982010-10-20 03:41:17 -040027int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
TsiChung Liewb354aef2009-06-12 11:29:00 +000028{
Alison Wang95bed1f2012-03-26 21:49:04 +000029 rcm_t *rcm = (rcm_t *)(MMAP_RCM);
TsiChung Liewb354aef2009-06-12 11:29:00 +000030
31 udelay(1000);
32
Alison Wang95bed1f2012-03-26 21:49:04 +000033 out_8(&rcm->rcr, RCM_RCR_SOFTRST);
TsiChung Liewb354aef2009-06-12 11:29:00 +000034
35 /* we don't return! */
36 return 0;
37};
38
Angelo Dureghello3146b4d2017-08-20 00:01:55 +020039#if defined(CONFIG_DISPLAY_CPUINFO)
40int print_cpuinfo(void)
TsiChung Liewb354aef2009-06-12 11:29:00 +000041{
42 char buf1[32], buf2[32];
43
44 printf("CPU: Freescale Coldfire MCF5208\n"
45 " CPU CLK %s MHz BUS CLK %s MHz\n",
46 strmhz(buf1, gd->cpu_clk),
47 strmhz(buf2, gd->bus_clk));
48 return 0;
49};
Angelo Dureghello3146b4d2017-08-20 00:01:55 +020050#endif /* CONFIG_DISPLAY_CPUINFO */
TsiChung Liewb354aef2009-06-12 11:29:00 +000051
52#if defined(CONFIG_WATCHDOG)
53/* Called by macro WATCHDOG_RESET */
54void watchdog_reset(void)
55{
Alison Wang95bed1f2012-03-26 21:49:04 +000056 wdog_t *wdt = (wdog_t *)(MMAP_WDOG);
57
58 out_be16(&wdt->sr, 0x5555);
59 out_be16(&wdt->sr, 0xaaaa);
TsiChung Liewb354aef2009-06-12 11:29:00 +000060}
61
62int watchdog_disable(void)
63{
Alison Wang95bed1f2012-03-26 21:49:04 +000064 wdog_t *wdt = (wdog_t *)(MMAP_WDOG);
TsiChung Liewb354aef2009-06-12 11:29:00 +000065
Alison Wang95bed1f2012-03-26 21:49:04 +000066 /* reset watchdog counter */
67 out_be16(&wdt->sr, 0x5555);
68 out_be16(&wdt->sr, 0xaaaa);
69 /* disable watchdog timer */
70 out_be16(&wdt->cr, 0);
TsiChung Liewb354aef2009-06-12 11:29:00 +000071
72 puts("WATCHDOG:disabled\n");
73 return (0);
74}
75
76int watchdog_init(void)
77{
Alison Wang95bed1f2012-03-26 21:49:04 +000078 wdog_t *wdt = (wdog_t *)(MMAP_WDOG);
TsiChung Liewb354aef2009-06-12 11:29:00 +000079
Alison Wang95bed1f2012-03-26 21:49:04 +000080 /* disable watchdog */
81 out_be16(&wdt->cr, 0);
TsiChung Liewb354aef2009-06-12 11:29:00 +000082
83 /* set timeout and enable watchdog */
Alison Wang95bed1f2012-03-26 21:49:04 +000084 out_be16(&wdt->mr,
85 (CONFIG_WATCHDOG_TIMEOUT * CONFIG_SYS_HZ) / (32768 * 1000) - 1);
86
87 /* reset watchdog counter */
88 out_be16(&wdt->sr, 0x5555);
89 out_be16(&wdt->sr, 0xaaaa);
TsiChung Liewb354aef2009-06-12 11:29:00 +000090
91 puts("WATCHDOG:enabled\n");
92 return (0);
93}
94#endif /* #ifdef CONFIG_WATCHDOG */
95#endif /* #ifdef CONFIG_M5208 */
96
Zachary P. Landau0bba8622006-01-26 17:35:56 -050097#ifdef CONFIG_M5271
Angelo Dureghello3146b4d2017-08-20 00:01:55 +020098#if defined(CONFIG_DISPLAY_CPUINFO)
Bartlomiej Siekaad870262007-01-23 13:25:22 +010099/*
100 * Both MCF5270 and MCF5271 are members of the MPC5271 family. Try to
101 * determine which one we are running on, based on the Chip Identification
102 * Register (CIR).
103 */
Angelo Dureghello3146b4d2017-08-20 00:01:55 +0200104int print_cpuinfo(void)
Zachary P. Landau0bba8622006-01-26 17:35:56 -0500105{
Marian Balakowiczecb6d0b2006-05-09 11:45:31 +0200106 char buf[32];
Bartlomiej Siekaad870262007-01-23 13:25:22 +0100107 unsigned short cir; /* Chip Identification Register */
108 unsigned short pin; /* Part identification number */
109 unsigned char prn; /* Part revision number */
110 char *cpu_model;
111
112 cir = mbar_readShort(MCF_CCM_CIR);
113 pin = cir >> MCF_CCM_CIR_PIN_LEN;
114 prn = cir & MCF_CCM_CIR_PRN_MASK;
115
116 switch (pin) {
117 case MCF_CCM_CIR_PIN_MCF5270:
118 cpu_model = "5270";
119 break;
120 case MCF_CCM_CIR_PIN_MCF5271:
121 cpu_model = "5271";
122 break;
123 default:
124 cpu_model = NULL;
125 break;
126 }
127
128 if (cpu_model)
129 printf("CPU: Freescale ColdFire MCF%s rev. %hu, at %s MHz\n",
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200130 cpu_model, prn, strmhz(buf, CONFIG_SYS_CLK));
Bartlomiej Siekaad870262007-01-23 13:25:22 +0100131 else
132 printf("CPU: Unknown - Freescale ColdFire MCF5271 family"
TsiChungLiew8cd73be2007-08-15 19:21:21 -0500133 " (PIN: 0x%x) rev. %hu, at %s MHz\n",
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200134 pin, prn, strmhz(buf, CONFIG_SYS_CLK));
Marian Balakowiczecb6d0b2006-05-09 11:45:31 +0200135
Zachary P. Landau0bba8622006-01-26 17:35:56 -0500136 return 0;
137}
Angelo Dureghello3146b4d2017-08-20 00:01:55 +0200138#endif /* CONFIG_DISPLAY_CPUINFO */
Zachary P. Landau0bba8622006-01-26 17:35:56 -0500139
Mike Frysinger6d1f6982010-10-20 03:41:17 -0400140int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
TsiChungLiew8cd73be2007-08-15 19:21:21 -0500141{
Richard Retanubun5ffa65b2009-10-26 14:19:17 -0400142 /* Call the board specific reset actions first. */
143 if(board_reset) {
144 board_reset();
145 }
146
Zachary P. Landau0bba8622006-01-26 17:35:56 -0500147 mbar_writeByte(MCF_RCM_RCR,
TsiChungLiew8cd73be2007-08-15 19:21:21 -0500148 MCF_RCM_RCR_SOFTRST | MCF_RCM_RCR_FRCRSTOUT);
Zachary P. Landau0bba8622006-01-26 17:35:56 -0500149 return 0;
150};
151
152#if defined(CONFIG_WATCHDOG)
TsiChungLiew8cd73be2007-08-15 19:21:21 -0500153void watchdog_reset(void)
Zachary P. Landau0bba8622006-01-26 17:35:56 -0500154{
155 mbar_writeShort(MCF_WTM_WSR, 0x5555);
156 mbar_writeShort(MCF_WTM_WSR, 0xAAAA);
157}
158
TsiChungLiew8cd73be2007-08-15 19:21:21 -0500159int watchdog_disable(void)
Zachary P. Landau0bba8622006-01-26 17:35:56 -0500160{
161 mbar_writeShort(MCF_WTM_WCR, 0);
162 return (0);
163}
164
TsiChungLiew8cd73be2007-08-15 19:21:21 -0500165int watchdog_init(void)
Zachary P. Landau0bba8622006-01-26 17:35:56 -0500166{
Zachary P. Landau0bba8622006-01-26 17:35:56 -0500167 mbar_writeShort(MCF_WTM_WCR, MCF_WTM_WCR_EN);
168 return (0);
169}
TsiChungLiew8cd73be2007-08-15 19:21:21 -0500170#endif /* #ifdef CONFIG_WATCHDOG */
Zachary P. Landau0bba8622006-01-26 17:35:56 -0500171
172#endif
wdenke65527f2004-02-12 00:47:09 +0000173
174#ifdef CONFIG_M5272
Mike Frysinger6d1f6982010-10-20 03:41:17 -0400175int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
TsiChungLiew8cd73be2007-08-15 19:21:21 -0500176{
Alison Wang95bed1f2012-03-26 21:49:04 +0000177 wdog_t *wdp = (wdog_t *) (MMAP_WDOG);
wdenke65527f2004-02-12 00:47:09 +0000178
Alison Wang95bed1f2012-03-26 21:49:04 +0000179 out_be16(&wdp->wdog_wrrr, 0);
TsiChungLiew8cd73be2007-08-15 19:21:21 -0500180 udelay(1000);
wdenke65527f2004-02-12 00:47:09 +0000181
182 /* enable watchdog, set timeout to 0 and wait */
Alison Wang95bed1f2012-03-26 21:49:04 +0000183 out_be16(&wdp->wdog_wrrr, 1);
TsiChungLiew8cd73be2007-08-15 19:21:21 -0500184 while (1) ;
wdenke65527f2004-02-12 00:47:09 +0000185
186 /* we don't return! */
187 return 0;
188};
189
Angelo Dureghello3146b4d2017-08-20 00:01:55 +0200190#if defined(CONFIG_DISPLAY_CPUINFO)
191int print_cpuinfo(void)
TsiChungLiew8cd73be2007-08-15 19:21:21 -0500192{
Alison Wang95bed1f2012-03-26 21:49:04 +0000193 sysctrl_t *sysctrl = (sysctrl_t *) (MMAP_CFG);
wdenke65527f2004-02-12 00:47:09 +0000194 uchar msk;
TsiChungLiew8cd73be2007-08-15 19:21:21 -0500195 char *suf;
wdenke65527f2004-02-12 00:47:09 +0000196
TsiChungLiew8cd73be2007-08-15 19:21:21 -0500197 puts("CPU: ");
Alison Wang95bed1f2012-03-26 21:49:04 +0000198 msk = (in_be32(&sysctrl->sc_dir) > 28) & 0xf;
wdenke65527f2004-02-12 00:47:09 +0000199 switch (msk) {
TsiChungLiew8cd73be2007-08-15 19:21:21 -0500200 case 0x2:
201 suf = "1K75N";
202 break;
203 case 0x4:
204 suf = "3K75N";
205 break;
206 default:
207 suf = NULL;
208 printf("Freescale MCF5272 (Mask:%01x)\n", msk);
209 break;
210 }
wdenke65527f2004-02-12 00:47:09 +0000211
212 if (suf)
TsiChungLiew8cd73be2007-08-15 19:21:21 -0500213 printf("Freescale MCF5272 %s\n", suf);
wdenke65527f2004-02-12 00:47:09 +0000214 return 0;
215};
Angelo Dureghello3146b4d2017-08-20 00:01:55 +0200216#endif /* CONFIG_DISPLAY_CPUINFO */
wdenke65527f2004-02-12 00:47:09 +0000217
wdenke65527f2004-02-12 00:47:09 +0000218#if defined(CONFIG_WATCHDOG)
219/* Called by macro WATCHDOG_RESET */
TsiChungLiew8cd73be2007-08-15 19:21:21 -0500220void watchdog_reset(void)
wdenke65527f2004-02-12 00:47:09 +0000221{
Alison Wang95bed1f2012-03-26 21:49:04 +0000222 wdog_t *wdt = (wdog_t *)(MMAP_WDOG);
223
224 out_be16(&wdt->wdog_wcr, 0);
wdenke65527f2004-02-12 00:47:09 +0000225}
226
TsiChungLiew8cd73be2007-08-15 19:21:21 -0500227int watchdog_disable(void)
wdenke65527f2004-02-12 00:47:09 +0000228{
Alison Wang95bed1f2012-03-26 21:49:04 +0000229 wdog_t *wdt = (wdog_t *)(MMAP_WDOG);
wdenke65527f2004-02-12 00:47:09 +0000230
Alison Wang95bed1f2012-03-26 21:49:04 +0000231 /* reset watchdog counter */
232 out_be16(&wdt->wdog_wcr, 0);
233 /* disable watchdog interrupt */
234 out_be16(&wdt->wdog_wirr, 0);
235 /* disable watchdog timer */
236 out_be16(&wdt->wdog_wrrr, 0);
wdenke65527f2004-02-12 00:47:09 +0000237
TsiChungLiew8cd73be2007-08-15 19:21:21 -0500238 puts("WATCHDOG:disabled\n");
wdenke65527f2004-02-12 00:47:09 +0000239 return (0);
240}
241
TsiChungLiew8cd73be2007-08-15 19:21:21 -0500242int watchdog_init(void)
wdenke65527f2004-02-12 00:47:09 +0000243{
Alison Wang95bed1f2012-03-26 21:49:04 +0000244 wdog_t *wdt = (wdog_t *)(MMAP_WDOG);
wdenke65527f2004-02-12 00:47:09 +0000245
Alison Wang95bed1f2012-03-26 21:49:04 +0000246 /* disable watchdog interrupt */
247 out_be16(&wdt->wdog_wirr, 0);
wdenke65527f2004-02-12 00:47:09 +0000248
249 /* set timeout and enable watchdog */
Alison Wang95bed1f2012-03-26 21:49:04 +0000250 out_be16(&wdt->wdog_wrrr,
251 (CONFIG_WATCHDOG_TIMEOUT * CONFIG_SYS_HZ) / (32768 * 1000) - 1);
252
253 /* reset watchdog counter */
254 out_be16(&wdt->wdog_wcr, 0);
wdenke65527f2004-02-12 00:47:09 +0000255
TsiChungLiew8cd73be2007-08-15 19:21:21 -0500256 puts("WATCHDOG:enabled\n");
wdenke65527f2004-02-12 00:47:09 +0000257 return (0);
258}
TsiChungLiew8cd73be2007-08-15 19:21:21 -0500259#endif /* #ifdef CONFIG_WATCHDOG */
wdenke65527f2004-02-12 00:47:09 +0000260
TsiChungLiew8cd73be2007-08-15 19:21:21 -0500261#endif /* #ifdef CONFIG_M5272 */
wdenke65527f2004-02-12 00:47:09 +0000262
Matthew Fettke761e2e92008-02-04 15:38:20 -0600263#ifdef CONFIG_M5275
Mike Frysinger6d1f6982010-10-20 03:41:17 -0400264int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
Matthew Fettke761e2e92008-02-04 15:38:20 -0600265{
Alison Wang95bed1f2012-03-26 21:49:04 +0000266 rcm_t *rcm = (rcm_t *)(MMAP_RCM);
Matthew Fettke761e2e92008-02-04 15:38:20 -0600267
268 udelay(1000);
269
Alison Wang95bed1f2012-03-26 21:49:04 +0000270 out_8(&rcm->rcr, RCM_RCR_SOFTRST);
Matthew Fettke761e2e92008-02-04 15:38:20 -0600271
272 /* we don't return! */
273 return 0;
274};
275
Angelo Dureghello3146b4d2017-08-20 00:01:55 +0200276#if defined(CONFIG_DISPLAY_CPUINFO)
277int print_cpuinfo(void)
Matthew Fettke761e2e92008-02-04 15:38:20 -0600278{
279 char buf[32];
280
281 printf("CPU: Freescale Coldfire MCF5275 at %s MHz\n",
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200282 strmhz(buf, CONFIG_SYS_CLK));
Matthew Fettke761e2e92008-02-04 15:38:20 -0600283 return 0;
284};
Angelo Dureghello3146b4d2017-08-20 00:01:55 +0200285#endif /* CONFIG_DISPLAY_CPUINFO */
Matthew Fettke761e2e92008-02-04 15:38:20 -0600286
287#if defined(CONFIG_WATCHDOG)
288/* Called by macro WATCHDOG_RESET */
289void watchdog_reset(void)
290{
Alison Wang95bed1f2012-03-26 21:49:04 +0000291 wdog_t *wdt = (wdog_t *)(MMAP_WDOG);
292
293 out_be16(&wdt->wsr, 0x5555);
294 out_be16(&wdt->wsr, 0xaaaa);
Matthew Fettke761e2e92008-02-04 15:38:20 -0600295}
296
297int watchdog_disable(void)
298{
Alison Wang95bed1f2012-03-26 21:49:04 +0000299 wdog_t *wdt = (wdog_t *)(MMAP_WDOG);
Matthew Fettke761e2e92008-02-04 15:38:20 -0600300
Alison Wang95bed1f2012-03-26 21:49:04 +0000301 /* reset watchdog counter */
302 out_be16(&wdt->wsr, 0x5555);
303 out_be16(&wdt->wsr, 0xaaaa);
304
305 /* disable watchdog timer */
306 out_be16(&wdt->wcr, 0);
Matthew Fettke761e2e92008-02-04 15:38:20 -0600307
308 puts("WATCHDOG:disabled\n");
309 return (0);
310}
311
312int watchdog_init(void)
313{
Alison Wang95bed1f2012-03-26 21:49:04 +0000314 wdog_t *wdt = (wdog_t *)(MMAP_WDOG);
Matthew Fettke761e2e92008-02-04 15:38:20 -0600315
Alison Wang95bed1f2012-03-26 21:49:04 +0000316 /* disable watchdog */
317 out_be16(&wdt->wcr, 0);
Matthew Fettke761e2e92008-02-04 15:38:20 -0600318
319 /* set timeout and enable watchdog */
Alison Wang95bed1f2012-03-26 21:49:04 +0000320 out_be16(&wdt->wmr,
321 (CONFIG_WATCHDOG_TIMEOUT * CONFIG_SYS_HZ) / (32768 * 1000) - 1);
322
323 /* reset watchdog counter */
324 out_be16(&wdt->wsr, 0x5555);
325 out_be16(&wdt->wsr, 0xaaaa);
Matthew Fettke761e2e92008-02-04 15:38:20 -0600326
327 puts("WATCHDOG:enabled\n");
328 return (0);
329}
330#endif /* #ifdef CONFIG_WATCHDOG */
331
332#endif /* #ifdef CONFIG_M5275 */
333
wdenke65527f2004-02-12 00:47:09 +0000334#ifdef CONFIG_M5282
Angelo Dureghello3146b4d2017-08-20 00:01:55 +0200335#if defined(CONFIG_DISPLAY_CPUINFO)
336int print_cpuinfo(void)
wdenke65527f2004-02-12 00:47:09 +0000337{
Wolfgang Denkb4b1c462006-06-10 19:27:47 +0200338 unsigned char resetsource = MCFRESET_RSR;
Heiko Schocherac1956e2006-04-20 08:42:42 +0200339
TsiChungLiew8cd73be2007-08-15 19:21:21 -0500340 printf("CPU: Freescale Coldfire MCF5282 (PIN: %2.2x REV: %2.2x)\n",
341 MCFCCM_CIR >> 8, MCFCCM_CIR & MCFCCM_CIR_PRN_MASK);
342 printf("Reset:%s%s%s%s%s%s%s\n",
343 (resetsource & MCFRESET_RSR_LOL) ? " Loss of Lock" : "",
344 (resetsource & MCFRESET_RSR_LOC) ? " Loss of Clock" : "",
345 (resetsource & MCFRESET_RSR_EXT) ? " External" : "",
346 (resetsource & MCFRESET_RSR_POR) ? " Power On" : "",
347 (resetsource & MCFRESET_RSR_WDR) ? " Watchdog" : "",
348 (resetsource & MCFRESET_RSR_SOFT) ? " Software" : "",
349 (resetsource & MCFRESET_RSR_LVD) ? " Low Voltage" : "");
wdenke65527f2004-02-12 00:47:09 +0000350 return 0;
351}
Angelo Dureghello3146b4d2017-08-20 00:01:55 +0200352#endif /* CONFIG_DISPLAY_CPUINFO */
wdenke65527f2004-02-12 00:47:09 +0000353
Mike Frysinger6d1f6982010-10-20 03:41:17 -0400354int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
Heiko Schocherac1956e2006-04-20 08:42:42 +0200355{
356 MCFRESET_RCR = MCFRESET_RCR_SOFTRST;
wdenke65527f2004-02-12 00:47:09 +0000357 return 0;
358};
359#endif
stroese53395a22004-12-16 18:09:49 +0000360
TsiChungLiew34674692007-08-16 13:20:50 -0500361#ifdef CONFIG_M5249
Angelo Dureghello3146b4d2017-08-20 00:01:55 +0200362#if defined(CONFIG_DISPLAY_CPUINFO)
363int print_cpuinfo(void)
stroese53395a22004-12-16 18:09:49 +0000364{
365 char buf[32];
366
TsiChungLiew8cd73be2007-08-15 19:21:21 -0500367 printf("CPU: Freescale Coldfire MCF5249 at %s MHz\n",
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200368 strmhz(buf, CONFIG_SYS_CLK));
stroese53395a22004-12-16 18:09:49 +0000369 return 0;
370}
Angelo Dureghello3146b4d2017-08-20 00:01:55 +0200371#endif /* CONFIG_DISPLAY_CPUINFO */
stroese53395a22004-12-16 18:09:49 +0000372
Mike Frysinger6d1f6982010-10-20 03:41:17 -0400373int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
TsiChungLiew8cd73be2007-08-15 19:21:21 -0500374{
stroese53395a22004-12-16 18:09:49 +0000375 /* enable watchdog, set timeout to 0 and wait */
376 mbar_writeByte(MCFSIM_SYPCR, 0xc0);
TsiChungLiew8cd73be2007-08-15 19:21:21 -0500377 while (1) ;
stroese53395a22004-12-16 18:09:49 +0000378
379 /* we don't return! */
380 return 0;
381};
382#endif
TsiChungLiew34674692007-08-16 13:20:50 -0500383
384#ifdef CONFIG_M5253
Angelo Dureghello3146b4d2017-08-20 00:01:55 +0200385#if defined(CONFIG_DISPLAY_CPUINFO)
386int print_cpuinfo(void)
TsiChungLiew34674692007-08-16 13:20:50 -0500387{
388 char buf[32];
389
390 unsigned char resetsource = mbar_readLong(SIM_RSR);
391 printf("CPU: Freescale Coldfire MCF5253 at %s MHz\n",
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200392 strmhz(buf, CONFIG_SYS_CLK));
TsiChungLiew34674692007-08-16 13:20:50 -0500393
394 if ((resetsource & SIM_RSR_HRST) || (resetsource & SIM_RSR_SWTR)) {
395 printf("Reset:%s%s\n",
396 (resetsource & SIM_RSR_HRST) ? " Hardware/ System Reset"
397 : "",
398 (resetsource & SIM_RSR_SWTR) ? " Software Watchdog" :
399 "");
400 }
401 return 0;
402}
Angelo Dureghello3146b4d2017-08-20 00:01:55 +0200403#endif /* CONFIG_DISPLAY_CPUINFO */
TsiChungLiew34674692007-08-16 13:20:50 -0500404
Mike Frysinger6d1f6982010-10-20 03:41:17 -0400405int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
TsiChungLiew34674692007-08-16 13:20:50 -0500406{
407 /* enable watchdog, set timeout to 0 and wait */
408 mbar_writeByte(SIM_SYPCR, 0xc0);
409 while (1) ;
410
411 /* we don't return! */
412 return 0;
413};
414#endif
Ben Warren90c96db2008-08-26 22:16:25 -0700415
416#if defined(CONFIG_MCFFEC)
417/* Default initializations for MCFFEC controllers. To override,
418 * create a board-specific function called:
419 * int board_eth_init(bd_t *bis)
420 */
421
Ben Warren90c96db2008-08-26 22:16:25 -0700422int cpu_eth_init(bd_t *bis)
423{
424 return mcffec_initialize(bis);
425}
426#endif