aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2021-11-25 11:32:43 +0100
committerTom Rini <trini@konsulko.com>2022-01-12 14:21:24 -0500
commit06f25bd2a907fa543d69757da4e3c752b7103e54 (patch)
treec52d7c31d288e83984dbc5b2490bc2eaa9efcdda
parentf2094143c5367f38c74d4233a65afb07a25a8ace (diff)
downloadu-boot-06f25bd2a907fa543d69757da4e3c752b7103e54.zip
u-boot-06f25bd2a907fa543d69757da4e3c752b7103e54.tar.gz
u-boot-06f25bd2a907fa543d69757da4e3c752b7103e54.tar.bz2
pci: Disable I/O forwarding during autoconfiguration if unsupported
If U-Boot does not have any I/O resource for assignment then disable I/O forwarding in PCI bridge autoconfiguration code. Default initial state of PCI bridge IO registers is unspecified, therefore they can be in enabled if U-Boot does not touch them. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
-rw-r--r--drivers/pci/pci_auto.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/pci/pci_auto.c b/drivers/pci/pci_auto.c
index 7e6ee54..6e5ed19 100644
--- a/drivers/pci/pci_auto.c
+++ b/drivers/pci/pci_auto.c
@@ -265,6 +265,14 @@ void dm_pciauto_prescan_setup_bridge(struct udevice *dev, int sub_bus)
(pci_io->bus_lower & 0xffff0000) >> 16);
cmdstat |= PCI_COMMAND_IO;
+ } else {
+ /* Disable I/O if unsupported */
+ dm_pci_write_config8(dev, PCI_IO_BASE, 0xf0 | io_32);
+ dm_pci_write_config8(dev, PCI_IO_LIMIT, 0x0 | io_32);
+ if (io_32 == PCI_IO_RANGE_TYPE_32) {
+ dm_pci_write_config16(dev, PCI_IO_BASE_UPPER16, 0x0);
+ dm_pci_write_config16(dev, PCI_IO_LIMIT_UPPER16, 0x0);
+ }
}
/* Enable memory and I/O accesses, enable bus master */