aboutsummaryrefslogtreecommitdiff
path: root/src/soc/intel/common/block/uart
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2021-01-06 20:30:35 -0800
committerPatrick Georgi <pgeorgi@google.com>2021-01-11 07:41:22 +0000
commit4fa183fe79f5f7fc66750ee0bd2376f5c99ed9b0 (patch)
tree418460da0b63b06d9fe619dccb4b4601977b0a5d /src/soc/intel/common/block/uart
parentb1fa231d76a5bb41a61a1c2907ab27e8ef9999bb (diff)
soc/intel/uart: Drop SoC callback `soc_uart_console_to_device`
This change renames `struct uart_gpio_pad_config` to `struct uart_controller_config` and adds a new parameter devfn (which expects devfn for the UART controller corresponding to the index in PCI_DEVFN() format). This gets rid of the SoC callback to get `struct device` pointer to the UART controller device. Change-Id: Id0712a0038f2cc1a61b8b5a58fa155f14e7949a5 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/49212 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Karthik Ramasubramanian <kramasub@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/intel/common/block/uart')
-rw-r--r--src/soc/intel/common/block/uart/uart.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/soc/intel/common/block/uart/uart.c b/src/soc/intel/common/block/uart/uart.c
index 1e205ef07f..559ba6da23 100644
--- a/src/soc/intel/common/block/uart/uart.c
+++ b/src/soc/intel/common/block/uart/uart.c
@@ -20,7 +20,7 @@
#define UART_PCI_ENABLE (PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER)
#define UART_CONSOLE_INVALID_INDEX 0xFF
-extern const struct uart_gpio_pad_config uart_gpio_pads[];
+extern const struct uart_controller_config uart_ctrlr_config[];
extern const int uart_max_index;
static void uart_lpss_init(const struct device *dev, uintptr_t baseaddr)
@@ -50,7 +50,7 @@ static int uart_get_valid_index(void)
int index;
for (index = 0; index < uart_max_index; index++) {
- if (uart_gpio_pads[index].console_index ==
+ if (uart_ctrlr_config[index].console_index ==
CONFIG_UART_FOR_CONSOLE)
return index;
}
@@ -88,7 +88,7 @@ const struct device *uart_get_device(void)
int console_index = uart_get_valid_index();
if (console_index != UART_CONSOLE_INVALID_INDEX)
- return soc_uart_console_to_device(CONFIG_UART_FOR_CONSOLE);
+ return pcidev_path_on_root(uart_ctrlr_config[console_index].devfn);
else
return NULL;
}
@@ -123,7 +123,7 @@ static void uart_configure_gpio_pads(void)
int index = uart_get_valid_index();
if (index != UART_CONSOLE_INVALID_INDEX)
- gpio_configure_pads(uart_gpio_pads[index].gpios,
+ gpio_configure_pads(uart_ctrlr_config[index].gpios,
MAX_GPIO_PAD_PER_UART);
}