Bug 125454 - [digi] [patch] device digi (PC/Xe 64K 16 ports) not work
Summary: [digi] [patch] device digi (PC/Xe 64K 16 ports) not work
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-09 23:30 UTC by paradox
Modified: 2018-05-20 18:44 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description paradox 2008-07-09 23:30:01 UTC
full thread at http://forum.lissyara.su/viewtopic.php?f=5&t=8959
short description
device isa digi on FreeBSD 7.0 not work

#kldload digi
#dmesg -a|grep digi

digi1: 0x061: Invalid i/o address
digi0 at port 0x220-0x223 iomem 0xd0000-0xdffff on isa0
digi0: memory reservation failed (0x06)
device_attach: digi0 attach returned 6

under FreeBSD 4.7
device digi will name dgb
and configured on KERNEL

device dgb0 at isa? port 0x220 iomem 0x0d0000

and works fine!

#dmesg -a|grep dgb

dgb0: PC/Xe 64K
dgb0 at port 0x220-0x223 iomem 0xd0000-0xdffff on isa0
dgb0: 16 ports
dgb0: driver is using old-style compatability shims

Fix: this changes to fix issues



after patch 

#dmesg | grep digi

digi0: probing on isa bus
digi0: isa? port 0x220 mem 0xd0000
digi0: got reset after 1 iterations
digi0: board type is 0x4
digi0: Probe returns -10
digi0: probing on isa bus
digi0: isa? port 0x220 mem 0xd0000
digi0: got reset after 1 iterations
digi0: board type is 0x4
digi0: Probe returns -10
digi0 at port 0x220-0x223 iomem 0xd0000-0xdffff on isa0
digi0: attaching
digi0: Checking card type
digi0: got reset after 0 iterations
digi0: board type is 0x4
digi0: internal memory segment 0xf000
digi0: got reset after 1 iterations
digi0: got memory after 0 iterations
digi0: short memory test
digi0: 1st memory test ok
digi0: 2nd memory test ok
digi0: 3rd memory test ok
digi0: BIOS uploaded
digi0: BIOS started after 1 us
digi0: BIOS booted after 112 iterations
digi0: FEP/OS moved after 1 iterations
digi0: FEP/OS started after 5 iterations
digi0: Digiboard PC/Xe 64K, 16 ports found
digi1: probing on isa bus
digi1: 0x061: Invalid i/o address--hH0Oc6DWCIjOkbTyK2LhMbAk1SRgu8gW5x5XR4WLI3RCApki
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

diff -urN digi.orig/digi.c digi.new/digi.c
--- digi.orig/digi.c	2008-06-13 15:34:00.000000000 +0300
+++ digi.new/digi.c	2008-06-13 16:20:07.000000000 +0300
@@ -399,7 +399,7 @@
 	case PCXE:
 	case PCXEVE:
 	case PCXI:
-		ptr = sc->setwin(sc, sc->model == PCXI ? 0x2000 : 0x0);
+		ptr = sc->setwin(sc, 0x2000);
 		digi_bcopy(sc->fep.data, ptr, sc->fep.size);
 
 		/* A BIOS request to move our data to 0x2000 */
diff -urN digi.orig/digi_isa.c digi.new/digi_isa.c
--- digi.orig/digi_isa.c	2004-05-30 00:00:02.000000000 +0300
+++ digi.new/digi_isa.c	2008-06-13 16:21:09.000000000 +0300
@@ -80,7 +80,7 @@
 static u_char *
 digi_xi_setwin(struct digi_softc *sc, unsigned int addr)
 {
-	outb(sc->wport, sc->window = FEPMEM);
+	outb(sc->wport, sc->window = inb(sc->port)|FEPMEM);
 	return (sc->vmem + addr);
 }
 
@@ -203,6 +203,10 @@
 			sc->win_size = 0x10000;
 			sc->win_bits = 16;
 			sc->wport = sc->port;
+
+			sc->setwin = digi_xi_setwin;
+			sc->hidewin = digi_isa_hidewin;
+			sc->towin = digi_xi_towin;
 		} else {
 			sc->name = "Digiboard PC/Xe 64/8K (windowed)";
 			sc->model = PCXEVE;
@@ -210,12 +214,13 @@
 			sc->win_size = 0x2000;
 			sc->win_bits = 13;
 			sc->wport = sc->port + 1;
+
+			sc->setwin = digi_isa_setwin;
+			sc->hidewin = digi_isa_hidewin;
+			sc->towin = digi_isa_towin;
 		}
 		sc->module = "Xe";
 
-		sc->setwin = digi_isa_setwin;
-		sc->hidewin = digi_isa_hidewin;
-		sc->towin = digi_isa_towin;
 	}
 
 	return (sc->name != NULL);
@@ -396,7 +401,7 @@
 
 	if (sc->model == PCXI || sc->model == PCXE) {
 		outb(sc->port, FEPRST | FEPMEM);
-		for (i = 0; (inb(sc->port) & FEPMASK) != FEPRST; i++) {
+		for (i = 0; (inb(sc->port) & FEPMASK) != (FEPRST|FEPMEM); i++) {
 			if (i == hz / 10) {
 				device_printf(dev,
 				    "memory reservation failed (0x%02x)\n",
How-To-Repeat: you must have this card to repeat the problem
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:01:20 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2018-05-20 18:44:28 UTC
# 20160901: Remove digi(4)