Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Mar 1998 19:54:51 +0200 (IST)
From:      Yuri Krichevsky <yury@nest.bistbn.com>
To:        hardware@FreeBSD.ORG
Subject:   solution to 'sio0 not found' problem on IWill (and maybe COMPAQ)
Message-ID:  <199803101754.TAA00605@nest.bistbn.com>

next in thread | raw e-mail | index | archive | help


	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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199803101754.TAA00605>