Following patch adds support for resume on VT8237 based motherboards. The NB
[coreboot.git] / src / southbridge / via / k8t890 / k8t890_host_ctrl.c
index f2bc88ad65d7da584b2810cdef899a820eb81cd1..9ed89eba12124fbe0eb8b08d885e8f3f27730a03 100644 (file)
@@ -22,6 +22,7 @@
 #include <device/pci_ops.h>
 #include <device/pci_ids.h>
 #include <console/console.h>
+#include "k8t890.h"
 
 /* this may be later merged */
 
@@ -36,14 +37,14 @@ static void host_ctrl_enable_k8t890(struct device *dev)
         */
        pci_write_config8(dev, 0xa0, 0x13);
 
-       /* Disable NVRAM and enable non-posted PCI writes. */
-       pci_write_config8(dev, 0xa1, 0x8e);
-
        /*
-        * NVRAM I/O base 0xe00-0xeff, but it is disabled.
+        * NVRAM I/O base at K8T890_NVRAM_IO_BASE
         * Some bits are set and reserved.
         */
-       pci_write_config8(dev, 0xa2, 0x0e);
+       pci_write_config8(dev, 0xa2, (K8T890_NVRAM_IO_BASE >> 8));
+
+       /* enable NB NVRAM and enable non-posted PCI writes. */
+       pci_write_config8(dev, 0xa1, 0x8f);
        /* Arbitration control, some bits are reserved. */
        pci_write_config8(dev, 0xa5, 0x3c);
 
@@ -94,19 +95,20 @@ static void host_ctrl_enable_k8m890(struct device *dev) {
         */
        pci_write_config8(dev, 0xa0, 0x13);
 
-       /* Disable NVRAM and enable non-posted PCI writes. */
-       pci_write_config8(dev, 0xa1, 0x8e);
-
        /*
-        * NVRAM I/O base 0xe00-0xeff, but it is disabled.
+        * NVRAM I/O base at K8T890_NVRAM_IO_BASE
         */
 
-       pci_write_config8(dev, 0xa2, 0x0e);
+       pci_write_config8(dev, 0xa2, (K8T890_NVRAM_IO_BASE >> 8));
+
+       /* Enable NVRAM and enable non-posted PCI writes. */
+       pci_write_config8(dev, 0xa1, 0x8f);
+
        /* Arbitration control  */
        pci_write_config8(dev, 0xa5, 0x3c);
 
-       /* Arbitration control 2 */
-       pci_write_config8(dev, 0xa6, 0x82);
+       /* Arbitration control 2, Enable C2NOW delay to PSTATECTL */
+       pci_write_config8(dev, 0xa6, 0x83);
 
 }