2 * (C) Copyright 2001-2004
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>
30 extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
31 extern void lxt971_no_sleep(void);
33 /* ------------------------------------------------------------------------- */
39 /* fpga configuration data - generated by bin2cc */
40 const unsigned char fpgadata[] = {
44 const unsigned char fpgadata_xl30[] = {
45 #include "fpgadata_xl30.c"
49 * include common fpga code (for esd boards)
51 #include "../common/fpga.c"
54 int board_early_init_f (void)
56 DECLARE_GLOBAL_DATA_PTR;
62 /* set up serial port with default baudrate */
64 gd->baudrate = CONFIG_BAUDRATE;
72 /* first try 40er image */
74 status = fpga_boot ((unsigned char *) fpgadata, sizeof (fpgadata));
76 /* try xl30er image */
78 status = fpga_boot ((unsigned char *) fpgadata_xl30, sizeof (fpgadata_xl30));
80 /* booting FPGA failed */
82 /* set up serial port with default baudrate */
84 gd->baudrate = CONFIG_BAUDRATE;
88 printf ("\nFPGA: Booting failed ");
90 case ERROR_FPGA_PRG_INIT_LOW:
91 printf ("(Timeout: INIT not low after asserting PROGRAM*)\n ");
93 case ERROR_FPGA_PRG_INIT_HIGH:
94 printf ("(Timeout: INIT not high after deasserting PROGRAM*)\n ");
96 case ERROR_FPGA_PRG_DONE:
97 printf ("(Timeout: DONE not high after programming FPGA)\n ");
101 /* display infos on fpgaimage */
103 for (i = 0; i < 4; i++) {
104 len = fpgadata[index];
105 printf ("FPGA: %s\n", &(fpgadata[index + 1]));
110 for (i = 20; i > 0; i--) {
111 printf ("Rebooting in %2d seconds \r", i);
112 for (index = 0; index < 1000; index++)
116 do_reset (NULL, 0, 0, NULL);
121 * IRQ 0-15 405GP internally generated; active high; level sensitive
122 * IRQ 16 405GP internally generated; active low; level sensitive
124 * IRQ 25 (EXT IRQ 0) CAN0; active low; level sensitive
125 * IRQ 26 (EXT IRQ 1) CAN1; active low; level sensitive
126 * IRQ 27 (EXT IRQ 2) PCI SLOT 0; active low; level sensitive
127 * IRQ 28 (EXT IRQ 3) PCI SLOT 1; active low; level sensitive
128 * IRQ 29 (EXT IRQ 4) PCI SLOT 2; active low; level sensitive
129 * IRQ 30 (EXT IRQ 5) PCI SLOT 3; active low; level sensitive
130 * IRQ 31 (EXT IRQ 6) COMPACT FLASH; active high; level sensitive
132 mtdcr (uicsr, 0xFFFFFFFF); /* clear all ints */
133 mtdcr (uicer, 0x00000000); /* disable all ints */
134 mtdcr (uiccr, 0x00000000); /* set all to be non-critical */
135 mtdcr (uicpr, 0xFFFFFF81); /* set int polarities */
136 mtdcr (uictr, 0x10000000); /* set int trigger levels */
137 mtdcr (uicvcr, 0x00000001); /* set vect base=0,INT0 highest priority */
138 mtdcr (uicsr, 0xFFFFFFFF); /* clear all ints */
140 *(ushort *) 0xf03000ec = 0x0fff; /* enable all interrupts in fpga */
146 /* ------------------------------------------------------------------------- */
149 * Check Board Identity:
152 int checkboard (void)
154 DECLARE_GLOBAL_DATA_PTR;
158 unsigned char str[64];
159 int i = getenv_r ("serial#", str, sizeof (str));
160 const unsigned char *fpga;
165 puts ("### No HW ID - assuming AR405");
172 /* display infos on fpgaimage */
173 if (gd->board_type == 30) {
174 fpga = fpgadata_xl30;
179 for (i = 0; i < 4; i++) {
181 printf ("%s ", &(fpga[index + 1]));
188 * Disable sleep mode in LXT971
195 /* ------------------------------------------------------------------------- */
197 long int initdram (int board_type)
199 return (16 * 1024 * 1024);
202 /* ------------------------------------------------------------------------- */
206 /* TODO: XXX XXX XXX */
207 printf ("test: 16 MB - ok\n");
212 /* ------------------------------------------------------------------------- */