aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf537
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-bf537
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-bf537')
-rw-r--r--arch/blackfin/mach-bf537/head.S70
1 files changed, 16 insertions, 54 deletions
diff --git a/arch/blackfin/mach-bf537/head.S b/arch/blackfin/mach-bf537/head.S
index de78e4281aef..aafc686749ed 100644
--- a/arch/blackfin/mach-bf537/head.S
+++ b/arch/blackfin/mach-bf537/head.S
@@ -517,68 +517,30 @@ _delay_lab1_end:
517 [p0] = r0; 517 [p0] = r0;
518 SSYNC; 518 SSYNC;
519 519
520 /* Disable the WDOG TIMER */ 520 /* make sure SYSCR is set to use BMODE */
521 p0.h = hi(WDOG_CTL); 521 P0.h = hi(SYSCR);
522 p0.l = lo(WDOG_CTL); 522 P0.l = lo(SYSCR);
523 r0.l = 0xAD6; 523 R0.l = 0x0;
524 w[p0] = r0.l; 524 W[P0] = R0.l;
525 SSYNC; 525 SSYNC;
526 526
527 /* Clear the sticky bit incase it is already set */ 527 /* issue a system soft reset */
528 p0.h = hi(WDOG_CTL); 528 P1.h = hi(SWRST);
529 p0.l = lo(WDOG_CTL); 529 P1.l = lo(SWRST);
530 r0.l = 0x8AD6; 530 R1.l = 0x0007;
531 w[p0] = r0.l; 531 W[P1] = R1;
532 SSYNC; 532 SSYNC;
533 533
534 /* Program the count value */ 534 /* clear system soft reset */
535 R0.l = 0x100; 535 R0.l = 0x0000;
536 R0.h = 0x0; 536 W[P0] = R0;
537 P0.h = hi(WDOG_CNT);
538 P0.l = lo(WDOG_CNT);
539 [P0] = R0;
540 SSYNC;
541
542 /* Program WDOG_STAT if necessary */
543 P0.h = hi(WDOG_CTL);
544 P0.l = lo(WDOG_CTL);
545 R0 = W[P0](Z);
546 CC = BITTST(R0,1);
547 if !CC JUMP .LWRITESTAT;
548 CC = BITTST(R0,2);
549 if !CC JUMP .LWRITESTAT;
550 JUMP .LSKIP_WRITE;
551
552.LWRITESTAT:
553 /* When watch dog timer is enabled,
554 * a write to STAT will load the contents of CNT to STAT
555 */
556 R0 = 0x0000(z);
557 P0.h = hi(WDOG_STAT);
558 P0.l = lo(WDOG_STAT)
559 [P0] = R0;
560 SSYNC;
561
562.LSKIP_WRITE:
563 /* Enable the reset event */
564 P0.h = hi(WDOG_CTL);
565 P0.l = lo(WDOG_CTL);
566 R0 = W[P0](Z);
567 BITCLR(R0,1);
568 BITCLR(R0,2);
569 W[P0] = R0.L;
570 SSYNC;
571 NOP;
572
573 /* Enable the wdog counter */
574 R0 = W[P0](Z);
575 BITCLR(R0,4);
576 W[P0] = R0.L;
577 SSYNC; 537 SSYNC;
578 538
579 IDLE; 539 /* issue core reset */
540 raise 1;
580 541
581 RTS; 542 RTS;
543ENDPROC(_bfin_reset)
582 544
583.data 545.data
584 546