From bb9dda4a7a33ab5b75b66ea5d33c2329a90dff81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Niew=C3=B6hner?= Date: Mon, 21 Dec 2020 03:46:58 +0100 Subject: [PATCH] mb/intel/apollolake_rvp: do UART pad configuration at board-level MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit UART pad configuration should not be done in common code, because that may cause short circuits, when the user sets a wrong UART index. Thus, add the corresponding pads to a early UART gpio table for the board as a first step. Common UART pad config code then gets dropped in CB:48829. Also switch to `bootblock_mainboard_early_init` to configure the pads in early bootblock before console initialization, to make the console work as early as possible. The board does not do any other gpio configuration in bootblock, so this should not influence behaviour in a negative way (e.g. breaking overrides). Change-Id: Id6b55d7f3d3fbfc5b55497708f24006614760d03 Signed-off-by: Michael Niewöhner Reviewed-on: https://review.coreboot.org/c/coreboot/+/49434 Reviewed-by: Angel Pons Tested-by: build bot (Jenkins) --- src/mainboard/intel/apollolake_rvp/Makefile.inc | 2 +- src/mainboard/intel/apollolake_rvp/bootblock.c | 11 +++++++++++ src/mainboard/intel/apollolake_rvp/gpio.h | 8 ++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 src/mainboard/intel/apollolake_rvp/bootblock.c create mode 100644 src/mainboard/intel/apollolake_rvp/gpio.h diff --git a/src/mainboard/intel/apollolake_rvp/Makefile.inc b/src/mainboard/intel/apollolake_rvp/Makefile.inc index 75c34ddc52..8501868fbf 100644 --- a/src/mainboard/intel/apollolake_rvp/Makefile.inc +++ b/src/mainboard/intel/apollolake_rvp/Makefile.inc @@ -1 +1 @@ -#Nothing here yet +bootblock-y += bootblock.c diff --git a/src/mainboard/intel/apollolake_rvp/bootblock.c b/src/mainboard/intel/apollolake_rvp/bootblock.c new file mode 100644 index 0000000000..0728701332 --- /dev/null +++ b/src/mainboard/intel/apollolake_rvp/bootblock.c @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include +#include + +#include "gpio.h" + +void bootblock_mainboard_early_init(void) +{ + gpio_configure_pads(early_gpio_table, ARRAY_SIZE(early_gpio_table)); +} diff --git a/src/mainboard/intel/apollolake_rvp/gpio.h b/src/mainboard/intel/apollolake_rvp/gpio.h new file mode 100644 index 0000000000..db6f6010f9 --- /dev/null +++ b/src/mainboard/intel/apollolake_rvp/gpio.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include + +static const struct pad_config early_gpio_table[] = { + PAD_CFG_NF(GPIO_46, NATIVE, DEEP, NF1), /* UART2 RX */ + PAD_CFG_NF(GPIO_47, NATIVE, DEEP, NF1), /* UART2 TX */ +};