Skip to contentSkip to conversation

Support for hispeed serial ports

PATCH Pavel Machek 1 participant 1 message Nov 9, 2001 Kbuild

lore
Share & tools
lore
#0 lore raw

Hi!

This is lying on my hdd for around forever. I used to have it in kernel, but tytso convinced me to push it into userspace. Could it be merged into setserial?

Pavel

Makefile +2 -2
diff -ur -x .dep* -x .hdep* -x *.[oas] -x *~ -x #* -x *CVS* -x *.orig -x *.rej -x *.old -x .menu* -x asm -x local.h -x System.map -x autoconf.h -x compile.h -x version.h -x .version -x defkeymap.c -x uni_hash.tbl -x zImage -x vmlinu?* -x TAGS -x bootsect -x *RCS* -x conmakehash -x map -x build -x build -x configure -x *target* -x *.flags -x *.bak setserial-2.14.ofic/Makefile setserial-2.14/Makefile
@@ -14,8 +14,8 @@
 
 all: setserial setserial.cat
 
-setserial: setserial.c
-	$(CC) $(CFLAGS) $(DEFS) setserial.c -o setserial
+setserial: setserial.c hispeed.c
+	$(CC) $(CFLAGS) $(DEFS) setserial.c hispeed.c -o setserial
 
 setserial.cat: setserial.8
 	nroff -man setserial.8 > setserial.cat
Makefile.in +2 -2
diff -ur -x .dep* -x .hdep* -x *.[oas] -x *~ -x #* -x *CVS* -x *.orig -x *.rej -x *.old -x .menu* -x asm -x local.h -x System.map -x autoconf.h -x compile.h -x version.h -x .version -x defkeymap.c -x uni_hash.tbl -x zImage -x vmlinu?* -x TAGS -x bootsect -x *RCS* -x conmakehash -x map -x build -x build -x configure -x *target* -x *.flags -x *.bak setserial-2.14.ofic/Makefile.in setserial-2.14/Makefile.in
@@ -14,8 +14,8 @@
 
 all: setserial setserial.cat
 
-setserial: setserial.c
-	$(CC) $(CFLAGS) $(DEFS) setserial.c -o setserial
+setserial: setserial.c hispeed.c
+	$(CC) $(CFLAGS) $(DEFS) setserial.c hispeed.c -o setserial
 
 setserial.cat: setserial.8
 	nroff -man setserial.8 > setserial.cat
hispeed.c +626 -0

626 lines not on this page · raw message

Only in setserial-2.14: setserial

setserial.8 +13 -2
diff -ur -x .dep* -x .hdep* -x *.[oas] -x *~ -x #* -x *CVS* -x *.orig -x *.rej -x *.old -x .menu* -x asm -x local.h -x System.map -x autoconf.h -x compile.h -x version.h -x .version -x defkeymap.c -x uni_hash.tbl -x zImage -x vmlinu?* -x TAGS -x bootsect -x *RCS* -x conmakehash -x map -x build -x build -x configure -x *target* -x *.flags -x *.bak setserial-2.14.ofic/setserial.8 setserial-2.14/setserial.8
@@ -138,7 +138,7 @@
 .B skip_test
 parameter also often must be specified.
 .TP
-.B autoconfigure
+.B autoconfig
 When this parameter is given, 
 .B setserial
 will ask the kernel to attempt to automatically configure the serial
@@ -147,10 +147,21 @@
 .B auto_irq 
 parameter is set, Linux will attempt to automatically determine the
 IRQ.  The
-.B autoconfigure
+.B autoconfig
 parameter should be given after the
 .BR port , auto_irq ", and" skip_test
 parameters have been specified.
+.TP
+.B hispeed
+Some SMC/NS/Winbond Multi-I/O chips and ALI south bridge chips have High
+Speed mode, in which baud rate can be set to 230400, 460800 (or 921600
+at NS/Winbond chips) bps. With this option,
+.B setserial
+try to detect such chips and make kernel capable of using higher speeds.
+(ALI: M1543(Aladdin V south bridge) - 460800 max,
+NS: PC8730[789], PC[89]3[01]7, PC87338 - 921600 max,
+SMC:37C665IR/666IR, 37C669/669FR,37N769, 37B72x/77x/78x/80x, 37C67x/68x/93x/93xAPM/93xFR, 37M60x/61x, 37N958FR - 450800 max,
+WinBond: W83877TF(TF ONLY, A/F/AF NOT supported) W83977A/AF/TF/ATF - 460800 max).
 .TP
 .B auto_irq
 During autoconfiguration, try to determine the IRQ.  This feature is
setserial.8.in +13 -2
diff -ur -x .dep* -x .hdep* -x *.[oas] -x *~ -x #* -x *CVS* -x *.orig -x *.rej -x *.old -x .menu* -x asm -x local.h -x System.map -x autoconf.h -x compile.h -x version.h -x .version -x defkeymap.c -x uni_hash.tbl -x zImage -x vmlinu?* -x TAGS -x bootsect -x *RCS* -x conmakehash -x map -x build -x build -x configure -x *target* -x *.flags -x *.bak setserial-2.14.ofic/setserial.8.in setserial-2.14/setserial.8.in
@@ -138,7 +138,7 @@
 .B skip_test
 parameter also often must be specified.
 .TP
