libpayload/arch/x86: Introduce pacc pointer in sysinfo_t struct
Currently, the PCI bus gets scanned multiple times for various reasons (e.g. to read the device class). Therefore, and in preparation to CB:46416, introduce the pacc pointer in the sysinfo_t struct and scan the PCI bus while gathering system information. Change-Id: I496c5a3d78c7fb5d7c9f119a0c9a0314d54e729f Signed-off-by: Felix Singer <felix.singer@secunet.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/46348 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
@@ -78,5 +78,10 @@ int lib_get_sysinfo(void)
|
|||||||
lib_sysinfo.memrange[1].type = CB_MEM_RAM;
|
lib_sysinfo.memrange[1].type = CB_MEM_RAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if CONFIG(LP_PCI)
|
||||||
|
pci_init(&lib_sysinfo.pacc);
|
||||||
|
pci_scan_bus(&lib_sysinfo.pacc);
|
||||||
|
#endif
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@@ -29,6 +29,7 @@
|
|||||||
#ifndef _SYSINFO_H
|
#ifndef _SYSINFO_H
|
||||||
#define _SYSINFO_H
|
#define _SYSINFO_H
|
||||||
|
|
||||||
|
#include <pci/pci.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
/* Maximum number of memory range definitions. */
|
/* Maximum number of memory range definitions. */
|
||||||
@@ -130,6 +131,10 @@ struct sysinfo_t {
|
|||||||
|
|
||||||
/* Pointer to FMAP cache in CBMEM */
|
/* Pointer to FMAP cache in CBMEM */
|
||||||
uintptr_t fmap_cache;
|
uintptr_t fmap_cache;
|
||||||
|
|
||||||
|
#if CONFIG(LP_PCI)
|
||||||
|
struct pci_access pacc;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct sysinfo_t lib_sysinfo;
|
extern struct sysinfo_t lib_sysinfo;
|
||||||
|
Reference in New Issue
Block a user