1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2016 Stefan Roese <sr@denx.de>
8 #include <winbond_w83627.h>
10 #include <asm/ibmpc.h>
11 #include <asm/pnp_def.h>
13 int board_early_init_f(void)
15 #ifndef CONFIG_INTERNAL_UART
17 * The FSP enables the BayTrail internal legacy UART (again).
18 * Disable it again, so that the Winbond one can be used.
20 setup_internal_uart(0);
22 /* Enable the legacy UART in the Winbond W83627 Super IO chip */
23 winbond_enable_serial(PNP_DEV(WINBOND_IO_PORT, W83627DHG_SP1),
24 UART0_BASE, UART0_IRQ);
30 int board_late_init(void)
36 /* Configure SMSC USB2513 USB Hub: 7bit address 0x2c */
37 ret = i2c_get_chip_for_busnum(0, 0x2c, 1, &dev);
39 printf("Cannot find USB2513: %d\n", ret);
44 * The first access to the USB Hub fails sometimes, so lets read
45 * a dummy byte to be sure here
47 dm_i2c_read(dev, 0x00, buf, 1);
50 * The SMSC hub is not visible on the I2C bus after the first
51 * configuration at power-up. The following code deliberately
52 * does not report upon failure of these I2C write calls.
55 dm_i2c_write(dev, 0x06, buf, 1);
58 dm_i2c_write(dev, 0xf8, buf, 1);
61 dm_i2c_write(dev, 0xfa, buf, 1);
64 dm_i2c_write(dev, 0xff, buf, 1);