From 1c22753996fc7884115e478249b3080fb4bb9c83 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/google/octopus: 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 the 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: Ieeb738afd54e77ee853ee109009f611411aa0d4a Signed-off-by: Michael Niewöhner Reviewed-on: https://review.coreboot.org/c/coreboot/+/49426 Reviewed-by: Tim Wawrzynczak Reviewed-by: Karthik Ramasubramanian Tested-by: build bot (Jenkins) --- src/mainboard/google/octopus/bootblock.c | 12 +++++++++--- .../google/octopus/variants/baseboard/gpio.c | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/mainboard/google/octopus/bootblock.c b/src/mainboard/google/octopus/bootblock.c index e0f037f4a9..1802695b7d 100644 --- a/src/mainboard/google/octopus/bootblock.c +++ b/src/mainboard/google/octopus/bootblock.c @@ -5,14 +5,20 @@ #include #include +void bootblock_mainboard_early_init(void) +{ + const struct pad_config *pads; + size_t num; + + pads = mainboard_early_bootblock_gpio_table(&num); + gpio_configure_pads(pads, num); +}; + void bootblock_mainboard_init(void) { const struct pad_config *pads, *override_pads; size_t num, override_num; - pads = mainboard_early_bootblock_gpio_table(&num); - gpio_configure_pads(pads, num); - /* * Perform EC init before configuring GPIOs. This is because variant * might talk to the EC to get board id and hence it will require EC diff --git a/src/mainboard/google/octopus/variants/baseboard/gpio.c b/src/mainboard/google/octopus/variants/baseboard/gpio.c index b99ec4fc19..85b0cc0afc 100644 --- a/src/mainboard/google/octopus/variants/baseboard/gpio.c +++ b/src/mainboard/google/octopus/variants/baseboard/gpio.c @@ -294,6 +294,8 @@ const struct pad_config *__weak variant_early_override_gpio_table(size_t *num) static const struct pad_config early_bootblock_gpio_table[] = { PAD_NC(GPIO_154, NONE), /* LPC_CLKRUNB -- NC for eSPI */ + PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_64, UP_20K, DEEP, NF1, HIZCRx1, DISPUPD), /* LPSS_UART2_RXD */ + PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_65, UP_20K, DEEP, NF1, TxLASTRxE, DISPUPD), /* LPSS_UART2_TXD */ }; const struct pad_config *mainboard_early_bootblock_gpio_table(size_t *num)