~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to arch/blackfin/kernel/reboot.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

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