2 * inteltool - dump all registers on an Intel CPU + chipset based system.
4 * Copyright (C) 2008-2010 by coresystems GmbH
5 * Copyright (C) 2012 Anton Kochkov
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
20 #include "inteltool.h"
22 #define MMIO_SIZE 0x100000
24 int print_gfx(struct pci_dev
*gfx
)
30 printf ("No IGD found\n");
33 printf("\n============= IGD ==============\n\n");
34 mmio_phys
= gfx
->base_addr
[0] & ~0x7ULL
;
35 printf("IGD MMIO = 0x%08llx (MEM)\n\n", (unsigned long long)mmio_phys
);
36 mmio
= map_physical(mmio_phys
, MMIO_SIZE
);
38 perror("Error mapping MMIO");
41 for (i
= 0; i
< MMIO_SIZE
; i
+= 4) {
42 if (*(uint32_t *)(mmio
+ i
))
43 printf("0x%06x: 0x%08x\n", i
, *(uint32_t *)(mmio
+ i
));
45 unmap_physical((void *)mmio
, MMIO_SIZE
);