~ubuntu-branches/ubuntu/maverick/uboot-imx/maverick

« back to all changes in this revision

Viewing changes to cpu/blackfin/reset.c

  • Committer: Bazaar Package Importer
  • Author(s): Oliver Grawert
  • Date: 2010-01-20 15:41:26 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100120154126-7bha1jeyjegu7xm5
Tags: 2009.08+really2009.01-0ubuntu1
* revert to the 2009.01 upstream version, 2009.08 has still to 
  many work in progress items in the freescale patchset (MMC and NIC
  dont work at all)
* add the latest patchset from freescale for 2009.01
* add 1002_enable_hush_shell_and_ext2.patch to enable hush shell and ext2 
* add 1003_fix_board_revision_numbers to make sure babbage 2.5 boards have 
  revision 51120 and babbage 3.0 boards have revision 51130 properly set in 
  their cpuinfo

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 * the core reset.
21
21
 */
22
22
__attribute__ ((__l1_text__, __noreturn__))
23
 
static void bfin_reset(void)
 
23
void bfin_reset(void)
24
24
{
25
25
        /* Wait for completion of "system" events such as cache line
26
26
         * line fills so that we avoid infinite stalls later on as
29
29
         */
30
30
        __builtin_bfin_ssync();
31
31
 
32
 
        /* The bootrom checks to see how it was reset and will
33
 
         * automatically perform a software reset for us when
34
 
         * it starts executing after the core reset.
35
 
         */
36
 
        if (ANOMALY_05000353 || ANOMALY_05000386) {
 
32
        while (1) {
37
33
                /* Initiate System software reset. */
38
34
                bfin_write_SWRST(0x7);
39
35
 
40
36
                /* Due to the way reset is handled in the hardware, we need
41
 
                 * to delay for 10 SCLKS.  The only reliable way to do this is
42
 
                 * to calculate the CCLK/SCLK ratio and multiply 10.  For now,
 
37
                 * to delay for 7 SCLKS.  The only reliable way to do this is
 
38
                 * to calculate the CCLK/SCLK ratio and multiply 7.  For now,
43
39
                 * we'll assume worse case which is a 1:15 ratio.
44
40
                 */
45
41
                asm(
46
42
                        "LSETUP (1f, 1f) LC0 = %0\n"
47
43
                        "1: nop;"
48
44
                        :
49
 
                        : "a" (15 * 10)
 
45
                        : "a" (15 * 7)
50
46
                        : "LC0", "LB0", "LT0"
51
47
                );
52
48
 
53
49
                /* Clear System software reset */
54
50
                bfin_write_SWRST(0);
55
51
 
56
 
                /* The BF526 ROM will crash during reset */
57
 
#if defined(__ADSPBF522__) || defined(__ADSPBF524__) || defined(__ADSPBF526__)
58
 
                bfin_read_SWRST();
59
 
#endif
60
 
 
61
52
                /* Wait for the SWRST write to complete.  Cannot rely on SSYNC
62
53
                 * though as the System state is all reset now.
63
54
                 */
68
59
                        : "a" (15 * 1)
69
60
                        : "LC1", "LB1", "LT1"
70
61
                );
71
 
        }
72
62
 
73
 
        while (1)
74
63
                /* Issue core reset */
75
64
                asm("raise 1");
 
65
        }
76
66
}
77
67
 
78
68
/* We need to trampoline ourselves up into L1 since our linker