3 * Dirk Eibach, Guntermann & Drunck GmbH, eibach@gdsys.de
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 <asm/ppc4xx-gpio.h>
31 HWTYPE_DLVISION_CPU = 0,
32 HWTYPE_DLVISION_CON = 1,
37 int board_early_init_f(void)
39 mtdcr(UIC0SR, 0xFFFFFFFF); /* clear all ints */
40 mtdcr(UIC0ER, 0x00000000); /* disable all ints */
41 mtdcr(UIC0CR, 0x00000000); /* set all to be non-critical */
42 mtdcr(UIC0PR, 0xFFFFFF80); /* set int polarities */
43 mtdcr(UIC0TR, 0x10000000); /* set int trigger levels */
44 mtdcr(UIC0VCR, 0x00000001); /* set vect base=0,INT0 highest prio */
45 mtdcr(UIC0SR, 0xFFFFFFFF); /* clear all ints */
48 * EBC Configuration Register: set ready timeout to 512 ebc-clks
51 mtebc(EBC0_CFG, 0xa8400000); /* ebc always driven */
56 out_le16((void *)CONFIG_SYS_LATCH_BASE, 0x00f0);
57 out_le16((void *)(CONFIG_SYS_LATCH_BASE + 0x100), 0x0002);
58 out_le16((void *)(CONFIG_SYS_LATCH_BASE + 0x200), 0x0000);
65 * set "startup-finished"-gpios
67 gpio_write_bit(21, 0);
68 gpio_write_bit(22, 1);
74 * Check Board Identity:
78 char *s = getenv("serial#");
79 u8 channel2_msr = in_8((void *)CONFIG_UART_BASE + 0x26);
80 u8 channel3_msr = in_8((void *)CONFIG_UART_BASE + 0x36);
81 u8 channel7_msr = in_8((void *)CONFIG_UART_BASE + 0x76);
89 unit_type = (channel2_msr & 0x80) ? 0x01 : 0x00;
90 local_con = (channel2_msr & 0x20) ? 0x01 : 0x00;
91 audio = (channel3_msr & 0x20) ? 0x01 : 0x00;
93 ((channel7_msr & 0x20) ? 0x01 : 0x00)
94 | ((channel7_msr & 0x80) ? 0x02 : 0x00)
95 | ((channel7_msr & 0x40) ? 0x04 : 0x00);
98 case HWTYPE_DLVISION_CON:
99 printf("DL-Vision-CON");
102 case HWTYPE_DLVISION_CPU:
103 printf("DL-Vision-CPU");
107 printf("UnitType %d, unsupported", unit_type);
117 switch (hardware_version) {
119 printf("HW-Ver 1.00");
123 printf("HW-Ver %d, unsupported",
129 printf(", local console");
132 printf(", audio support");