Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 77402
b: refs/heads/master
c: 444ad82
h: refs/heads/master
v: v3
  • Loading branch information
Michael Hennerich authored and Bryan Wu committed Jan 22, 2008
1 parent cda47f3 commit 64637f0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a628a8bcd8a6daea6096fe781fc36cae4ac1ed48
refs/heads/master: 444ad82bc3eaa554be40d22dc248e58aeefd54d9
15 changes: 12 additions & 3 deletions trunk/arch/blackfin/kernel/reboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
#define SYSCR_VAL 0x10
#endif

/*
* Delay min 5 SCLK cycles using worst case CCLK/SCLK ratio (15)
*/
#define SWRST_DELAY (5 * 15)

/* A system soft reset makes external memory unusable
* so force this function into L1.
*/
Expand All @@ -34,11 +39,15 @@ void bfin_reset(void)
while (1) {
/* initiate system soft reset with magic 0x7 */
bfin_write_SWRST(0x7);
bfin_read_SWRST();
asm("ssync;");

/* Wait for System reset to actually reset, needs to be 5 SCLKs, */
/* Assume CCLK / SCLK ratio is worst case (15), and use 5*15 */

asm("LSETUP(.Lfoo,.Lfoo) LC0 = %0\n .Lfoo: NOP;\n"
: : "a" (SWRST_DELAY) : "LC0", "LT0", "LB0");

/* clear system soft reset */
bfin_write_SWRST(0);
bfin_read_SWRST();
asm("ssync;");
/* issue core reset */
asm("raise 1");
Expand Down

0 comments on commit 64637f0

Please sign in to comment.