Disable access to PCI devices I/O and memory regions while mangling BAR registers. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@xxxxxxxxx> --- Changelog: v2->v3: - new patch Cc: barebox@xxxxxxxxxxxxxxxxxxx Cc: Antony Pavlov <antonynpavlov@xxxxxxxxx> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@xxxxxxxxxxxx> Cc: Lucas Stach <l.stach@xxxxxxxxxxxxxx> Cc: Thomas Petazzoni <thomas.petazzoni@xxxxxxxxxxxxxxxxxx> Cc: Ezequiel Garcia <ezequiel.garcia@xxxxxxxxxxxxxxxxxx> --- drivers/pci/pci.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index f58e2c98f185..b64f25d13282 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -191,6 +191,10 @@ unsigned int pci_scan_bus(struct pci_bus *bus) continue; } + pci_read_config_byte(dev, PCI_COMMAND, &cmd); + pci_write_config_byte(dev, PCI_COMMAND, + cmd & ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY)); + for (bar = 0; bar < 6; bar++) { resource_size_t last_addr; @@ -233,6 +237,7 @@ unsigned int pci_scan_bus(struct pci_bus *bus) bar++; } + pci_write_config_byte(dev, PCI_COMMAND, cmd); list_add_tail(&dev->bus_list, &bus->devices); pci_register_device(dev); } -- 2.0.0 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox