summaryrefslogtreecommitdiff
path: root/util/inteltool/rootcmplx.c
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@coresystems.de>2008-12-04 15:18:20 +0000
committerStefan Reinauer <stepan@openbios.org>2008-12-04 15:18:20 +0000
commit1162f25a49e8f39822123d664cda10fef466b351 (patch)
tree22afd92c49e7b79fdea37c3e3aef6b34cb70af2f /util/inteltool/rootcmplx.c
parentfcf9be3b9305cfddaf74594fcaec4d6f23541154 (diff)
downloadcoreboot-1162f25a49e8f39822123d664cda10fef466b351.tar.xz
Patch to util/inteltool:
* PMBASE dumping now knows the registers. * Add support for i965, i975, ICH8M * Add support for Darwin OS using DirectIO Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3794 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/inteltool/rootcmplx.c')
-rw-r--r--util/inteltool/rootcmplx.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/util/inteltool/rootcmplx.c b/util/inteltool/rootcmplx.c
index 7e2b665ce6..438e5b0b11 100644
--- a/util/inteltool/rootcmplx.c
+++ b/util/inteltool/rootcmplx.c
@@ -18,18 +18,8 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <errno.h>
-#include <fcntl.h>
-#include <unistd.h>
#include <stdio.h>
-#include <string.h>
#include <stdlib.h>
-#include <stdint.h>
-#include <getopt.h>
-#include <sys/mman.h>
-#include <sys/io.h>
-#include <pci/pci.h>
-
#include "inteltool.h"
int print_rcba(struct pci_dev *sb)
@@ -45,6 +35,7 @@ int print_rcba(struct pci_dev *sb)
case PCI_DEVICE_ID_INTEL_ICH7M:
case PCI_DEVICE_ID_INTEL_ICH7DH:
case PCI_DEVICE_ID_INTEL_ICH7MDH:
+ case PCI_DEVICE_ID_INTEL_ICH8M:
rcba_phys = pci_read_long(sb, 0xf0) & 0xfffffffe;
break;
case PCI_DEVICE_ID_INTEL_ICH:
@@ -58,10 +49,9 @@ int print_rcba(struct pci_dev *sb)
return 1;
}
- rcba = mmap(0, size, PROT_WRITE | PROT_READ, MAP_SHARED,
- fd_mem, (off_t) rcba_phys);
+ rcba = map_physical(rcba_phys, size);
- if (rcba == MAP_FAILED) {
+ if (rcba == NULL) {
perror("Error mapping RCBA");
exit(1);
}
@@ -73,7 +63,7 @@ int print_rcba(struct pci_dev *sb)
printf("0x%04x: 0x%08x\n", i, *(uint32_t *)(rcba + i));
}
- munmap((void *)rcba, size);
+ unmap_physical((void *)rcba, size);
return 0;
}