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>
This commit is contained in:
parent
c0fc525dcc
commit
ef9256d283
@ -481,66 +481,30 @@ ENTRY(_bfin_reset)
|
|||||||
[p0] = r0;
|
[p0] = r0;
|
||||||
SSYNC;
|
SSYNC;
|
||||||
|
|
||||||
/* Disable the WDOG TIMER */
|
/* make sure SYSCR is set to use BMODE */
|
||||||
p0.h = hi(WDOG_CTL);
|
P0.h = hi(SYSCR);
|
||||||
p0.l = lo(WDOG_CTL);
|
P0.l = lo(SYSCR);
|
||||||
r0.l = 0xAD6;
|
R0.l = 0x0;
|
||||||
w[p0] = r0.l;
|
W[P0] = R0.l;
|
||||||
SSYNC;
|
SSYNC;
|
||||||
|
|
||||||
/* Clear the sticky bit incase it is already set */
|
/* issue a system soft reset */
|
||||||
p0.h = hi(WDOG_CTL);
|
P1.h = hi(SWRST);
|
||||||
p0.l = lo(WDOG_CTL);
|
P1.l = lo(SWRST);
|
||||||
r0.l = 0x8AD6;
|
R1.l = 0x0007;
|
||||||
w[p0] = r0.l;
|
W[P1] = R1;
|
||||||
SSYNC;
|
SSYNC;
|
||||||
|
|
||||||
/* Program the count value */
|
/* clear system soft reset */
|
||||||
R0.l = 0x100;
|
R0.l = 0x0000;
|
||||||
R0.h = 0x0;
|
W[P0] = R0;
|
||||||
P0.h = hi(WDOG_CNT);
|
|
||||||
P0.l = lo(WDOG_CNT);
|
|
||||||
[P0] = R0;
|
|
||||||
SSYNC;
|
SSYNC;
|
||||||
|
|
||||||
/* Program WDOG_STAT if necessary */
|
/* issue core reset */
|
||||||
P0.h = hi(WDOG_CTL);
|
raise 1;
|
||||||
P0.l = lo(WDOG_CTL);
|
|
||||||
R0 = W[P0](Z);
|
|
||||||
CC = BITTST(R0,1);
|
|
||||||
if !CC JUMP .LWRITESTAT;
|
|
||||||
CC = BITTST(R0,2);
|
|
||||||
if !CC JUMP .LWRITESTAT;
|
|
||||||
JUMP .LSKIP_WRITE;
|
|
||||||
|
|
||||||
.LWRITESTAT:
|
|
||||||
/* When watch dog timer is enabled, a write to STAT will load the contents of CNT to STAT */
|
|
||||||
R0 = 0x0000(z);
|
|
||||||
P0.h = hi(WDOG_STAT);
|
|
||||||
P0.l = lo(WDOG_STAT)
|
|
||||||
[P0] = R0;
|
|
||||||
SSYNC;
|
|
||||||
|
|
||||||
.LSKIP_WRITE:
|
|
||||||
/* Enable the reset event */
|
|
||||||
P0.h = hi(WDOG_CTL);
|
|
||||||
P0.l = lo(WDOG_CTL);
|
|
||||||
R0 = W[P0](Z);
|
|
||||||
BITCLR(R0,1);
|
|
||||||
BITCLR(R0,2);
|
|
||||||
W[P0] = R0.L;
|
|
||||||
SSYNC;
|
|
||||||
NOP;
|
|
||||||
|
|
||||||
/* Enable the wdog counter */
|
|
||||||
R0 = W[P0](Z);
|
|
||||||
BITCLR(R0,4);
|
|
||||||
W[P0] = R0.L;
|
|
||||||
SSYNC;
|
|
||||||
|
|
||||||
IDLE;
|
|
||||||
|
|
||||||
RTS;
|
RTS;
|
||||||
|
ENDPROC(_bfin_reset)
|
||||||
|
|
||||||
#if CONFIG_DEBUG_KERNEL_START
|
#if CONFIG_DEBUG_KERNEL_START
|
||||||
debug_kernel_start_trap:
|
debug_kernel_start_trap:
|
||||||
|
@ -517,68 +517,30 @@ _delay_lab1_end:
|
|||||||
[p0] = r0;
|
[p0] = r0;
|
||||||
SSYNC;
|
SSYNC;
|
||||||
|
|
||||||
/* Disable the WDOG TIMER */
|
/* make sure SYSCR is set to use BMODE */
|
||||||
p0.h = hi(WDOG_CTL);
|
P0.h = hi(SYSCR);
|
||||||
p0.l = lo(WDOG_CTL);
|
P0.l = lo(SYSCR);
|
||||||
r0.l = 0xAD6;
|
R0.l = 0x0;
|
||||||
w[p0] = r0.l;
|
W[P0] = R0.l;
|
||||||
SSYNC;
|
SSYNC;
|
||||||
|
|
||||||
/* Clear the sticky bit incase it is already set */
|
/* issue a system soft reset */
|
||||||
p0.h = hi(WDOG_CTL);
|
P1.h = hi(SWRST);
|
||||||
p0.l = lo(WDOG_CTL);
|
P1.l = lo(SWRST);
|
||||||
r0.l = 0x8AD6;
|
R1.l = 0x0007;
|
||||||
w[p0] = r0.l;
|
W[P1] = R1;
|
||||||
SSYNC;
|
SSYNC;
|
||||||
|
|
||||||
/* Program the count value */
|
/* clear system soft reset */
|
||||||
R0.l = 0x100;
|
R0.l = 0x0000;
|
||||||
R0.h = 0x0;
|
W[P0] = R0;
|
||||||
P0.h = hi(WDOG_CNT);
|
|
||||||
P0.l = lo(WDOG_CNT);
|
|
||||||
[P0] = R0;
|
|
||||||
SSYNC;
|
SSYNC;
|
||||||
|
|
||||||
/* Program WDOG_STAT if necessary */
|
/* issue core reset */
|
||||||
P0.h = hi(WDOG_CTL);
|
raise 1;
|
||||||
P0.l = lo(WDOG_CTL);
|
|
||||||
R0 = W[P0](Z);
|
|
||||||
CC = BITTST(R0,1);
|
|
||||||
if !CC JUMP .LWRITESTAT;
|
|
||||||
CC = BITTST(R0,2);
|
|
||||||
if !CC JUMP .LWRITESTAT;
|
|
||||||
JUMP .LSKIP_WRITE;
|
|
||||||
|
|
||||||
.LWRITESTAT:
|
|
||||||
/* When watch dog timer is enabled,
|
|
||||||
* a write to STAT will load the contents of CNT to STAT
|
|
||||||
*/
|
|
||||||
R0 = 0x0000(z);
|
|
||||||
P0.h = hi(WDOG_STAT);
|
|
||||||
P0.l = lo(WDOG_STAT)
|
|
||||||
[P0] = R0;
|
|
||||||
SSYNC;
|
|
||||||
|
|
||||||
.LSKIP_WRITE:
|
|
||||||
/* Enable the reset event */
|
|
||||||
P0.h = hi(WDOG_CTL);
|
|
||||||
P0.l = lo(WDOG_CTL);
|
|
||||||
R0 = W[P0](Z);
|
|
||||||
BITCLR(R0,1);
|
|
||||||
BITCLR(R0,2);
|
|
||||||
W[P0] = R0.L;
|
|
||||||
SSYNC;
|
|
||||||
NOP;
|
|
||||||
|
|
||||||
/* Enable the wdog counter */
|
|
||||||
R0 = W[P0](Z);
|
|
||||||
BITCLR(R0,4);
|
|
||||||
W[P0] = R0.L;
|
|
||||||
SSYNC;
|
|
||||||
|
|
||||||
IDLE;
|
|
||||||
|
|
||||||
RTS;
|
RTS;
|
||||||
|
ENDPROC(_bfin_reset)
|
||||||
|
|
||||||
.data
|
.data
|
||||||
|
|
||||||
|
@ -427,68 +427,30 @@ ENTRY(_bfin_reset)
|
|||||||
[p0] = r0;
|
[p0] = r0;
|
||||||
SSYNC;
|
SSYNC;
|
||||||
|
|
||||||
/* Disable the WDOG TIMER */
|
/* make sure SYSCR is set to use BMODE */
|
||||||
p0.h = hi(WDOGA_CTL);
|
P0.h = hi(SICA_SYSCR);
|
||||||
p0.l = lo(WDOGA_CTL);
|
P0.l = lo(SICA_SYSCR);
|
||||||
r0.l = 0xAD6;
|
R0.l = 0x0;
|
||||||
w[p0] = r0.l;
|
W[P0] = R0.l;
|
||||||
SSYNC;
|
SSYNC;
|
||||||
|
|
||||||
/* Clear the sticky bit incase it is already set */
|
/* issue a system soft reset */
|
||||||
p0.h = hi(WDOGA_CTL);
|
P1.h = hi(SICA_SWRST);
|
||||||
p0.l = lo(WDOGA_CTL);
|
P1.l = lo(SICA_SWRST);
|
||||||
r0.l = 0x8AD6;
|
R1.l = 0x0007;
|
||||||
w[p0] = r0.l;
|
W[P1] = R1;
|
||||||
SSYNC;
|
SSYNC;
|
||||||
|
|
||||||
/* Program the count value */
|
/* clear system soft reset */
|
||||||
R0.l = 0x100;
|
R0.l = 0x0000;
|
||||||
R0.h = 0x0;
|
W[P0] = R0;
|
||||||
P0.h = hi(WDOGA_CNT);
|
|
||||||
P0.l = lo(WDOGA_CNT);
|
|
||||||
[P0] = R0;
|
|
||||||
SSYNC;
|
SSYNC;
|
||||||
|
|
||||||
/* Program WDOG_STAT if necessary */
|
/* issue core reset */
|
||||||
P0.h = hi(WDOGA_CTL);
|
raise 1;
|
||||||
P0.l = lo(WDOGA_CTL);
|
|
||||||
R0 = W[P0](Z);
|
|
||||||
CC = BITTST(R0,1);
|
|
||||||
if !CC JUMP .LWRITESTAT;
|
|
||||||
CC = BITTST(R0,2);
|
|
||||||
if !CC JUMP .LWRITESTAT;
|
|
||||||
JUMP .LSKIP_WRITE;
|
|
||||||
|
|
||||||
.LWRITESTAT:
|
|
||||||
/* When watch dog timer is enabled,
|
|
||||||
* a write to STAT will load the contents of CNT to STAT
|
|
||||||
*/
|
|
||||||
R0 = 0x0000(z);
|
|
||||||
P0.h = hi(WDOGA_STAT);
|
|
||||||
P0.l = lo(WDOGA_STAT)
|
|
||||||
[P0] = R0;
|
|
||||||
SSYNC;
|
|
||||||
|
|
||||||
.LSKIP_WRITE:
|
|
||||||
/* Enable the reset event */
|
|
||||||
P0.h = hi(WDOGA_CTL);
|
|
||||||
P0.l = lo(WDOGA_CTL);
|
|
||||||
R0 = W[P0](Z);
|
|
||||||
BITCLR(R0,1);
|
|
||||||
BITCLR(R0,2);
|
|
||||||
W[P0] = R0.L;
|
|
||||||
SSYNC;
|
|
||||||
NOP;
|
|
||||||
|
|
||||||
/* Enable the wdog counter */
|
|
||||||
R0 = W[P0](Z);
|
|
||||||
BITCLR(R0,4);
|
|
||||||
W[P0] = R0.L;
|
|
||||||
SSYNC;
|
|
||||||
|
|
||||||
IDLE;
|
|
||||||
|
|
||||||
RTS;
|
RTS;
|
||||||
|
ENDPROC(_bfin_reset)
|
||||||
|
|
||||||
.data
|
.data
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user