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>
31 /* ------------------------------------------------------------------------- */
37 /* fpga configuration data - generated by bin2cc */
38 const unsigned char fpgadata[] = {
43 * include common fpga code (for esd boards)
45 #include "../common/fpga.c"
48 int board_pre_init (void)
50 DECLARE_GLOBAL_DATA_PTR;
56 /* set up serial port with default baudrate */
58 gd->baudrate = CONFIG_BAUDRATE;
66 status = fpga_boot ((unsigned char *) fpgadata, sizeof (fpgadata));
68 /* booting FPGA failed */
70 /* set up serial port with default baudrate */
72 gd->baudrate = CONFIG_BAUDRATE;
76 printf ("\nFPGA: Booting failed ");
78 case ERROR_FPGA_PRG_INIT_LOW:
79 printf ("(Timeout: INIT not low after asserting PROGRAM*)\n ");
81 case ERROR_FPGA_PRG_INIT_HIGH:
82 printf ("(Timeout: INIT not high after deasserting PROGRAM*)\n ");
84 case ERROR_FPGA_PRG_DONE:
85 printf ("(Timeout: DONE not high after programming FPGA)\n ");
89 /* display infos on fpgaimage */
91 for (i = 0; i < 4; i++) {
92 len = fpgadata[index];
93 printf ("FPGA: %s\n", &(fpgadata[index + 1]));
98 for (i = 20; i > 0; i--) {
99 printf ("Rebooting in %2d seconds \r", i);
100 for (index = 0; index < 1000; index++)
104 do_reset (NULL, 0, 0, NULL);
108 * IRQ 0-15 405GP internally generated; active high; level sensitive
109 * IRQ 16 405GP internally generated; active low; level sensitive
111 * IRQ 25 (EXT IRQ 0) CAN0; active low; level sensitive
112 * IRQ 26 (EXT IRQ 1) CAN1; active low; level sensitive
113 * IRQ 27 (EXT IRQ 2) PCI SLOT 0; active low; level sensitive
114 * IRQ 28 (EXT IRQ 3) PCI SLOT 1; active low; level sensitive
115 * IRQ 29 (EXT IRQ 4) PCI SLOT 2; active low; level sensitive
116 * IRQ 30 (EXT IRQ 5) PCI SLOT 3; active low; level sensitive
117 * IRQ 31 (EXT IRQ 6) COMPACT FLASH; active high; level sensitive
119 mtdcr (uicsr, 0xFFFFFFFF); /* clear all ints */
120 mtdcr (uicer, 0x00000000); /* disable all ints */
121 mtdcr (uiccr, 0x00000000); /* set all to be non-critical */
122 mtdcr (uicpr, 0xFFFFFF81); /* set int polarities */
123 mtdcr (uictr, 0x10000000); /* set int trigger levels */
124 mtdcr (uicvcr, 0x00000001); /* set vect base=0,INT0 highest priority */
125 mtdcr (uicsr, 0xFFFFFFFF); /* clear all ints */
127 *(ushort *) 0xf03000ec = 0x0fff; /* enable all interrupts in fpga */
133 /* ------------------------------------------------------------------------- */
136 * Check Board Identity:
139 int checkboard (void)
143 unsigned char str[64];
144 int i = getenv_r ("serial#", str, sizeof (str));
148 if (!i || strncmp (str, "AR405", 5)) {
149 puts ("### No HW ID - assuming AR405\n");
157 /* display infos on fpgaimage */
159 for (i = 0; i < 4; i++) {
160 len = fpgadata[index];
161 printf ("%s ", &(fpgadata[index + 1]));
170 /* ------------------------------------------------------------------------- */
172 long int initdram (int board_type)
174 return (16 * 1024 * 1024);
177 /* ------------------------------------------------------------------------- */
181 /* TODO: XXX XXX XXX */
182 printf ("test: 16 MB - ok\n");
187 /* ------------------------------------------------------------------------- */