diff options
author | Stefan Reinauer <reinauer@chromium.org> | 2011-05-10 12:54:56 -0700 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2012-03-09 20:32:30 +0100 |
commit | dfab0f69ae9af22a96f68364fb1c0d95798a21c9 (patch) | |
tree | 106ea46ddcbcfa19b1a9c80eeda1c980c6ce5a9d /src | |
parent | 8907e816265d9821e39bb21333f6212b97e80504 (diff) | |
download | coreboot-dfab0f69ae9af22a96f68364fb1c0d95798a21c9.tar.xz |
OXPCIe: Reinitialize UART after pci_dev_set_resources()
... and only pull in early init code if the OXPCIe is used for console.
Change-Id: I01feca3b9e8376a75c17554ba1bd200d523dff8d
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/692
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/drivers/oxford/oxpcie/Makefile.inc | 2 | ||||
-rw-r--r-- | src/drivers/oxford/oxpcie/oxpcie.c | 14 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/drivers/oxford/oxpcie/Makefile.inc b/src/drivers/oxford/oxpcie/Makefile.inc index 7d3a26f509..7f4aa58e93 100644 --- a/src/drivers/oxford/oxpcie/Makefile.inc +++ b/src/drivers/oxford/oxpcie/Makefile.inc @@ -1,3 +1,5 @@ driver-$(CONFIG_DRIVERS_OXFORD_OXPCIE) += oxpcie.c +ifeq ($(CONFIG_CONSOLE_SERIAL8250MEM),y) romstage-$(CONFIG_DRIVERS_OXFORD_OXPCIE) += oxpcie_early.c +endif diff --git a/src/drivers/oxford/oxpcie/oxpcie.c b/src/drivers/oxford/oxpcie/oxpcie.c index e1fb65f9db..8afdd1f74e 100644 --- a/src/drivers/oxford/oxpcie/oxpcie.c +++ b/src/drivers/oxford/oxpcie/oxpcie.c @@ -23,7 +23,6 @@ #include <device/pci_ids.h> #include <console/console.h> #include <arch/io.h> -#include <uart8250.h> static void oxford_oxpcie_enable(device_t dev) { @@ -41,9 +40,20 @@ static void oxford_oxpcie_enable(device_t dev) (read32(res->base + 4) & 3)); } + +static void oxford_oxpcie_set_resources(struct device *dev) +{ + pci_dev_set_resources(dev); + +#if CONFIG_CONSOLE_SERIAL8250MEM + /* Re-initialize OXPCIe base address after set_resources */ + uartmem_init(); +#endif +} + static struct device_operations oxford_oxpcie_ops = { .read_resources = pci_dev_read_resources, - .set_resources = pci_dev_set_resources, + .set_resources = oxford_oxpcie_set_resources, .enable_resources = pci_dev_enable_resources, .init = oxford_oxpcie_enable, .scan_bus = 0, |