On Sat, Apr 5, 2008 at 11:06 PM,  <<a href="mailto:joe@smittys.pointclark.net">joe@smittys.pointclark.net</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">Quoting Corey Osgood <<a href="mailto:corey.osgood@gmail.com" target="_blank">corey.osgood@gmail.com</a>>:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
On Sat, Apr 5, 2008 at 8:24 PM, <<a href="mailto:joe@smittys.pointclark.net" target="_blank">joe@smittys.pointclark.net</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
This patch halts the tco timer early in the boot process on all ICH series<br>
southbridges. It also keeps the boot processes from rebooting through out<br>
the coreboot process.<br>
<br>
Signed-off-by: Joseph Smith <<a href="mailto:joe@smittys.pointclark.net" target="_blank">joe@smittys.pointclark.net</a>><br>
<br>
Thanks - Joe<br>
</blockquote>
<br>
<br>
Index: src/southbridge/intel/i82801xx/i82801xx_early_lpc.c<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
===================================================================<br>
--- src/southbridge/intel/i82801xx/i82801xx_early_lpc.c    (revision 0)<br>
+++ src/southbridge/intel/i82801xx/i82801xx_early_lpc.c    (revision 0)<br>
@@ -0,0 +1,44 @@<br>
+/*<br>
+ * This file is part of the coreboot project.<br>
+ *<br>
+ * Copyright (C) 2008 Joseph Smith <<a href="mailto:joe@smittys.pointclark.net" target="_blank">joe@smittys.pointclark.net</a>><br>
+ *<br>
+ * This program is free software; you can redistribute it and/or modify<br>
+ * it under the terms of the GNU General Public License version 2 as<br>
+ * published by the Free Software Foundation.<br>
+ *<br>
+ * This program is distributed in the hope that it will be useful,<br>
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br>
+ * GNU General Public License for more details.<br>
+ *<br>
+ * You should have received a copy of the GNU General Public License<br>
+ * along with this program; if not, write to the Free Software<br>
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301<br>
USA<br>
+ *<br>
+ */<br>
+<br>
+#define PMBASE_ADDR    0x0400 /* ACPI Base Address Register */<br>
+#define TCOBASE        0x60 /* TCO Base Address Register */<br>
+#define TCO1_CNT    0x08 /* TCO1 Control Register */<br>
</blockquote>
<br>
<br>
These should go into i82801xx.h, along with the defines in i82801xx_lpc.h.<br>
Do that, and this patch is<br>
Acked-by: Corey Osgood <<a href="mailto:corey.osgood@gmail.com" target="_blank">corey.osgood@gmail.com</a>><br>
<br>
</blockquote></div></div>
I can move the TCOBASE TCO1_CNT to i82801xx.h because these are static but,<br>
PMBASE_ADDR is a variable and should not be placed in a header file correct?</blockquote><div><br>PMBASE_ADDR can be anywhere we want it to be, so long as it doesn't collide with any IO addresses that have been reserved for other things. Currently, it's defined in i82801xx_lpc.c at the same address, that's why I was saying to move those defines as well (so PMBASE_ADDR isn't defined in 2 different places). If PMBASE_ADDR ever needs to be somewhere else for some reason in the future, we can make it configurable at build time (or something).<br>
<br>-Corey<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="Wj3C7c"><br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
+<br>
+static void i82801xx_halt_tco_timer(void)<br>
+{<br>
+    device_t dev;<br>
+    uint16_t halt_tco_timer;<br>
+<br>
+    /* Set the LPC device statically. */<br>
+    dev = PCI_DEV(0x0, 0x1f, 0x0);<br>
+<br>
+    /* Temporarily set ACPI base address (I/O space). */<br>
+    pci_write_config32(dev, PMBASE, (PMBASE_ADDR | 1));<br>
<br>
</blockquote>
+<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
+    /* Temporarily enable ACPI I/O. */<br>
+    pci_write_config8(dev, ACPI_CNTL, 0x10);<br>
+<br>
+    /* Halt the TCO timer, preventing SMI and automatic reboot */<br>
+    outw(inw(PMBASE_ADDR + TCOBASE + TCO1_CNT) | (1 << 11), PMBASE_ADDR +<br>
TCOBASE + TCO1_CNT);<br>
+<br>
+    /* Disable ACPI I/O. */<br>
+    pci_write_config8(dev, ACPI_CNTL, 0x00);<br>
+}<br>
Index: src/mainboard/rca/rm4100/auto.c<br>
===================================================================<br>
--- src/mainboard/rca/rm4100/auto.c    (revision 3217)<br>
+++ src/mainboard/rca/rm4100/auto.c    (working copy)<br>
@@ -42,6 +42,7 @@<br>
 #define SERIAL_DEV PNP_DEV(0x2e, SMSCSUPERIO_SP1)<br>
<br>
 #include "southbridge/intel/i82801xx/i82801xx_early_smbus.c"<br>
+#include "southbridge/intel/i82801xx/i82801xx_early_lpc.c"<br>
<br>
 /**<br>
  * The onboard 128MB PC133 memory does not have a SPD EEPROM so the<br>
@@ -69,24 +70,6 @@<br>
 #include "sdram/generic_sdram.c"<br>
<br>
 /**<br>
- * We have to disable the TCO Timer system reboot feature<br>
- * or we get several reboots through out the boot processes.<br>
- */<br>
-static void disable_tco_timer(void)<br>
-{<br>
-    device_t dev;<br>
-    u8 reg8;<br>
-<br>
-    /* Set the LPC device statically. */<br>
-    dev = PCI_DEV(0x0, 0x1f, 0x0);<br>
-<br>
-    /* Disable the TCO Timer system reboot feature. */<br>
-    reg8 = pci_read_config8(dev, 0xd4);<br>
-    reg8 |= (1 << 1);<br>
-    pci_write_config8(dev, 0xd4, reg8);<br>
-}<br>
-<br>
-/**<br>
  * The AC'97 Audio Controller I/O space registers are read only by<br>
default<br>
  * so we need to enable them by setting register 0x41 to 0x01.<br>
  */<br>
@@ -131,6 +114,6 @@<br>
     /* ram_check(0, 640 * 1024); */<br>
     /* ram_check(130048 * 1024, 131072 * 1024); */<br>
<br>
-    disable_tco_timer();<br>
+    i82801xx_halt_tco_timer();<br>
     ac97_io_enable();<br>
 }<br>
<br>
</blockquote>
<br>
</blockquote>
<br>
<br>
<br></div></div>
Thanks - Joe<br>
</blockquote></div><br>