-.B autoconfigure
+.B autoconfig
 When this parameter is given, 
 .B setserial
 will ask the kernel to attempt to automatically configure the serial
@@ -147,10 +147,21 @@
 .B auto_irq 
 parameter is set, Linux will attempt to automatically determine the
 IRQ.  The
-.B autoconfigure
+.B autoconfig
 parameter should be given after the
 .BR port , auto_irq ", and" skip_test
 parameters have been specified.
+.TP
+.B hispeed
+Some SMC/NS/Winbond Multi-I/O chips and ALI south bridge chips have High
+Speed mode, in which baud rate can be set to 230400, 460800 (or 921600
+at NS/Winbond chips) bps. With this option,
+.B setserial
+try to detect such chips and make kernel capable of using higher speeds.
+(ALI: M1543(Aladdin V south bridge) - 460800 max,
+NS: PC8730[789], PC[89]3[01]7, PC87338 - 921600 max,
+SMC:37C665IR/666IR, 37C669/669FR,37N769, 37B72x/77x/78x/80x, 37C67x/68x/93x/93xAPM/93xFR, 37M60x/61x, 37N958FR - 450800 max,
+WinBond: W83877TF(TF ONLY, A/F/AF NOT supported) W83977A/AF/TF/ATF - 460800 max).
 .TP
 .B auto_irq
 During autoconfiguration, try to determine the IRQ.  This feature is
setserial.c +25 -1
diff -ur -x .dep* -x .hdep* -x *.[oas] -x *~ -x #* -x *CVS* -x *.orig -x *.rej -x *.old -x .menu* -x asm -x local.h -x System.map -x autoconf.h -x compile.h -x version.h -x .version -x defkeymap.c -x uni_hash.tbl -x zImage -x vmlinu?* -x TAGS -x bootsect -x *RCS* -x conmakehash -x map -x build -x build -x configure -x *target* -x *.flags -x *.bak setserial-2.14.ofic/setserial.c setserial-2.14/setserial.c
@@ -66,6 +66,7 @@
 #define CMD_CONFIG	10
 #define CMD_GETMULTI	11
 #define CMD_SETMULTI	12
+#define CMD_HISPEED	13
 
 #define FLAG_CAN_INVERT	0x0001
 #define FLAG_NEED_ARG	0x0002
@@ -109,6 +110,7 @@
 	CMD_WAIT2,	"closing_wait2",0,		0,		0, FLAG_NEED_ARG,
 #endif
 	CMD_CONFIG,	"autoconfig",	0,		0,		0, 0,
+	CMD_HISPEED,	"hispeed",	0,		0,		0, 0,
 	CMD_GETMULTI,	"get_multiport",0,		0,		0, 0,
 	CMD_SETMULTI,	"set_multiport",0,		0,		0, 0,
 	0,		0,		0,		0,		0, 0,
@@ -484,6 +486,27 @@
 			}
 			set_multiport(device, fd, &arg);
 			break;
+		case CMD_HISPEED:
+			{
+				struct serial_struct serinfo;
+				int baud_base;
+
+				if (ioctl(fd, TIOCGSERIAL, &serinfo) < 0) {
+					perror("Cannot get serial info");
+					exit(1);
+				}
+				baud_base = enable_hispeed(serinfo.port);
+				if (!baud_base)
+					printf( "Hispeed serial not detected\n" );
+				else {
+					serinfo.baud_base = baud_base;
+					if (ioctl(fd, TIOCSSERIAL, &new_serinfo) < 0) {
+						perror("Cannot set serial info");
+						exit(1);
+					}
+				}
+			} 
+			break;
 			
 		default:
 			fprintf(stderr, "Internal error: unhandled cmd #%d\n", p->cmd);
@@ -561,7 +584,8 @@
 	fprintf(stderr, "\t\t\t\tafter the reciver is disabled\n");
 #endif
 	fprintf(stderr, "\t^ fourport\tconfigure the port as an AST Fourport\n");
-	fprintf(stderr, "\t  autoconfigure\tautomatically configure the serial port\n");
+	fprintf(stderr, "\t  autoconfig\tautomatically configure the serial port\n");
+	fprintf(stderr, "\t  hispeed\ttry to make serail port capable of faster speeds\n");
 	fprintf(stderr, "\t^ auto_irq\ttry to determine irq during autoconfiguration\n");
 	fprintf(stderr, "\t^ skip_test\tskip UART test during autoconfiguration\n");
 	fprintf(stderr, "\n");

Only in setserial-2.14: setserial.cat
Only in setserial-2.14: setserial2
Only in setserial-2.14: setserial3

Signature · 2 lines
STOP THE WAR! Someone killed innocent Americans. That does not give
U.S. right to kill people in Afganistan.