blob: 4a32986a2e7c0cc33414acdb9d19f1031b7e96cb [file] [log] [blame]
wdenkc6097192002-11-03 00:24:07 +00001/*
2 * (C) Copyright 2000-2002
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 *
5 * See file CREDITS for list of people who contributed to this
6 * project.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21 * MA 02111-1307 USA
22 */
23
24/*
25 * m8xx.c
26 *
27 * CPU specific code
28 *
29 * written or collected and sometimes rewritten by
30 * Magnus Damm <damm@bitsmart.com>
31 *
32 * minor modifications by
33 * Wolfgang Denk <wd@denx.de>
34 */
35
36#include <common.h>
37#include <watchdog.h>
38#include <command.h>
39#include <mpc8xx.h>
40#include <asm/cache.h>
41
42static char *cpu_warning = "\n " \
43 "*** Warning: CPU Core has Silicon Bugs -- Check the Errata ***";
44
wdenk2535d602003-07-17 23:16:40 +000045#if ((defined(CONFIG_MPC86x) || defined(CONFIG_MPC855)) && \
wdenkc6097192002-11-03 00:24:07 +000046 !defined(CONFIG_MPC862))
wdenk2535d602003-07-17 23:16:40 +000047
wdenkc6097192002-11-03 00:24:07 +000048static int check_CPU (long clock, uint pvr, uint immr)
49{
wdenk180d3f72004-01-04 16:28:35 +000050 char *id_str =
51# if defined(CONFIG_MPC855)
52 "PC855";
53# elif defined(CONFIG_MPC860P)
54 "PC860P";
55# else
56 NULL;
57# endif
wdenkc6097192002-11-03 00:24:07 +000058 volatile immap_t *immap = (immap_t *) (immr & 0xFFFF0000);
59 uint k, m;
60 char buf[32];
61 char pre = 'X';
62 char *mid = "xx";
63 char *suf;
64
65 /* the highest 16 bits should be 0x0050 for a 860 */
66
67 if ((pvr >> 16) != 0x0050)
68 return -1;
69
70 k = (immr << 16) | *((ushort *) & immap->im_cpm.cp_dparam[0xB0]);
71 m = 0;
72
wdenk180d3f72004-01-04 16:28:35 +000073 /*
74 * Some boards use sockets so different CPUs can be used.
75 * We have to check chip version in run time.
76 */
wdenkc6097192002-11-03 00:24:07 +000077 switch (k) {
wdenk180d3f72004-01-04 16:28:35 +000078 case 0x00020001: pre = 'P'; suf = ""; break;
wdenkc6097192002-11-03 00:24:07 +000079 case 0x00030001: suf = ""; break;
80 case 0x00120003: suf = "A"; break;
81 case 0x00130003: suf = "A3"; break;
82
83 case 0x00200004: suf = "B"; break;
84
85 case 0x00300004: suf = "C"; break;
wdenk2535d602003-07-17 23:16:40 +000086 case 0x00310004: suf = "C1"; m = 1; break;
wdenkc6097192002-11-03 00:24:07 +000087
88 case 0x00200064: mid = "SR"; suf = "B"; break;
89 case 0x00300065: mid = "SR"; suf = "C"; break;
90 case 0x00310065: mid = "SR"; suf = "C1"; m = 1; break;
91 case 0x05010000: suf = "D3"; m = 1; break;
92 case 0x05020000: suf = "D4"; m = 1; break;
wdenkc6097192002-11-03 00:24:07 +000093 /* this value is not documented anywhere */
94 case 0x40000000: pre = 'P'; suf = "D"; m = 1; break;
wdenk180d3f72004-01-04 16:28:35 +000095 /* MPC866P/MPC866T/MPC859T/MPC859DSL/MPC852T */
96 case 0x08000003: pre = 'M'; suf = ""; m = 1;
97 if (id_str == NULL)
98 id_str =
99# if defined(CONFIG_MPC852T)
100 "PC852T";
101# elif defined(CONFIG_MPC859T)
102 "PC859T";
103# elif defined(CONFIG_MPC859DSL)
104 "PC859DSL";
105# elif defined(CONFIG_MPC866T)
106 "PC866T";
107# else
108 "PC866x"; /* Unknown chip from MPC866 family */
109# endif
110 break;
111 case 0x09000000: pre = 'M'; mid = suf = ""; m = 1;
112 if (id_str == NULL)
113 id_str = "PC885"; /* 870/875/880/885 */
114 break;
wdenkc6097192002-11-03 00:24:07 +0000115
116 default: suf = NULL; break;
117 }
118
wdenk180d3f72004-01-04 16:28:35 +0000119 if (id_str == NULL)
120 id_str = "PC86x"; /* Unknown 86x chip */
wdenkc6097192002-11-03 00:24:07 +0000121 if (suf)
wdenk180d3f72004-01-04 16:28:35 +0000122 printf ("%c%s%sZPnn%s", pre, id_str, mid, suf);
wdenkc6097192002-11-03 00:24:07 +0000123 else
wdenk180d3f72004-01-04 16:28:35 +0000124 printf ("unknown M%s (0x%08x)", id_str, k);
wdenkc6097192002-11-03 00:24:07 +0000125
wdenkc6097192002-11-03 00:24:07 +0000126
wdenk66ca92a2004-09-28 17:59:53 +0000127#if defined(CFG_8xx_CPUCLK_MIN) && defined(CFG_8xx_CPUCLK_MAX)
wdenk75d1ea72004-01-31 20:06:54 +0000128 printf (" at %s MHz [%d.%d...%d.%d MHz]\n ",
129 strmhz (buf, clock),
wdenk66ca92a2004-09-28 17:59:53 +0000130 CFG_8xx_CPUCLK_MIN / 1000000,
131 ((CFG_8xx_CPUCLK_MIN % 1000000) + 50000) / 100000,
132 CFG_8xx_CPUCLK_MAX / 1000000,
133 ((CFG_8xx_CPUCLK_MAX % 1000000) + 50000) / 100000
wdenk75d1ea72004-01-31 20:06:54 +0000134 );
135#else
136 printf (" at %s MHz: ", strmhz (buf, clock));
137#endif
138 printf ("%u kB I-Cache %u kB D-Cache",
139 checkicache () >> 10,
140 checkdcache () >> 10
141 );
wdenkc6097192002-11-03 00:24:07 +0000142
wdenk66ca92a2004-09-28 17:59:53 +0000143 /* do we have a FEC (860T/P or 852/859/866/885)? */
wdenkc6097192002-11-03 00:24:07 +0000144
145 immap->im_cpm.cp_fec.fec_addr_low = 0x12345678;
146 if (immap->im_cpm.cp_fec.fec_addr_low == 0x12345678) {
147 printf (" FEC present");
148 }
149
150 if (!m) {
151 puts (cpu_warning);
152 }
153
154 putc ('\n');
155
wdenk2535d602003-07-17 23:16:40 +0000156#ifdef DEBUG
wdenk42d1f032003-10-15 23:53:47 +0000157 if(clock != measure_gclk()) {
158 printf ("clock %ldHz != %dHz\n", clock, measure_gclk());
159 }
wdenk2535d602003-07-17 23:16:40 +0000160#endif
161
wdenkc6097192002-11-03 00:24:07 +0000162 return 0;
163}
164
165#elif defined(CONFIG_MPC862)
166
167static int check_CPU (long clock, uint pvr, uint immr)
168{
169 volatile immap_t *immap = (immap_t *) (immr & 0xFFFF0000);
170 uint k, m;
171 char buf[32];
172 char pre = 'X';
173 char *mid = "xx";
174 char *suf;
175
176 /* the highest 16 bits should be 0x0050 for a 8xx */
177
178 if ((pvr >> 16) != 0x0050)
179 return -1;
180
181 k = (immr << 16) | *((ushort *) & immap->im_cpm.cp_dparam[0xB0]);
182 m = 0;
183
184 switch (k) {
185
186 /* this value is not documented anywhere */
187 case 0x06000000: mid = "P"; suf = "0"; break;
188 case 0x06010001: mid = "P"; suf = "A"; m = 1; break;
189 case 0x07000003: mid = "P"; suf = "B"; m = 1; break;
190 default: suf = NULL; break;
191 }
192
wdenkf7d15722004-12-18 22:35:43 +0000193#ifndef CONFIG_MPC857
wdenkc6097192002-11-03 00:24:07 +0000194 if (suf)
195 printf ("%cPC862%sZPnn%s", pre, mid, suf);
196 else
197 printf ("unknown MPC862 (0x%08x)", k);
wdenkf7d15722004-12-18 22:35:43 +0000198#else
199 if (suf)
200 printf ("%cPC857TZPnn%s", pre, suf); /* only 857T tested right now! */
201 else
202 printf ("unknown MPC857 (0x%08x)", k);
203#endif
wdenkc6097192002-11-03 00:24:07 +0000204
205 printf (" at %s MHz:", strmhz (buf, clock));
206
207 printf (" %u kB I-Cache", checkicache () >> 10);
208 printf (" %u kB D-Cache", checkdcache () >> 10);
209
210 /* lets check and see if we're running on a 862T (or P?) */
211
212 immap->im_cpm.cp_fec.fec_addr_low = 0x12345678;
213 if (immap->im_cpm.cp_fec.fec_addr_low == 0x12345678) {
214 printf (" FEC present");
215 }
216
217 if (!m) {
218 puts (cpu_warning);
219 }
220
221 putc ('\n');
222
223 return 0;
224}
225
226#elif defined(CONFIG_MPC823)
227
228static int check_CPU (long clock, uint pvr, uint immr)
229{
230 volatile immap_t *immap = (immap_t *) (immr & 0xFFFF0000);
231 uint k, m;
232 char buf[32];
233 char *suf;
234
235 /* the highest 16 bits should be 0x0050 for a 8xx */
236
237 if ((pvr >> 16) != 0x0050)
238 return -1;
239
240 k = (immr << 16) | *((ushort *) & immap->im_cpm.cp_dparam[0xB0]);
241 m = 0;
242
243 switch (k) {
244 /* MPC823 */
245 case 0x20000000: suf = "0"; break;
246 case 0x20010000: suf = "0.1"; break;
247 case 0x20020000: suf = "Z2/3"; break;
248 case 0x20020001: suf = "Z3"; break;
249 case 0x21000000: suf = "A"; break;
250 case 0x21010000: suf = "B"; m = 1; break;
251 case 0x21010001: suf = "B2"; m = 1; break;
252 /* MPC823E */
253 case 0x24010000: suf = NULL;
254 puts ("PPC823EZTnnB2");
255 m = 1;
256 break;
257 default:
258 suf = NULL;
259 printf ("unknown MPC823 (0x%08x)", k);
260 break;
261 }
262 if (suf)
263 printf ("PPC823ZTnn%s", suf);
264
265 printf (" at %s MHz:", strmhz (buf, clock));
266
267 printf (" %u kB I-Cache", checkicache () >> 10);
268 printf (" %u kB D-Cache", checkdcache () >> 10);
269
270 /* lets check and see if we're running on a 860T (or P?) */
271
272 immap->im_cpm.cp_fec.fec_addr_low = 0x12345678;
273 if (immap->im_cpm.cp_fec.fec_addr_low == 0x12345678) {
274 puts (" FEC present");
275 }
276
277 if (!m) {
278 puts (cpu_warning);
279 }
280
281 putc ('\n');
282
283 return 0;
284}
285
286#elif defined(CONFIG_MPC850)
287
288static int check_CPU (long clock, uint pvr, uint immr)
289{
290 volatile immap_t *immap = (immap_t *) (immr & 0xFFFF0000);
291 uint k, m;
292 char buf[32];
293
294 /* the highest 16 bits should be 0x0050 for a 8xx */
295
296 if ((pvr >> 16) != 0x0050)
297 return -1;
298
299 k = (immr << 16) | *((ushort *) & immap->im_cpm.cp_dparam[0xB0]);
300 m = 0;
301
302 switch (k) {
303 case 0x20020001:
304 printf ("XPC850xxZT");
305 break;
306 case 0x21000065:
307 printf ("XPC850xxZTA");
308 break;
309 case 0x21010067:
310 printf ("XPC850xxZTB");
311 m = 1;
312 break;
313 case 0x21020068:
314 printf ("XPC850xxZTC");
315 m = 1;
316 break;
317 default:
318 printf ("unknown MPC850 (0x%08x)", k);
319 }
320 printf (" at %s MHz:", strmhz (buf, clock));
321
322 printf (" %u kB I-Cache", checkicache () >> 10);
323 printf (" %u kB D-Cache", checkdcache () >> 10);
324
325 /* lets check and see if we're running on a 850T (or P?) */
326
327 immap->im_cpm.cp_fec.fec_addr_low = 0x12345678;
328 if (immap->im_cpm.cp_fec.fec_addr_low == 0x12345678) {
329 printf (" FEC present");
330 }
331
332 if (!m) {
333 puts (cpu_warning);
334 }
335
336 putc ('\n');
337
338 return 0;
339}
340#else
341#error CPU undefined
342#endif
343/* ------------------------------------------------------------------------- */
344
345int checkcpu (void)
346{
347 DECLARE_GLOBAL_DATA_PTR;
348
349 ulong clock = gd->cpu_clk;
350 uint immr = get_immr (0); /* Return full IMMR contents */
351 uint pvr = get_pvr ();
352
353 puts ("CPU: ");
354
355 /* 850 has PARTNUM 20 */
356 /* 801 has PARTNUM 10 */
357 return check_CPU (clock, pvr, immr);
358}
359
360/* ------------------------------------------------------------------------- */
361/* L1 i-cache */
362/* the standard 860 has 128 sets of 16 bytes in 2 ways (= 4 kB) */
363/* the 860 P (plus) has 256 sets of 16 bytes in 4 ways (= 16 kB) */
364
365int checkicache (void)
366{
367 volatile immap_t *immap = (immap_t *) CFG_IMMR;
368 volatile memctl8xx_t *memctl = &immap->im_memctl;
369 u32 cacheon = rd_ic_cst () & IDC_ENABLED;
370
wdenk2535d602003-07-17 23:16:40 +0000371#ifdef CONFIG_IP86x
wdenkc6097192002-11-03 00:24:07 +0000372 u32 k = memctl->memc_br1 & ~0x00007fff; /* probe in flash memoryarea */
373#else
374 u32 k = memctl->memc_br0 & ~0x00007fff; /* probe in flash memoryarea */
375#endif
376 u32 m;
377 u32 lines = -1;
378
379 wr_ic_cst (IDC_UNALL);
380 wr_ic_cst (IDC_INVALL);
381 wr_ic_cst (IDC_DISABLE);
382 __asm__ volatile ("isync");
383
384 while (!((m = rd_ic_cst ()) & IDC_CERR2)) {
385 wr_ic_adr (k);
386 wr_ic_cst (IDC_LDLCK);
387 __asm__ volatile ("isync");
388
389 lines++;
390 k += 0x10; /* the number of bytes in a cacheline */
391 }
392
393 wr_ic_cst (IDC_UNALL);
394 wr_ic_cst (IDC_INVALL);
395
396 if (cacheon)
397 wr_ic_cst (IDC_ENABLE);
398 else
399 wr_ic_cst (IDC_DISABLE);
400
401 __asm__ volatile ("isync");
402
403 return lines << 4;
404};
405
406/* ------------------------------------------------------------------------- */
407/* L1 d-cache */
408/* the standard 860 has 128 sets of 16 bytes in 2 ways (= 4 kB) */
409/* the 860 P (plus) has 256 sets of 16 bytes in 2 ways (= 8 kB) */
410/* call with cache disabled */
411
412int checkdcache (void)
413{
414 volatile immap_t *immap = (immap_t *) CFG_IMMR;
415 volatile memctl8xx_t *memctl = &immap->im_memctl;
416 u32 cacheon = rd_dc_cst () & IDC_ENABLED;
417
wdenk2535d602003-07-17 23:16:40 +0000418#ifdef CONFIG_IP86x
wdenkc6097192002-11-03 00:24:07 +0000419 u32 k = memctl->memc_br1 & ~0x00007fff; /* probe in flash memoryarea */
420#else
421 u32 k = memctl->memc_br0 & ~0x00007fff; /* probe in flash memoryarea */
422#endif
423 u32 m;
424 u32 lines = -1;
425
426 wr_dc_cst (IDC_UNALL);
427 wr_dc_cst (IDC_INVALL);
428 wr_dc_cst (IDC_DISABLE);
429
430 while (!((m = rd_dc_cst ()) & IDC_CERR2)) {
431 wr_dc_adr (k);
432 wr_dc_cst (IDC_LDLCK);
433 lines++;
434 k += 0x10; /* the number of bytes in a cacheline */
435 }
436
437 wr_dc_cst (IDC_UNALL);
438 wr_dc_cst (IDC_INVALL);
439
440 if (cacheon)
441 wr_dc_cst (IDC_ENABLE);
442 else
443 wr_dc_cst (IDC_DISABLE);
444
445 return lines << 4;
446};
447
448/* ------------------------------------------------------------------------- */
449
450void upmconfig (uint upm, uint * table, uint size)
451{
452 uint i;
453 uint addr = 0;
454 volatile immap_t *immap = (immap_t *) CFG_IMMR;
455 volatile memctl8xx_t *memctl = &immap->im_memctl;
456
457 for (i = 0; i < size; i++) {
458 memctl->memc_mdr = table[i]; /* (16-15) */
459 memctl->memc_mcr = addr | upm; /* (16-16) */
460 addr++;
461 }
462}
463
464/* ------------------------------------------------------------------------- */
465
wdenked16fef2005-05-09 10:17:32 +0000466#ifndef CONFIG_LWMON
467
wdenk8bde7f72003-06-27 21:31:46 +0000468int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
wdenkc6097192002-11-03 00:24:07 +0000469{
470 ulong msr, addr;
471
472 volatile immap_t *immap = (immap_t *) CFG_IMMR;
473
474 immap->im_clkrst.car_plprcr |= PLPRCR_CSR; /* Checkstop Reset enable */
475
476 /* Interrupts and MMU off */
477 __asm__ volatile ("mtspr 81, 0");
478 __asm__ volatile ("mfmsr %0":"=r" (msr));
479
480 msr &= ~0x1030;
481 __asm__ volatile ("mtmsr %0"::"r" (msr));
482
483 /*
484 * Trying to execute the next instruction at a non-existing address
485 * should cause a machine check, resulting in reset
486 */
487#ifdef CFG_RESET_ADDRESS
488 addr = CFG_RESET_ADDRESS;
489#else
490 /*
491 * note: when CFG_MONITOR_BASE points to a RAM address, CFG_MONITOR_BASE
492 * - sizeof (ulong) is usually a valid address. Better pick an address
493 * known to be invalid on your system and assign it to CFG_RESET_ADDRESS.
494 * "(ulong)-1" used to be a good choice for many systems...
495 */
496 addr = CFG_MONITOR_BASE - sizeof (ulong);
497#endif
498 ((void (*)(void)) addr) ();
499 return 1;
500}
501
wdenked16fef2005-05-09 10:17:32 +0000502#else /* CONFIG_LWMON */
503
504/*
505 * On the LWMON board, the MCLR reset input of the PIC's on the board
506 * uses a 47K/1n RC combination which has a 47us time constant. The
507 * low signal on the HRESET pin of the CPU is only 512 clocks = 8 us
508 * and thus too short to reset the external hardware. So we use the
509 * watchdog to reset the board.
510 */
511int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
512{
513 /* prevent triggering the watchdog */
514 disable_interrupts ();
515
516 /* make sure the watchdog is running */
517 reset_8xx_watchdog ((immap_t *) CFG_IMMR);
518
519 /* wait for watchdog reset */
520 while (1) {};
521
522 /* NOTREACHED */
523 return 1;
524}
525
526#endif /* CONFIG_LWMON */
527
wdenkc6097192002-11-03 00:24:07 +0000528/* ------------------------------------------------------------------------- */
529
530/*
531 * Get timebase clock frequency (like cpu_clk in Hz)
532 *
wdenk180d3f72004-01-04 16:28:35 +0000533 * See sections 14.2 and 14.6 of the User's Manual
wdenkc6097192002-11-03 00:24:07 +0000534 */
535unsigned long get_tbclk (void)
536{
537 DECLARE_GLOBAL_DATA_PTR;
538
wdenk180d3f72004-01-04 16:28:35 +0000539 uint immr = get_immr (0); /* Return full IMMR contents */
540 volatile immap_t *immap = (volatile immap_t *)(immr & 0xFFFF0000);
541 ulong oscclk, factor, pll;
wdenkc6097192002-11-03 00:24:07 +0000542
wdenk180d3f72004-01-04 16:28:35 +0000543 if (immap->im_clkrst.car_sccr & SCCR_TBS) {
wdenkc6097192002-11-03 00:24:07 +0000544 return (gd->cpu_clk / 16);
545 }
546
wdenk180d3f72004-01-04 16:28:35 +0000547 pll = immap->im_clkrst.car_plprcr;
548
549#define PLPRCR_val(a) ((pll & PLPRCR_ ## a ## _MSK) >> PLPRCR_ ## a ## _SHIFT)
550
551 /*
552 * For newer PQ1 chips (MPC866/87x/88x families), PLL multiplication
553 * factor is calculated as follows:
554 *
555 * MFN
556 * MFI + -------
557 * MFD + 1
558 * factor = -----------------
559 * (PDF + 1) * 2^S
560 *
561 * For older chips, it's just MF field of PLPRCR plus one.
562 */
wdenkb0aef112004-01-18 18:21:54 +0000563 if ((immr & 0x0FFF) >= MPC8xx_NEW_CLK) { /* MPC866/87x/88x series */
wdenk180d3f72004-01-04 16:28:35 +0000564 factor = (PLPRCR_val(MFI) + PLPRCR_val(MFN)/(PLPRCR_val(MFD)+1))/
565 (PLPRCR_val(PDF)+1) / (1<<PLPRCR_val(S));
566 } else {
567 factor = PLPRCR_val(MF)+1;
568 }
wdenkc6097192002-11-03 00:24:07 +0000569
570 oscclk = gd->cpu_clk / factor;
571
wdenk180d3f72004-01-04 16:28:35 +0000572 if ((immap->im_clkrst.car_sccr & SCCR_RTSEL) == 0 || factor > 2) {
wdenkc6097192002-11-03 00:24:07 +0000573 return (oscclk / 4);
574 }
575 return (oscclk / 16);
576}
577
578/* ------------------------------------------------------------------------- */
579
580#if defined(CONFIG_WATCHDOG)
581void watchdog_reset (void)
582{
583 int re_enable = disable_interrupts ();
584
585 reset_8xx_watchdog ((immap_t *) CFG_IMMR);
586 if (re_enable)
587 enable_interrupts ();
588}
wdenked16fef2005-05-09 10:17:32 +0000589#endif /* CONFIG_WATCHDOG */
590
591#if defined(CONFIG_WATCHDOG) || defined(CONFIG_LWMON)
wdenkc6097192002-11-03 00:24:07 +0000592
593void reset_8xx_watchdog (volatile immap_t * immr)
594{
595# if defined(CONFIG_LWMON)
596 /*
597 * The LWMON board uses a MAX6301 Watchdog
598 * with the trigger pin connected to port PA.7
599 *
600 * (The old board version used a MAX706TESA Watchdog, which
601 * had to be handled exactly the same.)
602 */
603# define WATCHDOG_BIT 0x0100
604 immr->im_ioport.iop_papar &= ~(WATCHDOG_BIT); /* GPIO */
605 immr->im_ioport.iop_padir |= WATCHDOG_BIT; /* Output */
606 immr->im_ioport.iop_paodr &= ~(WATCHDOG_BIT); /* active output */
607
608 immr->im_ioport.iop_padat ^= WATCHDOG_BIT; /* Toggle WDI */
wdenk02b11f82004-05-12 22:54:36 +0000609# elif defined(CONFIG_KUP4K) || defined(CONFIG_KUP4X)
610 /*
611 * The KUP4 boards uses a TPS3705 Watchdog
612 * with the trigger pin connected to port PA.5
613 */
614# define WATCHDOG_BIT 0x0400
615 immr->im_ioport.iop_papar &= ~(WATCHDOG_BIT); /* GPIO */
616 immr->im_ioport.iop_padir |= WATCHDOG_BIT; /* Output */
617 immr->im_ioport.iop_paodr &= ~(WATCHDOG_BIT); /* active output */
618
619 immr->im_ioport.iop_padat ^= WATCHDOG_BIT; /* Toggle WDI */
wdenkc6097192002-11-03 00:24:07 +0000620# else
621 /*
622 * All other boards use the MPC8xx Internal Watchdog
623 */
624 immr->im_siu_conf.sc_swsr = 0x556c; /* write magic1 */
625 immr->im_siu_conf.sc_swsr = 0xaa39; /* write magic2 */
626# endif /* CONFIG_LWMON */
627}
628
629#endif /* CONFIG_WATCHDOG */
630
631/* ------------------------------------------------------------------------- */