cyrix6x86_cpu_setup: Save and restore the original value of CCR3

across the "coma bug" workaround to avoid clearing the MAPEN bit if it
was originally set by firmware. This appears necessary for proper
functioning of SMM on Geode CPUs, and thus for proper emulation (ugh)
of access to certain PCI configuration registers or VGA register
spaces. With this change, VGA and soundblaster emulation work on Geode
NX1 systems.

This was also the underlying problem that led to the introduction of
the PCI_QUIRK_SKIP_FUNCn quirks in pci_quirks.c, which are no longer
necessary (and counterproductive if you want to use VGA or a
Geode-specific audio driver). See the thread "pci probe" on port-i386
in August 2003 (The Soekris 4801, apparantly the most popular
Geode-based NetBSD box, has neither VGA nor audio, which may explain
why this wasn't noticed at the time).
This commit is contained in:
nathanw 2004-07-10 21:25:53 +00:00
parent cb111b5e34
commit 7e753fcf97

View File

@ -1,4 +1,4 @@
/* $NetBSD: identcpu.c,v 1.13 2004/04/30 02:05:43 lukem Exp $ */
/* $NetBSD: identcpu.c,v 1.14 2004/07/10 21:25:53 nathanw Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.13 2004/04/30 02:05:43 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.14 2004/07/10 21:25:53 nathanw Exp $");
#include "opt_cputype.h"
#include "opt_enhanced_speedstep.h"
@ -551,6 +551,7 @@ cyrix6x86_cpu_setup(ci)
*/
extern int clock_broken_latch;
u_char c3;
switch (ci->ci_signature) {
case 0x440: /* Cyrix MediaGX */
@ -563,14 +564,15 @@ cyrix6x86_cpu_setup(ci)
/* Enable suspend on halt */
cyrix_write_reg(0xc2, cyrix_read_reg(0xc2) | 0x08);
/* enable access to ccr4/ccr5 */
cyrix_write_reg(0xC3, cyrix_read_reg(0xC3) | 0x10);
c3 = cyrix_read_reg(0xC3);
cyrix_write_reg(0xC3, c3 | 0x10);
/* cyrix's workaround for the "coma bug" */
cyrix_write_reg(0x31, cyrix_read_reg(0x31) | 0xf8);
cyrix_write_reg(0x32, cyrix_read_reg(0x32) | 0x7f);
cyrix_write_reg(0x33, cyrix_read_reg(0x33) & ~0xff);
cyrix_write_reg(0x3c, cyrix_read_reg(0x3c) | 0x87);
/* disable access to ccr4/ccr5 */
cyrix_write_reg(0xC3, cyrix_read_reg(0xC3) & ~0x10);
cyrix_write_reg(0xC3, c3);
/*
* XXX disable page zero in the idle loop, it seems to