From f985621dd5072854ebed5587167d4a918852e975 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Fri, 1 Aug 2014 14:16:39 -0500 Subject: tegra132: use padconfig for initializing uart pads Start using the soc_configure_pads() API. This allows for bulk processing of pads. BUG=chrome-os-partner:31105 BUG=chrome-os-partner:31104 BUG=chrome-os-partner:29981 BRANCH=None TEST=Built and can get console messages on rush. Change-Id: Id2c8a685a4566bda8fc260f74f5dffdd0da03056 Signed-off-by: Patrick Georgi Original-Commit-Id: bbd7c81bc0777b38bb641b9fcf89425bfd93566d Original-Change-Id: Iaa6a6ff4d559aedb98b078e87b0ecddefd3402d6 Original-Signed-off-by: Aaron Durbin Original-Reviewed-on: https://chromium-review.googlesource.com/210834 Original-Reviewed-by: Furquan Shaikh Reviewed-on: http://review.coreboot.org/8876 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/soc/nvidia/tegra132/bootblock.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'src/soc/nvidia/tegra132/bootblock.c') diff --git a/src/soc/nvidia/tegra132/bootblock.c b/src/soc/nvidia/tegra132/bootblock.c index 5a6050a2b9..3c484986d3 100644 --- a/src/soc/nvidia/tegra132/bootblock.c +++ b/src/soc/nvidia/tegra132/bootblock.c @@ -23,11 +23,25 @@ #include #include #include +#include #include #include "pinmux.h" #include "power.h" +static const struct pad_config uart_console_pads[] = { + /* Hard coded pad usage for UARTA. */ + PAD_CFG_SFIO(KB_ROW9, 0, UA3), + PAD_CFG_SFIO(KB_ROW10, PINMUX_INPUT_ENABLE | PINMUX_PULL_UP, UA3), + /* + * Disable UART2 pads as they are default connected to UARTA controller. + */ + PAD_CFG_UNUSED(UART2_RXD), + PAD_CFG_UNUSED(UART2_TXD), + PAD_CFG_UNUSED(UART2_RTS_N), + PAD_CFG_UNUSED(UART2_CTS_N), +}; + void main(void) { // enable pinmux clamp inputs @@ -38,18 +52,7 @@ void main(void) clock_early_uart(); - // Serial out, tristate off. - pinmux_set_config(PINMUX_KB_ROW9_INDEX, PINMUX_KB_ROW9_FUNC_UA3); - // Serial in, tristate_on. - pinmux_set_config(PINMUX_KB_ROW10_INDEX, PINMUX_KB_ROW10_FUNC_UA3 | - PINMUX_PULL_UP | - PINMUX_INPUT_ENABLE); - // Mux some pins away from uart A. - pinmux_set_config(PINMUX_UART2_CTS_N_INDEX, - PINMUX_UART2_CTS_N_FUNC_UB3 | - PINMUX_INPUT_ENABLE); - pinmux_set_config(PINMUX_UART2_RTS_N_INDEX, - PINMUX_UART2_RTS_N_FUNC_UB3); + soc_configure_pads(uart_console_pads, ARRAY_SIZE(uart_console_pads)); if (CONFIG_BOOTBLOCK_CONSOLE) { console_init(); -- cgit v1.2.3