soc/intel/common/block/uart: Update the UART PCI device reference

This implementation revises the UART PCI device reference in common
UART driver. The SOC functions have been aligned to provide the UART
PCI device reference using pcidev_path_on_root.

The uart_get_device() return type is changed, and files in which
it gets used are updated.

Change-Id: Ie0fe5991f3b0b9c596c3de9472e98e4091d7dd87
Signed-off-by: Aamir Bohra <aamir.bohra@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34582
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
Aamir Bohra
2019-07-25 20:56:54 +05:30
committed by Martin Roth
parent 4183312cec
commit 17cfba6fd4
6 changed files with 38 additions and 31 deletions

View File

@@ -50,7 +50,7 @@ const struct uart_gpio_pad_config uart_gpio_pads[] = {
const int uart_max_index = ARRAY_SIZE(uart_gpio_pads);
struct device *soc_uart_console_to_device(int uart_console)
DEVTREE_CONST struct device *soc_uart_console_to_device(int uart_console)
{
/*
* if index is valid, this function will return corresponding structure
@@ -58,11 +58,11 @@ struct device *soc_uart_console_to_device(int uart_console)
*/
switch (uart_console) {
case 0:
return (struct device *)PCH_DEV_UART0;
return pcidev_path_on_root(PCH_DEVFN_UART0);
case 1:
return (struct device *)PCH_DEV_UART1;
return pcidev_path_on_root(PCH_DEVFN_UART1);
case 2:
return (struct device *)PCH_DEV_UART2;
return pcidev_path_on_root(PCH_DEVFN_UART2);
default:
printk(BIOS_ERR, "Invalid UART console index\n");
return NULL;