Stefan Reinauer | 2319027 | 2008-08-20 13:41:24 +0000 | [diff] [blame] | 1 | /* |
| 2 | * inteltool - dump all registers on an Intel CPU + chipset based system. |
| 3 | * |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 4 | * Copyright (C) 2008 by coresystems GmbH |
| 5 | * written by Stefan Reinauer <stepan@coresystems.de> |
| 6 | * |
Stefan Reinauer | 2319027 | 2008-08-20 13:41:24 +0000 | [diff] [blame] | 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. |
| 10 | * |
| 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. |
Stefan Reinauer | 2319027 | 2008-08-20 13:41:24 +0000 | [diff] [blame] | 15 | */ |
| 16 | |
Stefan Reinauer | 2319027 | 2008-08-20 13:41:24 +0000 | [diff] [blame] | 17 | #include <stdio.h> |
Stefan Reinauer | 2319027 | 2008-08-20 13:41:24 +0000 | [diff] [blame] | 18 | #include <stdlib.h> |
Stefan Reinauer | 2319027 | 2008-08-20 13:41:24 +0000 | [diff] [blame] | 19 | #include "inteltool.h" |
| 20 | |
| 21 | int print_rcba(struct pci_dev *sb) |
| 22 | { |
| 23 | int i, size = 0x4000; |
| 24 | volatile uint8_t *rcba; |
| 25 | uint32_t rcba_phys; |
| 26 | |
| 27 | printf("\n============= RCBA ==============\n\n"); |
| 28 | |
| 29 | switch (sb->device_id) { |
Pat Erley | ca3548e | 2010-04-21 06:23:19 +0000 | [diff] [blame] | 30 | case PCI_DEVICE_ID_INTEL_ICH6: |
Stefan Reinauer | 2319027 | 2008-08-20 13:41:24 +0000 | [diff] [blame] | 31 | case PCI_DEVICE_ID_INTEL_ICH7: |
| 32 | case PCI_DEVICE_ID_INTEL_ICH7M: |
| 33 | case PCI_DEVICE_ID_INTEL_ICH7DH: |
| 34 | case PCI_DEVICE_ID_INTEL_ICH7MDH: |
Warren Turkal | f3d3ced | 2010-09-03 09:33:50 +0000 | [diff] [blame] | 35 | case PCI_DEVICE_ID_INTEL_ICH8: |
| 36 | case PCI_DEVICE_ID_INTEL_ICH8M: |
Lubomir Rintel | 2a13bad | 2015-03-01 10:14:15 +0100 | [diff] [blame] | 37 | case PCI_DEVICE_ID_INTEL_ICH8ME: |
Anton Kochkov | da0b456 | 2010-05-30 12:33:12 +0000 | [diff] [blame] | 38 | case PCI_DEVICE_ID_INTEL_ICH9DH: |
| 39 | case PCI_DEVICE_ID_INTEL_ICH9DO: |
| 40 | case PCI_DEVICE_ID_INTEL_ICH9R: |
| 41 | case PCI_DEVICE_ID_INTEL_ICH9: |
| 42 | case PCI_DEVICE_ID_INTEL_ICH9M: |
| 43 | case PCI_DEVICE_ID_INTEL_ICH9ME: |
Warren Turkal | f3d3ced | 2010-09-03 09:33:50 +0000 | [diff] [blame] | 44 | case PCI_DEVICE_ID_INTEL_ICH10R: |
Corey Osgood | f366ce0 | 2010-08-17 08:33:44 +0000 | [diff] [blame] | 45 | case PCI_DEVICE_ID_INTEL_NM10: |
Sven Schnelle | 54a5aed | 2011-10-30 13:30:36 +0100 | [diff] [blame] | 46 | case PCI_DEVICE_ID_INTEL_I63XX: |
Stefan Tauner | 088f569 | 2013-05-28 11:30:25 +0200 | [diff] [blame] | 47 | case PCI_DEVICE_ID_INTEL_3400: |
| 48 | case PCI_DEVICE_ID_INTEL_3420: |
| 49 | case PCI_DEVICE_ID_INTEL_3450: |
Stefan Tauner | b75a39a | 2014-11-01 17:12:37 +0100 | [diff] [blame] | 50 | case PCI_DEVICE_ID_INTEL_3400_DESKTOP: |
| 51 | case PCI_DEVICE_ID_INTEL_3400_MOBILE: |
| 52 | case PCI_DEVICE_ID_INTEL_3400_MOBILE_SFF: |
| 53 | case PCI_DEVICE_ID_INTEL_B55_A: |
Stefan Tauner | 088f569 | 2013-05-28 11:30:25 +0200 | [diff] [blame] | 54 | case PCI_DEVICE_ID_INTEL_B55_B: |
Stefan Tauner | b75a39a | 2014-11-01 17:12:37 +0100 | [diff] [blame] | 55 | case PCI_DEVICE_ID_INTEL_H55: |
| 56 | case PCI_DEVICE_ID_INTEL_H57: |
| 57 | case PCI_DEVICE_ID_INTEL_HM55: |
| 58 | case PCI_DEVICE_ID_INTEL_HM57: |
| 59 | case PCI_DEVICE_ID_INTEL_P55: |
| 60 | case PCI_DEVICE_ID_INTEL_PM55: |
| 61 | case PCI_DEVICE_ID_INTEL_Q57: |
| 62 | case PCI_DEVICE_ID_INTEL_QM57: |
| 63 | case PCI_DEVICE_ID_INTEL_QS57: |
Nico Huber | 14290b3 | 2013-03-29 19:08:39 +0100 | [diff] [blame] | 64 | case PCI_DEVICE_ID_INTEL_Z68: |
| 65 | case PCI_DEVICE_ID_INTEL_P67: |
| 66 | case PCI_DEVICE_ID_INTEL_UM67: |
| 67 | case PCI_DEVICE_ID_INTEL_HM65: |
| 68 | case PCI_DEVICE_ID_INTEL_H67: |
| 69 | case PCI_DEVICE_ID_INTEL_HM67: |
| 70 | case PCI_DEVICE_ID_INTEL_Q65: |
| 71 | case PCI_DEVICE_ID_INTEL_QS67: |
| 72 | case PCI_DEVICE_ID_INTEL_Q67: |
| 73 | case PCI_DEVICE_ID_INTEL_QM67: |
| 74 | case PCI_DEVICE_ID_INTEL_B65: |
| 75 | case PCI_DEVICE_ID_INTEL_C202: |
| 76 | case PCI_DEVICE_ID_INTEL_C204: |
| 77 | case PCI_DEVICE_ID_INTEL_C206: |
| 78 | case PCI_DEVICE_ID_INTEL_H61: |
| 79 | case PCI_DEVICE_ID_INTEL_Z77: |
| 80 | case PCI_DEVICE_ID_INTEL_Z75: |
| 81 | case PCI_DEVICE_ID_INTEL_Q77: |
| 82 | case PCI_DEVICE_ID_INTEL_Q75: |
| 83 | case PCI_DEVICE_ID_INTEL_B75: |
| 84 | case PCI_DEVICE_ID_INTEL_H77: |
| 85 | case PCI_DEVICE_ID_INTEL_C216: |
| 86 | case PCI_DEVICE_ID_INTEL_QM77: |
| 87 | case PCI_DEVICE_ID_INTEL_QS77: |
| 88 | case PCI_DEVICE_ID_INTEL_HM77: |
| 89 | case PCI_DEVICE_ID_INTEL_UM77: |
| 90 | case PCI_DEVICE_ID_INTEL_HM76: |
| 91 | case PCI_DEVICE_ID_INTEL_HM75: |
| 92 | case PCI_DEVICE_ID_INTEL_HM70: |
Alexandru Gagniuc | f14bd79 | 2015-02-17 17:14:31 -0600 | [diff] [blame] | 93 | case PCI_DEVICE_ID_INTEL_NM70: |
Dennis Wassenberg | ae6685f | 2014-10-30 10:30:40 +0100 | [diff] [blame] | 94 | case PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_FULL: |
| 95 | case PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_PREM: |
| 96 | case PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_BASE: |
Matt DeVillier | 5b667df | 2015-05-14 21:58:33 -0500 | [diff] [blame] | 97 | case PCI_DEVICE_ID_INTEL_WILDCATPOINT_LP: |
Stefan Reinauer | 2319027 | 2008-08-20 13:41:24 +0000 | [diff] [blame] | 98 | rcba_phys = pci_read_long(sb, 0xf0) & 0xfffffffe; |
| 99 | break; |
| 100 | case PCI_DEVICE_ID_INTEL_ICH: |
| 101 | case PCI_DEVICE_ID_INTEL_ICH0: |
Joseph Smith | e10757e | 2010-06-16 22:21:19 +0000 | [diff] [blame] | 102 | case PCI_DEVICE_ID_INTEL_ICH2: |
Stefan Reinauer | 2319027 | 2008-08-20 13:41:24 +0000 | [diff] [blame] | 103 | case PCI_DEVICE_ID_INTEL_ICH4: |
| 104 | case PCI_DEVICE_ID_INTEL_ICH4M: |
Idwer Vollering | 312fc96 | 2010-12-17 22:34:58 +0000 | [diff] [blame] | 105 | case PCI_DEVICE_ID_INTEL_ICH5: |
Stefan Reinauer | 2319027 | 2008-08-20 13:41:24 +0000 | [diff] [blame] | 106 | printf("This southbridge does not have RCBA.\n"); |
| 107 | return 1; |
| 108 | default: |
| 109 | printf("Error: Dumping RCBA on this southbridge is not (yet) supported.\n"); |
| 110 | return 1; |
| 111 | } |
| 112 | |
Stefan Reinauer | 1162f25 | 2008-12-04 15:18:20 +0000 | [diff] [blame] | 113 | rcba = map_physical(rcba_phys, size); |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 114 | |
Stefan Reinauer | 1162f25 | 2008-12-04 15:18:20 +0000 | [diff] [blame] | 115 | if (rcba == NULL) { |
Stefan Reinauer | 2319027 | 2008-08-20 13:41:24 +0000 | [diff] [blame] | 116 | perror("Error mapping RCBA"); |
| 117 | exit(1); |
| 118 | } |
| 119 | |
| 120 | printf("RCBA = 0x%08x (MEM)\n\n", rcba_phys); |
| 121 | |
| 122 | for (i = 0; i < size; i += 4) { |
| 123 | if (*(uint32_t *)(rcba + i)) |
| 124 | printf("0x%04x: 0x%08x\n", i, *(uint32_t *)(rcba + i)); |
| 125 | } |
| 126 | |
Stefan Reinauer | 1162f25 | 2008-12-04 15:18:20 +0000 | [diff] [blame] | 127 | unmap_physical((void *)rcba, size); |
Stefan Reinauer | 2319027 | 2008-08-20 13:41:24 +0000 | [diff] [blame] | 128 | return 0; |
| 129 | } |