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 * SPDX-License-Identifier: GPL-2.0+
12 * ----------------------------------------------------------------------------
17 #include <asm/arch/hardware.h>
18 #include <asm/arch/davinci_misc.h>
20 DECLARE_GLOBAL_DATA_PTR;
24 /* arch number of the board */
25 gd->bd->bi_arch_number = MACH_TYPE_DAVINCI_EVM;
27 /* address of boot parameters */
28 gd->bd->bi_boot_params = LINUX_BOOT_PARAM_ADDR;
30 /* Configure AEMIF pins (although this should be configured at boot time
31 * with pull-up/pull-down resistors) */
32 REG(PINMUX0) = 0x00000c1f;
34 davinci_errata_workarounds();
36 /* Power on required peripherals */
37 lpsc_on(DAVINCI_LPSC_GPIO);
38 lpsc_on(DAVINCI_LPSC_USB);
40 #if !defined(CONFIG_SYS_USE_DSPLINK)
43 #endif /* CONFIG_SYS_USE_DSPLINK */
45 davinci_enable_uart0();
46 davinci_enable_emac();
49 lpsc_on(DAVINCI_LPSC_TIMER1);
58 uint8_t eeprom_enetaddr[6];
60 /* Read Ethernet MAC address from EEPROM if available. */
61 if (dvevm_read_mac_address(eeprom_enetaddr))
62 davinci_sync_env_enetaddr(eeprom_enetaddr);
64 i2c_read(0x39, 0x00, 1, &video_mode, 1);
66 setenv("videostd", ((video_mode & 0x80) ? "pal" : "ntsc"));
71 #ifdef CONFIG_USB_DAVINCI
73 /* IO Expander I2C address and USB VBUS enable mask */
74 #define IOEXP_I2C_ADDR 0x3A
75 #define IOEXP_VBUSEN_MASK 1
78 * This function enables USB VBUS by writting to IO expander using I2C.
79 * Note that the I2C is already initialized at this stage. This
80 * function is used by davinci specific USB wrapper code.
82 void enable_vbus(void)
84 uchar data; /* IO Expander data to enable VBUS */
86 /* Write to IO expander to enable VBUS */
87 i2c_read(IOEXP_I2C_ADDR, 0, 0, &data, 1);
88 data &= ~IOEXP_VBUSEN_MASK;
89 i2c_write(IOEXP_I2C_ADDR, 0, 0, &data, 1);