3 * Dirk Eibach, Guntermann & Drunck GmbH, eibach@gdsys.de
5 * SPDX-License-Identifier: GPL-2.0+
10 #include <asm/processor.h>
12 #include <asm/ppc4xx-gpio.h>
15 HWTYPE_DLVISION_CPU = 0,
16 HWTYPE_DLVISION_CON = 1,
21 int board_early_init_f(void)
23 mtdcr(UIC0SR, 0xFFFFFFFF); /* clear all ints */
24 mtdcr(UIC0ER, 0x00000000); /* disable all ints */
25 mtdcr(UIC0CR, 0x00000000); /* set all to be non-critical */
26 mtdcr(UIC0PR, 0xFFFFFF80); /* set int polarities */
27 mtdcr(UIC0TR, 0x10000000); /* set int trigger levels */
28 mtdcr(UIC0VCR, 0x00000001); /* set vect base=0,INT0 highest prio */
29 mtdcr(UIC0SR, 0xFFFFFFFF); /* clear all ints */
32 * EBC Configuration Register: set ready timeout to 512 ebc-clks
35 mtebc(EBC0_CFG, 0xa8400000); /* ebc always driven */
40 out_le16((void *)CONFIG_SYS_LATCH_BASE, 0x00f0);
41 out_le16((void *)(CONFIG_SYS_LATCH_BASE + 0x100), 0x0002);
42 out_le16((void *)(CONFIG_SYS_LATCH_BASE + 0x200), 0x0000);
49 * set "startup-finished"-gpios
51 gpio_write_bit(21, 0);
52 gpio_write_bit(22, 1);
58 * Check Board Identity:
63 int i = getenv_f("serial#", buf, sizeof(buf));
64 u8 channel2_msr = in_8((void *)CONFIG_UART_BASE + 0x26);
65 u8 channel3_msr = in_8((void *)CONFIG_UART_BASE + 0x36);
66 u8 channel7_msr = in_8((void *)CONFIG_UART_BASE + 0x76);
74 unit_type = (channel2_msr & 0x80) ? 0x01 : 0x00;
75 local_con = (channel2_msr & 0x20) ? 0x01 : 0x00;
76 audio = (channel3_msr & 0x20) ? 0x01 : 0x00;
78 ((channel7_msr & 0x20) ? 0x01 : 0x00)
79 | ((channel7_msr & 0x80) ? 0x02 : 0x00)
80 | ((channel7_msr & 0x40) ? 0x04 : 0x00);
83 case HWTYPE_DLVISION_CON:
84 printf("DL-Vision-CON");
87 case HWTYPE_DLVISION_CPU:
88 printf("DL-Vision-CPU");
92 printf("UnitType %d, unsupported", unit_type);
102 switch (hardware_version) {
104 printf("HW-Ver 1.00");
108 printf("HW-Ver %d, unsupported",
114 printf(", local console");
117 printf(", audio support");