@@ -48,13 +48,9 @@ static void bit_decode(uint32_t reg)
static void dump_range(uint32_t start, uint32_t end)
{
- int i, reg = 0;
- struct pci_device *dev = intel_get_pci_device();
- if (IS_CHERRYVIEW(dev->device_id) || IS_VALLEYVIEW(dev->device_id))
- reg = 0x180000;
+ int i;
for (i = start; i < end; i += 4)
- printf("0x%X : 0x%X\n", i,
- *(volatile uint32_t *)((volatile char*)mmio + i + reg));
+ printf("0x%X : 0x%X\n", i, intel_register_read(i+0x180000));
}
static void usage(char *cmdname)
@@ -76,7 +72,6 @@ int main(int argc, char** argv)
int full_dump = 0;
int decode_bits = 0;
int dwords = 1;
-
while ((ch = getopt(argc, argv, "dfhc:")) != -1) {
switch(ch) {
case 'd':
@@ -132,13 +127,7 @@ int main(int argc, char** argv)
dump_range(reg, reg + (dwords * 4));
if (decode_bits) {
- struct pci_device *dev = intel_get_pci_device();
- if (IS_CHERRYVIEW(dev->device_id) ||
- IS_VALLEYVIEW(dev->device_id)) {
- reg += 0x180000;
- bit_decode(*(volatile uint32_t *)
- ((volatile char*)mmio + reg));
- }
+ bit_decode(intel_register_read(0x180000));
}
}
}