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

« back to all changes in this revision

Viewing changes to board/esd/dp405/dp405.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:
23
23
 
24
24
#include <common.h>
25
25
#include <asm/processor.h>
26
 
#include <asm/io.h>
27
26
#include <command.h>
28
27
#include <malloc.h>
29
28
 
30
29
DECLARE_GLOBAL_DATA_PTR;
31
30
 
 
31
/* fpga configuration data - not compressed, generated by bin2c */
 
32
const unsigned char fpgadata[] =
 
33
{
 
34
#include "fpgadata.c"
 
35
};
 
36
int filesize = sizeof(fpgadata);
 
37
 
 
38
 
32
39
int board_early_init_f (void)
33
40
{
34
41
        /*
59
66
        /*
60
67
         * Reset CPLD via GPIO13 (CS4) pin
61
68
         */
62
 
        out_be32((void *)GPIO0_OR,
63
 
                 in_be32((void *)GPIO0_OR) & ~(0x80000000 >> 13));
 
69
        out32(GPIO0_OR, in32(GPIO0_OR) & ~(0x80000000 >> 13));
64
70
        udelay(1000); /* wait 1ms */
65
 
        out_be32((void *)GPIO0_OR,
66
 
                 in_be32((void *)GPIO0_OR) | (0x80000000 >> 13));
 
71
        out32(GPIO0_OR, in32(GPIO0_OR) | (0x80000000 >> 13));
67
72
        udelay(1000); /* wait 1ms */
68
73
 
69
74
        return 0;
89
94
        int i = getenv_r ("serial#", str, sizeof(str));
90
95
        unsigned char trans[16] = {0x0,0x8,0x4,0xc,0x2,0xa,0x6,0xe,
91
96
                                   0x1,0x9,0x5,0xd,0x3,0xb,0x7,0xf};
92
 
        unsigned char id1, id2, rev;
 
97
        unsigned char id1, id2;
93
98
 
94
99
        puts ("Board: ");
95
100
 
96
 
        if (i == -1)
 
101
        if (i == -1) {
97
102
                puts ("### No HW ID - assuming DP405");
98
 
        else
 
103
        } else {
99
104
                puts(str);
100
 
 
101
 
        id1 = trans[(~(in_be32((void *)GPIO0_IR) >> 5)) & 0x0000000f];
102
 
        id2 = trans[(~(in_be32((void *)GPIO0_IR) >> 9)) & 0x0000000f];
103
 
 
104
 
        rev = in_8((void *)0xf0001000);
105
 
        if (rev & 0x10) /* old DP405 compatibility */
106
 
                rev = in_8((void *)0xf0000800);
107
 
 
108
 
        switch (rev & 0xc0) {
109
 
        case 0x00:
110
 
                puts(" (HW=DP405");
111
 
                break;
112
 
        case 0x80:
113
 
                puts(" (HW=DP405/CO");
114
 
                break;
115
 
        case 0xc0:
116
 
                puts(" (HW=DN405");
117
 
                break;
118
 
        }
119
 
        printf(", ID=0x%1X%1X, PLD=0x%02X", id2, id1, rev & 0x0f);
120
 
 
121
 
        if ((rev & 0xc0) == 0xc0) {
122
 
                printf(", C5V=%s",
123
 
                       in_be32((void *)GPIO0_IR) & 0x40000000 ? "off" : "on");
124
 
        }
125
 
        puts(")\n");
 
105
        }
 
106
 
 
107
        id1 = trans[(~(in32(GPIO0_IR) >> 5)) & 0x0000000f];
 
108
        id2 = trans[(~(in32(GPIO0_IR) >> 9)) & 0x0000000f];
 
109
        printf(" (ID=0x%1X%1X, PLD=0x%02X)\n", id2, id1, in8(0xf0001000));
126
110
 
127
111
        return 0;
128
112
}