blob: b67e230b9a3915c5731c71fc4e153d57f8d72e83 [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:
Stefan Reinauer1162f252008-12-04 15:18:20 +000039 case PCI_DEVICE_ID_INTEL_ICH8M:
Stefan Reinauer23190272008-08-20 13:41:24 +000040 rcba_phys = pci_read_long(sb, 0xf0) & 0xfffffffe;
41 break;
42 case PCI_DEVICE_ID_INTEL_ICH:
43 case PCI_DEVICE_ID_INTEL_ICH0:
44 case PCI_DEVICE_ID_INTEL_ICH4:
45 case PCI_DEVICE_ID_INTEL_ICH4M:
46 printf("This southbridge does not have RCBA.\n");
47 return 1;
48 default:
49 printf("Error: Dumping RCBA on this southbridge is not (yet) supported.\n");
50 return 1;
51 }
52
Stefan Reinauer1162f252008-12-04 15:18:20 +000053 rcba = map_physical(rcba_phys, size);
Stefan Reinauer14e22772010-04-27 06:56:47 +000054
Stefan Reinauer1162f252008-12-04 15:18:20 +000055 if (rcba == NULL) {
Stefan Reinauer23190272008-08-20 13:41:24 +000056 perror("Error mapping RCBA");
57 exit(1);
58 }
59
60 printf("RCBA = 0x%08x (MEM)\n\n", rcba_phys);
61
62 for (i = 0; i < size; i += 4) {
63 if (*(uint32_t *)(rcba + i))
64 printf("0x%04x: 0x%08x\n", i, *(uint32_t *)(rcba + i));
65 }
66
Stefan Reinauer1162f252008-12-04 15:18:20 +000067 unmap_physical((void *)rcba, size);
Stefan Reinauer23190272008-08-20 13:41:24 +000068 return 0;
69}
70