summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2004-01-12 08:09:23 +0000
committerderaadt <deraadt@openbsd.org>2004-01-12 08:09:23 +0000
commitc3210af1ff43ff5ce85691fd1b8d1bd06e291a90 (patch)
tree23d96e65775c88ff393896a5c6740c0d265da240
parentGet rid of that ugly m88100_saved_state structure, use trapframe everywhere (diff)
downloadwireguard-openbsd-c3210af1ff43ff5ce85691fd1b8d1bd06e291a90.tar.xz
wireguard-openbsd-c3210af1ff43ff5ce85691fd1b8d1bd06e291a90.zip
a native geode reset, because quite a few geode boards without keyboard
controllers are showing up; various ok
-rw-r--r--sys/arch/i386/i386/machdep.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c
index bf5d19fb34c..d75abf64b9e 100644
--- a/sys/arch/i386/i386/machdep.c
+++ b/sys/arch/i386/i386/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.260 2004/01/06 21:09:20 tedu Exp $ */
+/* $OpenBSD: machdep.c,v 1.261 2004/01/12 08:09:23 deraadt Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -271,6 +271,7 @@ int cpu_dump(void);
void identifycpu(void);
void init386(paddr_t);
void consinit(void);
+void (*cpuresetfn)(void);
int bus_mem_add_mapping(bus_addr_t, bus_size_t,
int, bus_space_handle_t *);
@@ -1596,6 +1597,19 @@ cyrix6x86_cpu_setup(cpu_device, model, step)
#endif
}
+#if defined(I586_CPU) || defined(I686_CPU)
+void natsem6x86_cpureset(void);
+
+void
+natsem6x86_cpureset(void)
+{
+ /* reset control SC1100 (datasheet page 170) */
+ outl(0xCF8, 0x80009044UL);
+ /* system wide reset */
+ outb(0xCFC, 0x0F);
+}
+#endif
+
void
natsem6x86_cpu_setup(cpu_device, model, step)
const char *cpu_device;
@@ -1610,9 +1624,11 @@ natsem6x86_cpu_setup(cpu_device, model, step)
cpu_feature &= ~CPUID_TSC;
break;
}
+ cpuresetfn = natsem6x86_cpureset;
#endif
}
+
void
intel586_cpu_setup(cpu_device, model, step)
const char *cpu_device;
@@ -3060,6 +3076,9 @@ cpu_reset()
disable_intr();
+ if (cpuresetfn)
+ (*cpuresetfn)();
+
/* Toggle the hardware reset line on the keyboard controller. */
outb(IO_KBD + KBCMDP, KBC_PULSE0);
delay(100000);