summaryrefslogtreecommitdiff
path: root/util/msrtool/msrtool.c
diff options
context:
space:
mode:
authorPeter Stuge <peter@stuge.se>2008-11-25 02:03:16 +0000
committerPeter Stuge <peter@stuge.se>2008-11-25 02:03:16 +0000
commit0924dee124acfd1f8ae96685720c7a4af068e843 (patch)
tree00321ecd5b104f533af8b1d170c79761b6f7cdf3 /util/msrtool/msrtool.c
parentef8ea01c8c6638e4cf3a9ed32857e14c3f6e7cbc (diff)
downloadcoreboot-0924dee124acfd1f8ae96685720c7a4af068e843.tar.xz
msrtool: Use libpci to let system and target probes find PCI devices.
And some more notes in TODO. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3770 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/msrtool/msrtool.c')
-rw-r--r--util/msrtool/msrtool.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/util/msrtool/msrtool.c b/util/msrtool/msrtool.c
index 6f0b3a0109..5742a1765c 100644
--- a/util/msrtool/msrtool.c
+++ b/util/msrtool/msrtool.c
@@ -25,6 +25,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
+#include <pci/pci.h>
#include "msrtool.h"
@@ -36,6 +37,8 @@ const struct targetdef **targets = NULL;
const struct sysdef *sys = NULL;
uint8_t reserved = 0, verbose = 0, quiet = 0;
+struct pci_access *pacc = NULL;
+
static struct targetdef alltargets[] = {
{ "geodelx", "AMD Geode(tm) LX", geodelx_probe, geodelx_msrs },
{ "cs5536", "AMD Geode(tm) CS5536", cs5536_probe, cs5536_msrs },
@@ -296,6 +299,14 @@ int main(int argc, char *argv[]) {
printf_quiet("msrtool %s\n", VERSION);
+ pacc = pci_alloc();
+ if (NULL == pacc) {
+ fprintf(stderr, "Could not initialize PCI library! pci_alloc() failed.\n");
+ return 1;
+ }
+ pci_init(pacc);
+ pci_scan_bus(pacc);
+
if (!sys && !input && !listknown)
for (sys = allsystems; !SYSTEM_ISEOT(*sys); sys++) {
printf_verbose("Probing for system %s: %s\n", sys->name, sys->prettyname);