]>
git.ipfire.org Git - u-boot.git/blob - board/esd/du405/du405.c
2 * (C) Copyright 2000, 2001
3 * Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.com
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26 #include <asm/processor.h>
28 #include <405gp_i2c.h>
33 extern int do_reset (cmd_tbl_t
*cmdtp
, int flag
, int argc
, char *argv
[]);
35 /* ------------------------------------------------------------------------- */
45 /* fpga configuration data - generated by bin2cc */
46 const unsigned char fpgadata
[] = {
51 * include common fpga code (for esd boards)
53 #include "../common/fpga.c"
56 int board_pre_init (void)
58 DECLARE_GLOBAL_DATA_PTR
;
64 /* set up serial port with default baudrate */
66 gd
->baudrate
= CONFIG_BAUDRATE
;
74 status
= fpga_boot ((unsigned char *) fpgadata
, sizeof (fpgadata
));
76 /* booting FPGA failed */
78 /* set up serial port with default baudrate */
80 gd
->baudrate
= CONFIG_BAUDRATE
;
84 printf ("\nFPGA: Booting failed ");
86 case ERROR_FPGA_PRG_INIT_LOW
:
87 printf ("(Timeout: INIT not low after asserting PROGRAM*)\n ");
89 case ERROR_FPGA_PRG_INIT_HIGH
:
90 printf ("(Timeout: INIT not high after deasserting PROGRAM*)\n ");
92 case ERROR_FPGA_PRG_DONE
:
93 printf ("(Timeout: DONE not high after programming FPGA)\n ");
97 /* display infos on fpgaimage */
99 for (i
= 0; i
< 4; i
++) {
100 len
= fpgadata
[index
];
101 printf ("FPGA: %s\n", &(fpgadata
[index
+ 1]));
106 for (i
= 20; i
> 0; i
--) {
107 printf ("Rebooting in %2d seconds \r", i
);
108 for (index
= 0; index
< 1000; index
++)
112 do_reset (NULL
, 0, 0, NULL
);
116 * IRQ 0-15 405GP internally generated; active high; level sensitive
117 * IRQ 16 405GP internally generated; active low; level sensitive
119 * IRQ 25 (EXT IRQ 0) CAN0; active low; level sensitive
120 * IRQ 26 (EXT IRQ 1) DUART_A; active high; level sensitive
121 * IRQ 27 (EXT IRQ 2) DUART_B; active high; level sensitive
122 * IRQ 28 (EXT IRQ 3) unused; active low; level sensitive
123 * IRQ 29 (EXT IRQ 4) unused; active low; level sensitive
124 * IRQ 30 (EXT IRQ 5) unused; active low; level sensitive
125 * IRQ 31 (EXT IRQ 6) COMPACT FLASH; active high; level sensitive
127 mtdcr (uicsr
, 0xFFFFFFFF); /* clear all ints */
128 mtdcr (uicer
, 0x00000000); /* disable all ints */
129 mtdcr (uiccr
, 0x00000000); /* set all to be non-critical */
130 mtdcr (uicpr
, 0xFFFFFFB1); /* set int polarities */
131 mtdcr (uictr
, 0x10000000); /* set int trigger levels */
132 mtdcr (uicvcr
, 0x00000001); /* set vect base=0,INT0 highest priority */
133 mtdcr (uicsr
, 0xFFFFFFFF); /* clear all ints */
136 * EBC Configuration Register: set ready timeout to 100 us
138 mtebc (epcr
, 0xb8400000);
144 /* ------------------------------------------------------------------------- */
147 * Check Board Identity:
150 int checkboard (void)
154 unsigned char str
[64];
155 int i
= getenv_r ("serial#", str
, sizeof (str
));
160 puts ("### No HW ID - assuming DU405");
167 /* display infos on fpgaimage */
169 for (i
= 0; i
< 4; i
++) {
170 len
= fpgadata
[index
];
171 printf ("%s ", &(fpgadata
[index
+ 1]));
178 * Reset external DUART via FPGA
180 *(volatile unsigned char *) FPGA_MODE_REG
= 0xff; /* reset high active */
181 *(volatile unsigned char *) FPGA_MODE_REG
= 0x00; /* low again */
186 /* ------------------------------------------------------------------------- */
188 long int initdram (int board_type
)
190 return (16 * 1024 * 1024);
193 /* ------------------------------------------------------------------------- */
197 /* TODO: XXX XXX XXX */
198 printf ("test: 16 MB - ok\n");
203 /* ------------------------------------------------------------------------- */