libpayload/storage/ahci: Use pacc pointer to read device class
The PCI bus gets already scanned while gathering system information. Therefore, use the pacc pointer from sysinfo_t to read the device class of PCI devices instead of rescanning the bus. Change-Id: I4c79e71777e718f5065107ebf780ca9fdb4f1b0c Signed-off-by: Felix Singer <felix.singer@secunet.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/46416 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
@@ -227,7 +227,8 @@ static u32 working_controllers[] = {
|
||||
0x8086 | 0x5ae3 << 16, /* Apollo Lake */
|
||||
};
|
||||
#endif
|
||||
static void ahci_init_pci(pcidev_t dev)
|
||||
|
||||
void ahci_initialize(pcidev_t dev)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -282,19 +283,3 @@ static void ahci_init_pci(pcidev_t dev)
|
||||
ahci_port_probe(ctrl, &ports[i], i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
void ahci_initialize(void)
|
||||
{
|
||||
int bus, dev, func;
|
||||
|
||||
for (bus = 0; bus < 256; ++bus) {
|
||||
for (dev = 0; dev < 32; ++dev) {
|
||||
const u16 class =
|
||||
pci_read_config16(PCI_DEV(bus, dev, 0), 0xa);
|
||||
if (class != 0xffff) {
|
||||
for (func = 0; func < 8; ++func)
|
||||
ahci_init_pci(PCI_DEV(bus, dev, func));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user