aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf561
diff options
context:
space:
mode:
authorMike Frysinger <michael.frysinger@analog.com>2007-05-21 06:09:26 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-21 12:50:22 -0400
commitef9256d2831df0896566c3823cd2bdf0e55df984 (patch)
tree5a04be14dfc6c213f5ed27e7f7bfd71476ad61d1 /arch/blackfin/mach-bf561
parentc0fc525dcc407a516132fc11af82375319ebdadb (diff)
Blackfin arch: issue reset via SWRST so we dont clobber the watchdog state
Signed-off-by: Mike Frysinger <michael.frysinger@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/blackfin/mach-bf561')
-rw-r--r--arch/blackfin/mach-bf561/head.S70
1 files changed, 16 insertions, 54 deletions
diff --git a/arch/blackfin/mach-bf561/head.S b/arch/blackfin/mach-bf561/head.S
index 462c39ed8ec5..04f3ac33ab0e 100644
--- a/arch/blackfin/mach-bf561/head.S
+++ b/arch/blackfin/mach-bf561/head.S
@@ -427,68 +427,30 @@ ENTRY(_bfin_reset)
427 [p0] = r0; 427 [p0] = r0;
428 SSYNC; 428 SSYNC;
429 429
430 /* Disable the WDOG TIMER */ 430 /* make sure SYSCR is set to use BMODE */
431 p0.h = hi(WDOGA_CTL); 431 P0.h = hi(SICA_SYSCR);
432 p0.l = lo(WDOGA_CTL); 432 P0.l = lo(SICA_SYSCR);
433 r0.l = 0xAD6; 433 R0.l = 0x0;
434 w[p0] = r0.l; 434 W[P0] = R0.l;
435 SSYNC; 435 SSYNC;
436 436
437 /* Clear the sticky bit incase it is already set */ 437 /* issue a system soft reset */
438 p0.h = hi(WDOGA_CTL); 438 P1.h = hi(SICA_SWRST);
439 p0.l = lo(WDOGA_CTL); 439 P1.l = lo(SICA_SWRST);
440 r0.l = 0x8AD6; 440 R1.l = 0x0007;
441 w[p0] = r0.l; 441 W[P1] = R1;
442 SSYNC;
443
444 /* Program the count value */
445 R0.l = 0x100;
446 R0.h = 0x0;
447 P0.h = hi(WDOGA_CNT);
448 P0.l = lo(WDOGA_CNT);
449 [P0] = R0;
450 SSYNC; 442 SSYNC;
451 443
452 /* Program WDOG_STAT if necessary */ 444 /* clear system soft reset */
453 P0.h = hi(WDOGA_CTL); 445 R0.l = 0x0000;
454 P0.l = lo(WDOGA_CTL); 446 W[P0] = R0;
455 R0 = W[P0](Z);
456 CC = BITTST(R0,1);
457 if !CC JUMP .LWRITESTAT;
458 CC = BITTST(R0,2);
459 if !CC JUMP .LWRITESTAT;
460 JUMP .LSKIP_WRITE;
461
462.LWRITESTAT:
463 /* When watch dog timer is enabled,
464 * a write to STAT will load the contents of CNT to STAT
465 */
466 R0 = 0x0000(z);
467 P0.h = hi(WDOGA_STAT);
468 P0.l = lo(WDOGA_STAT)
469 [P0] = R0;
470 SSYNC;
471
472.LSKIP_WRITE:
473 /* Enable the reset event */
474 P0.h = hi(WDOGA_CTL);
475 P0.l = lo(WDOGA_CTL);
476 R0 = W[P0](Z);
477 BITCLR(R0,1);
478 BITCLR(R0,2);
479 W[P0] = R0.L;
480 SSYNC;
481 NOP;
482
483 /* Enable the wdog counter */
484 R0 = W[P0](Z);
485 BITCLR(R0,4);
486 W[P0] = R0.L;
487 SSYNC; 447 SSYNC;
488 448
489 IDLE; 449 /* issue core reset */
450 raise 1;
490 451
491 RTS; 452 RTS;
453ENDPROC(_bfin_reset)
492 454
493.data 455.data
494 456