From owner-freebsd-hardware Tue Mar 10 09:55:22 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA08507 for freebsd-hardware-outgoing; Tue, 10 Mar 1998 09:55:22 -0800 (PST) (envelope-from owner-freebsd-hardware@FreeBSD.ORG) Received: from nest.bistbn.com (yury@nest.bistbn.com [209.88.174.52]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA08462 for ; Tue, 10 Mar 1998 09:54:58 -0800 (PST) (envelope-from yury@nest.bistbn.com) Received: (from yury@localhost) by nest.bistbn.com (8.8.7/8.8.7) id TAA00605 for hardware@freebsd.org; Tue, 10 Mar 1998 19:54:51 +0200 (IST) (envelope-from yury) From: Yuri Krichevsky Message-Id: <199803101754.TAA00605@nest.bistbn.com> Subject: solution to 'sio0 not found' problem on IWill (and maybe COMPAQ) To: hardware@FreeBSD.ORG Date: Tue, 10 Mar 1998 19:54:51 +0200 (IST) Reply-To: yury@luckynet.co.il X-Mailer: ELM [version 2.4ME+ PL32 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hardware@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi. This is small patch for FreeBSD 2.2.5-RELEASE, that fixes problem with detecting serial ports on IWill motherboards (I hope, it will work for COMPAQ LTE Elite machines also). I don't think it is right way to detect serial ports, so please use my patch only if you have this problem. P.S. sorry for my english ;-) P.P.S. after reboot, you may get message like this 'sio0: 65 events for device without tp' - just ignore it. *** /sys/i386/isa/sio.c.orig Thu Mar 5 19:44:34 1998 --- /sys/i386/isa/sio.c Tue Mar 10 19:23:06 1998 *************** *** 493,499 **** struct isa_device *dev; { static bool_t already_init; ! bool_t failures[10]; int fn; struct isa_device *idev; Port_t iobase; --- 493,499 ---- struct isa_device *dev; { static bool_t already_init; ! bool_t failures[12]; int fn; struct isa_device *idev; Port_t iobase; *************** *** 664,677 **** enable_intr(); result = IO_COMSIZE; ! for (fn = 0; fn < sizeof failures; ++fn) ! if (failures[fn]) { ! outb(iobase + com_mcr, 0); result = 0; ! if (COM_VERBOSE(dev)) ! printf("sio%d: probe test %d failed\n", ! dev->id_unit, fn); } return (result); } --- 664,726 ---- enable_intr(); result = IO_COMSIZE; ! ! /* ! * Patch (C) Yuri Krichevsky (yury@bistbn.com) ! * ! * If we have'nt found serial port yet, maybe it's strange ! * serial port... (like on IWill motherboard) ! * ! * ! * !WARNING! It's only temporary solution ! Use this patch only if ! * you have problems with serial ports ! ! * ! */ ! if (sizeof failures) { ! { ! result = IO_COMSIZE; ! ! /* ! * Probing port as described in article ! * 'The Serial Port' (C) Chris Blum (chris@phil.uni-sb.de) ! * http://colargol.tihlde.hist.no/~bardj/serial/ ! */ ! ! outb(iobase + com_mcr, 0x10); ! if ((inb(iobase + com_msr) & 0xf0)) { ! failures[10] = 1; ! result = 0; ! } else { ! outb(iobase + com_mcr, 0x1f); ! if ((inb(iobase + com_msr) & 0xf0) != 0xf0) { ! failures[11] = 1; result = 0; ! } else { ! /* ! * UART detected (I hope, it's UART). ! */ ! outb(iobase + com_cfcr, CFCR_8BITS); ! outb(iobase + com_ier, 0x0); ! outb(iobase + com_mcr, MCR_IENABLE); ! } } + + } + } + /* + * END of patch + */ + if ( !result ) { + for (fn = 0; fn < sizeof failures; ++fn) + if (failures[fn]) { + outb(iobase + com_mcr, 0); + result = 0; + if (COM_VERBOSE(dev)) + printf("sio%d: probe test %d failed\n", + dev->id_unit, fn); + } + } + return (result); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hardware" in the body of the message