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. |
| 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 Reinauer | 2319027 | 2008-08-20 13:41:24 +0000 | [diff] [blame] | 21 | #include <stdio.h> |
Stefan Reinauer | 2319027 | 2008-08-20 13:41:24 +0000 | [diff] [blame] | 22 | #include <stdlib.h> |
Stefan Reinauer | 2319027 | 2008-08-20 13:41:24 +0000 | [diff] [blame] | 23 | #include "inteltool.h" |
| 24 | |
| 25 | int 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 Erley | ca3548e | 2010-04-21 06:23:19 +0000 | [diff] [blame] | 34 | case PCI_DEVICE_ID_INTEL_ICH6: |
Stefan Reinauer | 2319027 | 2008-08-20 13:41:24 +0000 | [diff] [blame] | 35 | 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: |
Anton Kochkov | da0b456 | 2010-05-30 12:33:12 +0000 | [diff] [blame] | 39 | case PCI_DEVICE_ID_INTEL_ICH9DH: |
| 40 | case PCI_DEVICE_ID_INTEL_ICH9DO: |
| 41 | case PCI_DEVICE_ID_INTEL_ICH9R: |
| 42 | case PCI_DEVICE_ID_INTEL_ICH9: |
| 43 | case PCI_DEVICE_ID_INTEL_ICH9M: |
| 44 | case PCI_DEVICE_ID_INTEL_ICH9ME: |
Stefan Reinauer | 1162f25 | 2008-12-04 15:18:20 +0000 | [diff] [blame] | 45 | case PCI_DEVICE_ID_INTEL_ICH8M: |
Stefan Reinauer | 2319027 | 2008-08-20 13:41:24 +0000 | [diff] [blame] | 46 | rcba_phys = pci_read_long(sb, 0xf0) & 0xfffffffe; |
| 47 | break; |
| 48 | case PCI_DEVICE_ID_INTEL_ICH: |
| 49 | case PCI_DEVICE_ID_INTEL_ICH0: |
Joseph Smith | e10757e | 2010-06-16 22:21:19 +0000 | [diff] [blame] | 50 | case PCI_DEVICE_ID_INTEL_ICH2: |
Stefan Reinauer | 2319027 | 2008-08-20 13:41:24 +0000 | [diff] [blame] | 51 | case PCI_DEVICE_ID_INTEL_ICH4: |
| 52 | case PCI_DEVICE_ID_INTEL_ICH4M: |
| 53 | printf("This southbridge does not have RCBA.\n"); |
| 54 | return 1; |
| 55 | default: |
| 56 | printf("Error: Dumping RCBA on this southbridge is not (yet) supported.\n"); |
| 57 | return 1; |
| 58 | } |
| 59 | |
Stefan Reinauer | 1162f25 | 2008-12-04 15:18:20 +0000 | [diff] [blame] | 60 | rcba = map_physical(rcba_phys, size); |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 61 | |
Stefan Reinauer | 1162f25 | 2008-12-04 15:18:20 +0000 | [diff] [blame] | 62 | if (rcba == NULL) { |
Stefan Reinauer | 2319027 | 2008-08-20 13:41:24 +0000 | [diff] [blame] | 63 | perror("Error mapping RCBA"); |
| 64 | exit(1); |
| 65 | } |
| 66 | |
| 67 | printf("RCBA = 0x%08x (MEM)\n\n", rcba_phys); |
| 68 | |
| 69 | for (i = 0; i < size; i += 4) { |
| 70 | if (*(uint32_t *)(rcba + i)) |
| 71 | printf("0x%04x: 0x%08x\n", i, *(uint32_t *)(rcba + i)); |
| 72 | } |
| 73 | |
Stefan Reinauer | 1162f25 | 2008-12-04 15:18:20 +0000 | [diff] [blame] | 74 | unmap_physical((void *)rcba, size); |
Stefan Reinauer | 2319027 | 2008-08-20 13:41:24 +0000 | [diff] [blame] | 75 | return 0; |
| 76 | } |
| 77 | |