blob: f57e773935499a30b461c8b31c45779f1b09db54 [file] [log] [blame]
Stefan Reinauer23190272008-08-20 13:41:24 +00001/*
2 * inteltool - dump all registers on an Intel CPU + chipset based system.
3 *
Stefan Reinauer14e22772010-04-27 06:56:47 +00004 * Copyright (C) 2008 by coresystems GmbH
5 * written by Stefan Reinauer <stepan@coresystems.de>
6 *
Stefan Reinauer23190272008-08-20 13:41:24 +00007 * 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.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
Stefan Reinauer23190272008-08-20 13:41:24 +000021#include <stdio.h>
Stefan Reinauer23190272008-08-20 13:41:24 +000022#include <stdlib.h>
Stefan Reinauer23190272008-08-20 13:41:24 +000023#include "inteltool.h"
24
25int print_rcba(struct pci_dev *sb)
26{
27 int i, size = 0x4000;
28 volatile uint8_t *rcba;
29 uint32_t rcba_phys;
30
31 printf("\n============= RCBA ==============\n\n");
32
33 switch (sb->device_id) {
Pat Erleyca3548e2010-04-21 06:23:19 +000034 case PCI_DEVICE_ID_INTEL_ICH6:
Stefan Reinauer23190272008-08-20 13:41:24 +000035 case PCI_DEVICE_ID_INTEL_ICH7:
36 case PCI_DEVICE_ID_INTEL_ICH7M:
37 case PCI_DEVICE_ID_INTEL_ICH7DH:
38 case PCI_DEVICE_ID_INTEL_ICH7MDH:
Warren Turkalf3d3ced2010-09-03 09:33:50 +000039 case PCI_DEVICE_ID_INTEL_ICH8:
40 case PCI_DEVICE_ID_INTEL_ICH8M:
Lubomir Rintel2a13bad2015-03-01 10:14:15 +010041 case PCI_DEVICE_ID_INTEL_ICH8ME:
Anton Kochkovda0b4562010-05-30 12:33:12 +000042 case PCI_DEVICE_ID_INTEL_ICH9DH:
43 case PCI_DEVICE_ID_INTEL_ICH9DO:
44 case PCI_DEVICE_ID_INTEL_ICH9R:
45 case PCI_DEVICE_ID_INTEL_ICH9:
46 case PCI_DEVICE_ID_INTEL_ICH9M:
47 case PCI_DEVICE_ID_INTEL_ICH9ME:
Warren Turkalf3d3ced2010-09-03 09:33:50 +000048 case PCI_DEVICE_ID_INTEL_ICH10R:
Corey Osgoodf366ce02010-08-17 08:33:44 +000049 case PCI_DEVICE_ID_INTEL_NM10:
Sven Schnelle54a5aed2011-10-30 13:30:36 +010050 case PCI_DEVICE_ID_INTEL_I63XX:
Stefan Tauner088f5692013-05-28 11:30:25 +020051 case PCI_DEVICE_ID_INTEL_3400:
52 case PCI_DEVICE_ID_INTEL_3420:
53 case PCI_DEVICE_ID_INTEL_3450:
Stefan Taunerb75a39a2014-11-01 17:12:37 +010054 case PCI_DEVICE_ID_INTEL_3400_DESKTOP:
55 case PCI_DEVICE_ID_INTEL_3400_MOBILE:
56 case PCI_DEVICE_ID_INTEL_3400_MOBILE_SFF:
57 case PCI_DEVICE_ID_INTEL_B55_A:
Stefan Tauner088f5692013-05-28 11:30:25 +020058 case PCI_DEVICE_ID_INTEL_B55_B:
Stefan Taunerb75a39a2014-11-01 17:12:37 +010059 case PCI_DEVICE_ID_INTEL_H55:
60 case PCI_DEVICE_ID_INTEL_H57:
61 case PCI_DEVICE_ID_INTEL_HM55:
62 case PCI_DEVICE_ID_INTEL_HM57:
63 case PCI_DEVICE_ID_INTEL_P55:
64 case PCI_DEVICE_ID_INTEL_PM55:
65 case PCI_DEVICE_ID_INTEL_Q57:
66 case PCI_DEVICE_ID_INTEL_QM57:
67 case PCI_DEVICE_ID_INTEL_QS57:
Nico Huber14290b32013-03-29 19:08:39 +010068 case PCI_DEVICE_ID_INTEL_Z68:
69 case PCI_DEVICE_ID_INTEL_P67:
70 case PCI_DEVICE_ID_INTEL_UM67:
71 case PCI_DEVICE_ID_INTEL_HM65:
72 case PCI_DEVICE_ID_INTEL_H67:
73 case PCI_DEVICE_ID_INTEL_HM67:
74 case PCI_DEVICE_ID_INTEL_Q65:
75 case PCI_DEVICE_ID_INTEL_QS67:
76 case PCI_DEVICE_ID_INTEL_Q67:
77 case PCI_DEVICE_ID_INTEL_QM67:
78 case PCI_DEVICE_ID_INTEL_B65:
79 case PCI_DEVICE_ID_INTEL_C202:
80 case PCI_DEVICE_ID_INTEL_C204:
81 case PCI_DEVICE_ID_INTEL_C206:
82 case PCI_DEVICE_ID_INTEL_H61:
83 case PCI_DEVICE_ID_INTEL_Z77:
84 case PCI_DEVICE_ID_INTEL_Z75:
85 case PCI_DEVICE_ID_INTEL_Q77:
86 case PCI_DEVICE_ID_INTEL_Q75:
87 case PCI_DEVICE_ID_INTEL_B75:
88 case PCI_DEVICE_ID_INTEL_H77:
89 case PCI_DEVICE_ID_INTEL_C216:
90 case PCI_DEVICE_ID_INTEL_QM77:
91 case PCI_DEVICE_ID_INTEL_QS77:
92 case PCI_DEVICE_ID_INTEL_HM77:
93 case PCI_DEVICE_ID_INTEL_UM77:
94 case PCI_DEVICE_ID_INTEL_HM76:
95 case PCI_DEVICE_ID_INTEL_HM75:
96 case PCI_DEVICE_ID_INTEL_HM70:
Alexandru Gagniucf14bd792015-02-17 17:14:31 -060097 case PCI_DEVICE_ID_INTEL_NM70:
Dennis Wassenbergae6685f2014-10-30 10:30:40 +010098 case PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_FULL:
99 case PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_PREM:
100 case PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_BASE:
Stefan Reinauer23190272008-08-20 13:41:24 +0000101 rcba_phys = pci_read_long(sb, 0xf0) & 0xfffffffe;
102 break;
103 case PCI_DEVICE_ID_INTEL_ICH:
104 case PCI_DEVICE_ID_INTEL_ICH0:
Joseph Smithe10757e2010-06-16 22:21:19 +0000105 case PCI_DEVICE_ID_INTEL_ICH2:
Stefan Reinauer23190272008-08-20 13:41:24 +0000106 case PCI_DEVICE_ID_INTEL_ICH4:
107 case PCI_DEVICE_ID_INTEL_ICH4M:
Idwer Vollering312fc962010-12-17 22:34:58 +0000108 case PCI_DEVICE_ID_INTEL_ICH5:
Stefan Reinauer23190272008-08-20 13:41:24 +0000109 printf("This southbridge does not have RCBA.\n");
110 return 1;
111 default:
112 printf("Error: Dumping RCBA on this southbridge is not (yet) supported.\n");
113 return 1;
114 }
115
Stefan Reinauer1162f252008-12-04 15:18:20 +0000116 rcba = map_physical(rcba_phys, size);
Stefan Reinauer14e22772010-04-27 06:56:47 +0000117
Stefan Reinauer1162f252008-12-04 15:18:20 +0000118 if (rcba == NULL) {
Stefan Reinauer23190272008-08-20 13:41:24 +0000119 perror("Error mapping RCBA");
120 exit(1);
121 }
122
123 printf("RCBA = 0x%08x (MEM)\n\n", rcba_phys);
124
125 for (i = 0; i < size; i += 4) {
126 if (*(uint32_t *)(rcba + i))
127 printf("0x%04x: 0x%08x\n", i, *(uint32_t *)(rcba + i));
128 }
129
Stefan Reinauer1162f252008-12-04 15:18:20 +0000130 unmap_physical((void *)rcba, size);
Stefan Reinauer23190272008-08-20 13:41:24 +0000131 return 0;
132}