Stefan Roese | 82ceba2 | 2016-03-16 08:48:21 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 Stefan Roese <sr@denx.de> |
| 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0+ |
| 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <winbond_w83627.h> |
| 9 | #include <asm/gpio.h> |
| 10 | #include <asm/ibmpc.h> |
| 11 | #include <asm/pnp_def.h> |
| 12 | |
| 13 | int board_early_init_f(void) |
| 14 | { |
Stefan Roese | f2a751b | 2016-06-15 14:15:25 +0200 | [diff] [blame] | 15 | #ifndef CONFIG_INTERNAL_UART |
Stefan Roese | 82ceba2 | 2016-03-16 08:48:21 +0100 | [diff] [blame] | 16 | /* |
| 17 | * The FSP enables the BayTrail internal legacy UART (again). |
| 18 | * Disable it again, so that the Winbond one can be used. |
| 19 | */ |
| 20 | setup_internal_uart(0); |
| 21 | |
| 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); |
Stefan Roese | f2a751b | 2016-06-15 14:15:25 +0200 | [diff] [blame] | 25 | #endif |
Stefan Roese | 82ceba2 | 2016-03-16 08:48:21 +0100 | [diff] [blame] | 26 | |
| 27 | return 0; |
| 28 | } |
| 29 | |
| 30 | int arch_early_init_r(void) |
| 31 | { |
| 32 | return 0; |
| 33 | } |