Skip to content

Commit 06f25bd

Browse files
palitrini
authored andcommitted
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>
1 parent f209414 commit 06f25bd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/pci/pci_auto.c

+8
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,14 @@ void dm_pciauto_prescan_setup_bridge(struct udevice *dev, int sub_bus)
265265
(pci_io->bus_lower & 0xffff0000) >> 16);
266266

267267
cmdstat |= PCI_COMMAND_IO;
268+
} else {
269+
/* Disable I/O if unsupported */
270+
dm_pci_write_config8(dev, PCI_IO_BASE, 0xf0 | io_32);
271+
dm_pci_write_config8(dev, PCI_IO_LIMIT, 0x0 | io_32);
272+
if (io_32 == PCI_IO_RANGE_TYPE_32) {
273+
dm_pci_write_config16(dev, PCI_IO_BASE_UPPER16, 0x0);
274+
dm_pci_write_config16(dev, PCI_IO_LIMIT_UPPER16, 0x0);
275+
}
268276
}
269277

270278
/* Enable memory and I/O accesses, enable bus master */

0 commit comments

Comments
 (0)