Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Jun 1996 20:37:58 +0200 (MET DST)
From:      Rene de Vries <rene@freeze.iaf.nl>
To:        freebsd-hackers@freebsd.org (freebsd-hackers)
Subject:   SUMMARY: serial port grief on Asus P55TP4N
Message-ID:  <199606261837.UAA00175@freeze.iaf.nl>

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

First of all I would like to thank all of you (and especially Bruce Evans)
for helping me out with that nasty serial port thing.

I just inspected my Asus P55TP4N (rev 1.01) board and I found that it
has a chip called W83877F (Winbond) on the position the manual says the 
multi-io chip is located. (But hey I am just a simple software engineer).

The problem seems to be solved by the following patch. With this patch
the speed does not get set if the new speed is equal to the current 
speed. (Bruce mentioned that the UMC multi-io chip had some problems
with setting the speed while receiving data). I don't think this is 
a 100% patch, but it makes this chip useful for UUCP.

Hope this helps.

This is the patch (against the sio.c from the 2.1 release CDROM).

*** sio.c.orig	Tue Jun 25 21:27:34 1996
--- sio.c	Tue Jun 25 21:28:30 1996
***************
*** 211,216 ****
--- 211,220 ----
  	struct termios	lt_in;	/* should be in struct tty */
  	struct termios	lt_out;
  
+ #ifdef BROKEN_UART
+ 	speed_t current_ospeed;
+ #endif
+ 
  	bool_t	do_timestamp;
  	struct timeval	timestamp;
  
***************
*** 626,631 ****
--- 630,639 ----
  	com->it_in.c_ispeed = com->it_in.c_ospeed = comdefaultrate;
  	com->it_out = com->it_in;
  
+ #ifdef BROKEN_UART
+ 	com->current_ospeed = comdefaultrate;
+ #endif
+ 
  	/* attempt to determine UART type */
  	printf("sio%d: type", unit);
  
***************
*** 1624,1629 ****
--- 1632,1641 ----
  	int		unit;
  	int		txtimeout;
  
+ #ifdef BROKEN_UART
+ 	bool_t		setspeed;
+ #endif
+ 
  	/* do historical conversions */
  	if (t->c_ispeed == 0)
  		t->c_ispeed = t->c_ospeed;
***************
*** 1637,1642 ****
--- 1649,1669 ----
  	unit = DEV_TO_UNIT(tp->t_dev);
  	com = com_addr(unit);
  	iobase = com->iobase;
+ 
+ #ifdef BROKEN_UART
+ 	/*
+ 	 * check if the baud rate is different from the currently
+ 	 * selected one, if so then set new rate. If it is the same,
+ 	 * don't touch the speed, it confuses the UMC chip heavily
+ 	 */
+ 
+ 	if (com->current_ospeed != t->c_ospeed) {
+ 		setspeed = TRUE; 
+ 		com->current_ospeed = t->c_ospeed;
+ 	} else
+ 		setspeed = FALSE;
+ #endif
+ 
  	s = spltty();
  	if (divisor == 0)
  		(void)commctl(com, TIOCM_DTR, DMBIC);	/* hang up line */
***************
*** 1727,1733 ****
  	    != (LSR_TSRE | LSR_TXRDY))
  		goto retry;
  
! 	if (divisor != 0) {
  		outb(iobase + com_cfcr, cfcr | CFCR_DLAB);
  		outb(iobase + com_dlbl, divisor & 0xFF);
  		outb(iobase + com_dlbh, (u_int) divisor >> 8);
--- 1754,1764 ----
  	    != (LSR_TSRE | LSR_TXRDY))
  		goto retry;
  
! #ifdef BROKEN_UART
! 	if (divisor != 0 && setspeed) { 
! #else
! 	if (divisor != 0) { 
! #endif
  		outb(iobase + com_cfcr, cfcr | CFCR_DLAB);
  		outb(iobase + com_dlbl, divisor & 0xFF);
  		outb(iobase + com_dlbh, (u_int) divisor >> 8);

--- _   _  _ __  _     
|- |_| |- |-  / |-  Rene de Vries                            rene@freeze.iaf.nl
|  |\  |_ |_ /_ |_  Take a look at http://www.eeb.ele.tue.nl/tcja/ and tell me!



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