pci_decode: enable all bridges

set I/O port, MMIO, and bus master to enabled for bridges where
disabled.

issue #4578
This commit is contained in:
Sebastian Sumpf 2022-10-07 14:31:42 +02:00 committed by Christian Helmuth
parent e7ba0b7371
commit 7f0c89f378

View File

@ -82,6 +82,18 @@ void Main::parse_pci_function(Bdf bdf,
new (heap) Bridge(parent.sub_bridges, bdf,
bcfg.secondary_bus_number(),
bcfg.subordinate_bus_number());
/* enable I/O spaces and DMA in bridges if not done already */
using Command = Pci::Config::Command;
Command::access_t command = bcfg.read<Command>();
if (Command::Io_space_enable::get(command) == 0 ||
Command::Memory_space_enable::get(command) == 0 ||
Command::Bus_master_enable::get(command) == 0) {
Command::Io_space_enable::set(command, 1);
Command::Memory_space_enable::set(command, 1);
Command::Bus_master_enable::set(command, 1);
bcfg.write<Command>(command);
}
});
}