diff options
author | Mike Frysinger <michael.frysinger@analog.com> | 2007-05-21 06:09:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-21 12:50:22 -0400 |
commit | ef9256d2831df0896566c3823cd2bdf0e55df984 (patch) | |
tree | 5a04be14dfc6c213f5ed27e7f7bfd71476ad61d1 /arch/blackfin/mach-bf533 | |
parent | c0fc525dcc407a516132fc11af82375319ebdadb (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-bf533')
-rw-r--r-- | arch/blackfin/mach-bf533/head.S | 68 |
1 files changed, 16 insertions, 52 deletions
diff --git a/arch/blackfin/mach-bf533/head.S b/arch/blackfin/mach-bf533/head.S index 7cb8258841d4..1a54ff5f061d 100644 --- a/arch/blackfin/mach-bf533/head.S +++ b/arch/blackfin/mach-bf533/head.S | |||
@@ -481,66 +481,30 @@ ENTRY(_bfin_reset) | |||
481 | [p0] = r0; | 481 | [p0] = r0; |
482 | SSYNC; | 482 | SSYNC; |
483 | 483 | ||
484 | /* Disable the WDOG TIMER */ | 484 | /* make sure SYSCR is set to use BMODE */ |
485 | p0.h = hi(WDOG_CTL); | 485 | P0.h = hi(SYSCR); |
486 | p0.l = lo(WDOG_CTL); | 486 | P0.l = lo(SYSCR); |
487 | r0.l = 0xAD6; | 487 | R0.l = 0x0; |
488 | w[p0] = r0.l; | 488 | W[P0] = R0.l; |
489 | SSYNC; | ||
490 | |||
491 | /* Clear the sticky bit incase it is already set */ | ||
492 | p0.h = hi(WDOG_CTL); | ||
493 | p0.l = lo(WDOG_CTL); | ||
494 | r0.l = 0x8AD6; | ||
495 | w[p0] = r0.l; | ||
496 | SSYNC; | 489 | SSYNC; |
497 | 490 | ||
498 | /* Program the count value */ | 491 | /* issue a system soft reset */ |
499 | R0.l = 0x100; | 492 | P1.h = hi(SWRST); |
500 | R0.h = 0x0; | 493 | P1.l = lo(SWRST); |
501 | P0.h = hi(WDOG_CNT); | 494 | R1.l = 0x0007; |
502 | P0.l = lo(WDOG_CNT); | 495 | W[P1] = R1; |
503 | [P0] = R0; | ||
504 | SSYNC; | 496 | SSYNC; |
505 | 497 | ||
506 | /* Program WDOG_STAT if necessary */ | 498 | /* clear system soft reset */ |
507 | P0.h = hi(WDOG_CTL); | 499 | R0.l = 0x0000; |
508 | P0.l = lo(WDOG_CTL); | 500 | W[P0] = R0; |
509 | R0 = W[P0](Z); | ||
510 | CC = BITTST(R0,1); | ||
511 | if !CC JUMP .LWRITESTAT; | ||
512 | CC = BITTST(R0,2); | ||
513 | if !CC JUMP .LWRITESTAT; | ||
514 | JUMP .LSKIP_WRITE; | ||
515 | |||
516 | .LWRITESTAT: | ||
517 | /* When watch dog timer is enabled, a write to STAT will load the contents of CNT to STAT */ | ||
518 | R0 = 0x0000(z); | ||
519 | P0.h = hi(WDOG_STAT); | ||
520 | P0.l = lo(WDOG_STAT) | ||
521 | [P0] = R0; | ||
522 | SSYNC; | ||
523 | |||
524 | .LSKIP_WRITE: | ||
525 | /* Enable the reset event */ | ||
526 | P0.h = hi(WDOG_CTL); | ||
527 | P0.l = lo(WDOG_CTL); | ||
528 | R0 = W[P0](Z); | ||
529 | BITCLR(R0,1); | ||
530 | BITCLR(R0,2); | ||
531 | W[P0] = R0.L; | ||
532 | SSYNC; | ||
533 | NOP; | ||
534 | |||
535 | /* Enable the wdog counter */ | ||
536 | R0 = W[P0](Z); | ||
537 | BITCLR(R0,4); | ||
538 | W[P0] = R0.L; | ||
539 | SSYNC; | 501 | SSYNC; |
540 | 502 | ||
541 | IDLE; | 503 | /* issue core reset */ |
504 | raise 1; | ||
542 | 505 | ||
543 | RTS; | 506 | RTS; |
507 | ENDPROC(_bfin_reset) | ||
544 | 508 | ||
545 | #if CONFIG_DEBUG_KERNEL_START | 509 | #if CONFIG_DEBUG_KERNEL_START |
546 | debug_kernel_start_trap: | 510 | debug_kernel_start_trap: |