From owner-freebsd-bugs@FreeBSD.ORG Fri Apr 9 05:30:16 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 53A9E16A4CF for ; Fri, 9 Apr 2004 05:30:16 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4A4A143D49 for ; Fri, 9 Apr 2004 05:30:16 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i39CUGbv036098 for ; Fri, 9 Apr 2004 05:30:16 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i39CUGNb036097; Fri, 9 Apr 2004 05:30:16 -0700 (PDT) (envelope-from gnats) Resent-Date: Fri, 9 Apr 2004 05:30:16 -0700 (PDT) Resent-Message-Id: <200404091230.i39CUGNb036097@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Milan Obuch Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6B66A16A4CF for ; Fri, 9 Apr 2004 05:24:00 -0700 (PDT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2812143D58 for ; Fri, 9 Apr 2004 05:24:00 -0700 (PDT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.12.10/8.12.10) with ESMTP id i39CNx72003057 for ; Fri, 9 Apr 2004 05:23:59 -0700 (PDT) (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.10/8.12.10/Submit) id i39CNxBD003044; Fri, 9 Apr 2004 05:23:59 -0700 (PDT) (envelope-from nobody) Message-Id: <200404091223.i39CNxBD003044@www.freebsd.org> Date: Fri, 9 Apr 2004 05:23:59 -0700 (PDT) From: Milan Obuch To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: kern/65355: TC1000 serial ports need enabling X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Apr 2004 12:30:16 -0000 >Number: 65355 >Category: kern >Synopsis: TC1000 serial ports need enabling >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Apr 09 05:30:15 PDT 2004 >Closed-Date: >Last-Modified: >Originator: Milan Obuch >Release: 5.2.1-RELEASE >Organization: >Environment: FreeBSD tablet.dino.sk 5.2.1-RELEASE FreeBSD 5.2.1-RELEASE #13: Thu Apr 8 05:56:24 CEST 2004 root@tablet.dino.sk:/usr/src/sys/i386/compile/TABLET i386 >Description: Booting FreeBSD on Compaq's TC1000 TabletPC gives sio0: configured irq 4 not in bitmap of probed irqs 0 sio0: port may not be enabled sio1: configured irq 3 not in bitmap of probed irqs 0 sio1: port may not be enabled when serial ports are probed. First serial port is connected to pen digitizer. This platform uses Via Technologies VT82C686A chip, and PhoenixBIOS does not fully initialize its SuperI/O controller >How-To-Repeat: Install FreeBSD on TC1000 and boot >Fix: --- sys/dev/pci/isa_pci.c.orig Sun Aug 24 19:54:15 2003 +++ sys/dev/pci/isa_pci.c Wed Apr 7 11:07:16 2004 @@ -159,6 +159,7 @@ { struct isab_softc *sc = device_get_softc(dev); int error, rid; + u_int32_t u; /* * Attach an ISA bus. Note that we can only have one ISA bus. @@ -180,6 +181,30 @@ if (sc->elcr_res == NULL) device_printf(dev, "failed to allocate ELCR resource\n"); break; + case 0x06861106: /* VIA 82C686 */ + /* + * PhoenixBIOS used in Compaq's TabletPC TC1000 does not initialises + * chip to enable serial ports, so we handle it ourselves. + */ + +#define CONFIG_INDEX 0x3F0 +#define CONFIG_DATA 0x3F1 + + device_printf(dev, "TC1000 Serial1 port enabler\n"); + u = pci_read_config(dev,0x85,1); + pci_write_config(dev, 0x85, u | 2, 1); // enable SuperI/O configuration + + outb(CONFIG_INDEX, 0xE7); + outb(CONFIG_DATA, 0xFE); // Serial1 addr set to 0x3F8 + + outb(CONFIG_INDEX, 0xE2); + u = inb(CONFIG_DATA); + + outb(CONFIG_INDEX, 0xE2); + outb(CONFIG_DATA, u | 4); // enable Serial1 + + u = pci_read_config(dev,0x85,1); + pci_write_config(dev, 0x85, u & ~2, 1); // disable SuperI/O configuration } return(0); Maybe some #ifdef kernel option could be used here, say TC1000_SIO_ENABLE_HACK, but I did not bother with this. >Release-Note: >Audit-Trail: >Unformatted: