2 * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
4 * Parts are shamelessly stolen from various TI sources, original copyright
6 * -----------------------------------------------------------------
8 * Copyright (C) 2004 Texas Instruments.
10 * ----------------------------------------------------------------------------
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 * ----------------------------------------------------------------------------
29 #include <asm/arch/hardware.h>
30 #include "../common/psc.h"
31 #include "../common/misc.h"
33 DECLARE_GLOBAL_DATA_PTR;
37 /* arch number of the board */
38 gd->bd->bi_arch_number = MACH_TYPE_DAVINCI_EVM;
40 /* address of boot parameters */
41 gd->bd->bi_boot_params = LINUX_BOOT_PARAM_ADDR;
43 /* Configure AEMIF pins (although this should be configured at boot time
44 * with pull-up/pull-down resistors) */
45 REG(PINMUX0) = 0x00000c1f;
47 davinci_errata_workarounds();
49 /* Power on required peripherals */
50 lpsc_on(DAVINCI_LPSC_GPIO);
51 lpsc_on(DAVINCI_LPSC_USB);
53 #if !defined(CONFIG_SYS_USE_DSPLINK)
56 #endif /* CONFIG_SYS_USE_DSPLINK */
58 davinci_enable_uart0();
59 davinci_enable_emac();
62 lpsc_on(DAVINCI_LPSC_TIMER1);
71 uint8_t eeprom_enetaddr[6];
73 dv_display_clk_infos();
75 /* Read Ethernet MAC address from EEPROM if available. */
76 if (dvevm_read_mac_address(eeprom_enetaddr))
77 dv_configure_mac_address(eeprom_enetaddr);
80 printf("ethernet init failed!\n");
82 i2c_read(0x39, 0x00, 1, &video_mode, 1);
84 setenv("videostd", ((video_mode & 0x80) ? "pal" : "ntsc"));
89 #ifdef CONFIG_USB_DAVINCI
91 /* IO Expander I2C address and USB VBUS enable mask */
92 #define IOEXP_I2C_ADDR 0x3A
93 #define IOEXP_VBUSEN_MASK 1
96 * This function enables USB VBUS by writting to IO expander using I2C.
97 * Note that the I2C is already initialized at this stage. This
98 * function is used by davinci specific USB wrapper code.
100 void enable_vbus(void)
102 uchar data; /* IO Expander data to enable VBUS */
104 /* Write to IO expander to enable VBUS */
105 i2c_read(IOEXP_I2C_ADDR, 0, 0, &data, 1);
106 data &= ~IOEXP_VBUSEN_MASK;
107 i2c_write(IOEXP_I2C_ADDR, 0, 0, &data, 1);