]>
git.ipfire.org Git - people/ms/u-boot.git/blob - board/mpl/vcma9/vcma9.c
3 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
4 * Marius Groeger <mgroeger@sysgo.de>
7 * David Mueller, ELSOFT AG, <d.mueller@elsoft.ch>
9 * See file CREDITS for list of people who contributed to this
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License as
14 * published by the Free Software Foundation; either version 2 of
15 * the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
33 #include "../common/common_util.h"
35 /* ------------------------------------------------------------------------- */
39 #if FCLK_SPEED==0 /* Fout = 203MHz, Fin = 12MHz for Audio */
43 #elif FCLK_SPEED==1 /* Fout = 202.8MHz */
61 static inline void delay(unsigned long loops
)
63 __asm__
volatile ("1:\n"
65 "bne 1b":"=r" (loops
):"0" (loops
));
69 * Miscellaneous platform dependent initialisations
74 DECLARE_GLOBAL_DATA_PTR
;
76 /* to reduce PLL lock time, adjust the LOCKTIME register */
80 rMPLLCON
= ((M_MDIV
<< 12) + (M_PDIV
<< 4) + M_SDIV
);
82 /* some delay between MPLL and UPLL */
86 rUPLLCON
= ((U_M_MDIV
<< 12) + (U_M_PDIV
<< 4) + U_M_SDIV
);
88 /* some delay between MPLL and UPLL */
91 /* set up the I/O ports */
101 rGPFCON
= 0x00000000;
103 rGPGCON
= 0xFFEAFF5A;
105 rGPHCON
= 0x0028AAAA;
108 /* setup correct IRQ modes for NIC */
109 rEXTINT2
= (rEXTINT2
& ~(7<<8)) | (4<<8); /* rising edge mode */
112 gd
->baudrate
= CONFIG_BAUDRATE
;
113 gd
->have_console
= 1;
116 /* arch number of VCMA9-Board */
117 gd
->bd
->bi_arch_number
= 227;
119 /* adress of boot parameters */
120 gd
->bd
->bi_boot_params
= 0x30000100;
130 DECLARE_GLOBAL_DATA_PTR
;
132 gd
->bd
->bi_dram
[0].start
= PHYS_SDRAM_1
;
133 gd
->bd
->bi_dram
[0].size
= PHYS_SDRAM_1_SIZE
;
139 * Get some Board/PLD Info
142 static uchar
Get_PLD_ID(void)
144 return(*(volatile uchar
*)PLD_ID_REG
);
147 static uchar
Get_PLD_BOARD(void)
149 return(*(volatile uchar
*)PLD_BOARD_REG
);
152 static uchar
Get_PLD_Version(void)
154 return((Get_PLD_ID() >> 4) & 0x0F);
157 static uchar
Get_PLD_Revision(void)
159 return(Get_PLD_ID() & 0x0F);
162 static int Get_Board_Config(void)
164 uchar config
= Get_PLD_BOARD() & 0x03;
172 static uchar
Get_Board_PCB(void)
174 return(((Get_PLD_BOARD() >> 4) & 0x03) + 'A');
177 /* ------------------------------------------------------------------------- */
180 * Check Board Identity:
186 unsigned char bc
, var
, rc
;
188 backup_t
*b
= (backup_t
*) s
;
192 i
= getenv_r("serial#", s
, 32);
193 if ((i
< 0) || strncmp (s
, "VCMA9", 5)) {
194 get_backup_values (b
);
195 if (strncmp (b
->signature
, "MPL\0", 4) != 0) {
196 puts ("### No HW ID - assuming VCMA9");
198 b
->serial_name
[5] = 0;
199 printf ("%s-%d Rev %c SN: %s", b
->serial_name
, Get_Board_Config(),
200 Get_Board_PCB(), &b
->serial_name
[6]);
204 printf ("%s-%d Rev %c SN: %s", s
, Get_Board_Config(), Get_Board_PCB(),
213 void print_vcma9_rev(void)
215 printf("Board: VCMA9-%d Rev: %c (PLD Ver: %d, Rev: %d)\n",
216 Get_Board_Config(), Get_Board_PCB(),
217 Get_PLD_Version(), Get_PLD_Revision());
221 int last_stage_init(void)
229 /***************************************************************************
230 * some helping routines
233 int overwrite_console(void)
235 /* return TRUE if console should be overwritten */
240 /************************************************************************
242 ************************************************************************/
243 void print_vcma9_info(void)