The new resource allocator helped me find a bug in SB600 diagnostics.
[coreboot.git] / src / southbridge / amd / sb600 / sb600_reset.c
index d46f734c3d17d7e571ad5a2bdc9597d86b45e857..d6ea995a5cb13f065f5d4ef81fea0f51ba875235 100644 (file)
        (((DEV) & 0x1F) << 15) | \
        (((FN)  & 0x7) << 12))
 
-typedef unsigned device_t;
+typedef u32 device_t;
+
+static void pci_write_config8(device_t dev, unsigned where, unsigned char value)
+{
+        unsigned addr;
+        addr = (dev>>4) | where;
+        outl(0x80000000 | (addr & ~3), 0xCF8);
+        outb(value, 0xCFC + (addr & 3));
+}
+
+static void pci_write_config32(device_t dev, unsigned where, unsigned value)
+{
+       unsigned addr;
+        addr = (dev>>4) | where;
+        outl(0x80000000 | (addr & ~3), 0xCF8);
+        outl(value, 0xCFC);
+}
+
+static unsigned pci_read_config32(device_t dev, unsigned where)
+{
+       unsigned addr;
+        addr = (dev>>4) | where;
+        outl(0x80000000 | (addr & ~3), 0xCF8);
+        return inl(0xCFC);
+}
 
 #include "../../../northbridge/amd/amdk8/reset_test.c"