Enable -Werror for romcc
[coreboot.git] / util / inteltool / pcie.c
index b4ad7323534785a3a42dc6d0fb88ae09c9d2ac8c..ea238354254042611b588bee446c9ab662e41088 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <inttypes.h>
 #include "inteltool.h"
 
 /*
@@ -45,6 +46,8 @@ int print_epbar(struct pci_dev *nb)
        case PCI_DEVICE_ID_INTEL_82Q35:
        case PCI_DEVICE_ID_INTEL_82G33:
        case PCI_DEVICE_ID_INTEL_82Q33:
+       case PCI_DEVICE_ID_INTEL_X44:
+       case PCI_DEVICE_ID_INTEL_32X0:
        case PCI_DEVICE_ID_INTEL_GS45:
        case PCI_DEVICE_ID_INTEL_ATOM_DXXX:
        case PCI_DEVICE_ID_INTEL_ATOM_NXXX:
@@ -55,7 +58,8 @@ int print_epbar(struct pci_dev *nb)
        case PCI_DEVICE_ID_INTEL_82810DC:
        case PCI_DEVICE_ID_INTEL_82810E_MC:
        case PCI_DEVICE_ID_INTEL_82830M:
-               printf("This northbrigde does not have EPBAR.\n");
+       case PCI_DEVICE_ID_INTEL_82865:
+               printf("This northbridge does not have EPBAR.\n");
                return 1;
        default:
                printf("Error: Dumping EPBAR on this northbridge is not (yet) supported.\n");
@@ -69,7 +73,7 @@ int print_epbar(struct pci_dev *nb)
                exit(1);
        }
 
-       printf("EPBAR = 0x%08llx (MEM)\n\n", epbar_phys);
+       printf("EPBAR = 0x%08" PRIx64 " (MEM)\n\n", epbar_phys);
        for (i = 0; i < size; i += 4) {
                if (*(uint32_t *)(epbar + i))
                        printf("0x%04x: 0x%08x\n", i, *(uint32_t *)(epbar+i));
@@ -98,22 +102,28 @@ int print_dmibar(struct pci_dev *nb)
        case PCI_DEVICE_ID_INTEL_82975X:
                dmibar_phys = pci_read_long(nb, 0x4c) & 0xfffffffe;
                break;
-       case PCI_DEVICE_ID_INTEL_PM965:
+       case PCI_DEVICE_ID_INTEL_PM965:
        case PCI_DEVICE_ID_INTEL_Q965:
-       case PCI_DEVICE_ID_INTEL_82Q35:
-       case PCI_DEVICE_ID_INTEL_82G33:
-       case PCI_DEVICE_ID_INTEL_82Q33:
+       case PCI_DEVICE_ID_INTEL_82Q35:
+       case PCI_DEVICE_ID_INTEL_82G33:
+       case PCI_DEVICE_ID_INTEL_82Q33:
+       case PCI_DEVICE_ID_INTEL_X44:
+       case PCI_DEVICE_ID_INTEL_32X0:
        case PCI_DEVICE_ID_INTEL_GS45:
        case PCI_DEVICE_ID_INTEL_ATOM_DXXX:
        case PCI_DEVICE_ID_INTEL_ATOM_NXXX:
-               dmibar_phys = pci_read_long(nb, 0x68) & 0xfffffffe;
-               dmibar_phys |= ((uint64_t)pci_read_long(nb, 0x6c)) << 32;
-               break;
+               dmibar_phys = pci_read_long(nb, 0x68) & 0xfffffffe;
+               dmibar_phys |= ((uint64_t)pci_read_long(nb, 0x6c)) << 32;
+               break;
        case PCI_DEVICE_ID_INTEL_82810:
        case PCI_DEVICE_ID_INTEL_82810DC:
        case PCI_DEVICE_ID_INTEL_82810E_MC:
-               printf("This northbrigde does not have DMIBAR.\n");
+       case PCI_DEVICE_ID_INTEL_82865:
+               printf("This northbridge does not have DMIBAR.\n");
                return 1;
+       case PCI_DEVICE_ID_INTEL_X58:
+               dmibar_phys = pci_read_long(nb, 0x50) & 0xfffff000;
+               break;
        default:
                printf("Error: Dumping DMIBAR on this northbridge is not (yet) supported.\n");
                return 1;
@@ -126,7 +136,7 @@ int print_dmibar(struct pci_dev *nb)
                exit(1);
        }
 
-       printf("DMIBAR = 0x%08llx (MEM)\n\n", dmibar_phys);
+       printf("DMIBAR = 0x%08" PRIx64 " (MEM)\n\n", dmibar_phys);
        for (i = 0; i < size; i += 4) {
                if (*(uint32_t *)(dmibar + i))
                        printf("0x%04x: 0x%08x\n", i, *(uint32_t *)(dmibar+i));
@@ -162,6 +172,8 @@ int print_pciexbar(struct pci_dev *nb)
        case PCI_DEVICE_ID_INTEL_82Q35:
        case PCI_DEVICE_ID_INTEL_82G33:
        case PCI_DEVICE_ID_INTEL_82Q33:
+       case PCI_DEVICE_ID_INTEL_X44:
+       case PCI_DEVICE_ID_INTEL_32X0:
        case PCI_DEVICE_ID_INTEL_GS45:
        case PCI_DEVICE_ID_INTEL_ATOM_DXXX:
        case PCI_DEVICE_ID_INTEL_ATOM_NXXX:
@@ -171,7 +183,8 @@ int print_pciexbar(struct pci_dev *nb)
        case PCI_DEVICE_ID_INTEL_82810:
        case PCI_DEVICE_ID_INTEL_82810DC:
        case PCI_DEVICE_ID_INTEL_82810E_MC:
-               printf("Error: This northbrigde does not have PCIEXBAR.\n");
+       case PCI_DEVICE_ID_INTEL_82865:
+               printf("Error: This northbridge does not have PCIEXBAR.\n");
                return 1;
        default:
                printf("Error: Dumping PCIEXBAR on this northbridge is not (yet) supported.\n");
@@ -201,7 +214,7 @@ int print_pciexbar(struct pci_dev *nb)
                return 1;
        }
 
-       printf("PCIEXBAR: 0x%08llx\n", pciexbar_phys);
+       printf("PCIEXBAR: 0x%08" PRIx64 "\n", pciexbar_phys);
 
        pciexbar = map_physical(pciexbar_phys, (max_busses * 1024 * 1024));
 
@@ -242,5 +255,3 @@ int print_pciexbar(struct pci_dev *nb)
 
        return 0;
 }
-
-