aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf561/head.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/blackfin/mach-bf561/head.S')
-rw-r--r--arch/blackfin/mach-bf561/head.S79
1 files changed, 18 insertions, 61 deletions
diff --git a/arch/blackfin/mach-bf561/head.S b/arch/blackfin/mach-bf561/head.S
index 7bca478526b9..ad9187a866a5 100644
--- a/arch/blackfin/mach-bf561/head.S
+++ b/arch/blackfin/mach-bf561/head.S
@@ -127,7 +127,8 @@ ENTRY(__stext)
127 STI R2; 127 STI R2;
128#endif 128#endif
129 129
130 /* Initialise UART*/ 130 /* Initialise UART - when booting from u-boot, the UART is not disabled
131 * so if we dont initalize here, our serial console gets hosed */
131 p0.h = hi(UART_LCR); 132 p0.h = hi(UART_LCR);
132 p0.l = lo(UART_LCR); 133 p0.l = lo(UART_LCR);
133 r0 = 0x0(Z); 134 r0 = 0x0(Z);
@@ -414,12 +415,6 @@ ENTRY(_bfin_reset)
414 w[p0] = r0.l; 415 w[p0] = r0.l;
415#endif 416#endif
416 417
417 /* Clear the bits 13-15 in SWRST if they werent cleared */
418 p0.h = hi(SICA_SWRST);
419 p0.l = lo(SICA_SWRST);
420 csync;
421 r0.l = w[p0];
422
423 /* Clear the IMASK register */ 418 /* Clear the IMASK register */
424 p0.h = hi(IMASK); 419 p0.h = hi(IMASK);
425 p0.l = lo(IMASK); 420 p0.l = lo(IMASK);
@@ -433,68 +428,30 @@ ENTRY(_bfin_reset)
433 [p0] = r0; 428 [p0] = r0;
434 SSYNC; 429 SSYNC;
435 430
436 /* Disable the WDOG TIMER */ 431 /* make sure SYSCR is set to use BMODE */
437 p0.h = hi(WDOGA_CTL); 432 P0.h = hi(SICA_SYSCR);
438 p0.l = lo(WDOGA_CTL); 433 P0.l = lo(SICA_SYSCR);
439 r0.l = 0xAD6; 434 R0.l = 0x20;
440 w[p0] = r0.l; 435 W[P0] = R0.l;
441 SSYNC;
442
443 /* Clear the sticky bit incase it is already set */
444 p0.h = hi(WDOGA_CTL);
445 p0.l = lo(WDOGA_CTL);
446 r0.l = 0x8AD6;
447 w[p0] = r0.l;
448 SSYNC; 436 SSYNC;
449 437
450 /* Program the count value */ 438 /* issue a system soft reset */
451 R0.l = 0x100; 439 P1.h = hi(SICA_SWRST);
452 R0.h = 0x0; 440 P1.l = lo(SICA_SWRST);
453 P0.h = hi(WDOGA_CNT); 441 R1.l = 0x0007;
454 P0.l = lo(WDOGA_CNT); 442 W[P1] = R1;
455 [P0] = R0;
456 SSYNC; 443 SSYNC;
457 444
458 /* Program WDOG_STAT if necessary */ 445 /* clear system soft reset */
459 P0.h = hi(WDOGA_CTL); 446 R0.l = 0x0000;
460 P0.l = lo(WDOGA_CTL); 447 W[P0] = R0;
461 R0 = W[P0](Z);
462 CC = BITTST(R0,1);
463 if !CC JUMP .LWRITESTAT;
464 CC = BITTST(R0,2);
465 if !CC JUMP .LWRITESTAT;
466 JUMP .LSKIP_WRITE;
467
468.LWRITESTAT:
469 /* When watch dog timer is enabled,
470 * a write to STAT will load the contents of CNT to STAT
471 */
472 R0 = 0x0000(z);
473 P0.h = hi(WDOGA_STAT);
474 P0.l = lo(WDOGA_STAT)
475 [P0] = R0;
476 SSYNC;
477
478.LSKIP_WRITE:
479 /* Enable the reset event */
480 P0.h = hi(WDOGA_CTL);
481 P0.l = lo(WDOGA_CTL);
482 R0 = W[P0](Z);
483 BITCLR(R0,1);
484 BITCLR(R0,2);
485 W[P0] = R0.L;
486 SSYNC;
487 NOP;
488
489 /* Enable the wdog counter */
490 R0 = W[P0](Z);
491 BITCLR(R0,4);
492 W[P0] = R0.L;
493 SSYNC; 448 SSYNC;
494 449
495 IDLE; 450 /* issue core reset */
451 raise 1;
496 452
497 RTS; 453 RTS;
454ENDPROC(_bfin_reset)
498 455
499.data 456.data
500 457