linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hal Duston <hald@sound.net>
To: linux-kernel@vger.kernel.org
Cc: alan@lxorguk.ukuu.org.uk
Subject: PS/2 Esdi Patch #6
Date: Wed, 23 May 2001 17:53:33 -0500 (CDT)	[thread overview]
Message-ID: <Pine.GSO.4.10.10105231735210.23376-200000@sound.net> (raw)

[-- Attachment #1: Type: TEXT/PLAIN, Size: 338 bytes --]

Use information from ADF file to update/correct the driver.

Save POS data.
Rewrite /proc entry based on POS data only.  (Gleaned from the ADF file.)
Correct the I/O region requested.  (Also gleaned from the ADF file.)

Also available etc... at 
http://www.sound.net/~hald/projects/ps2esdi/ps2esdi-2.4.4-patch2

Hal Duston
hald@sound.net

[-- Attachment #2: Type: TEXT/PLAIN, Size: 4830 bytes --]

Use information from ADF file to update/correct the driver.

Save POS data.
Rewrite /proc entry based on POS data only.  (Gleaned from the ADF file.)
Correct the I/O region requested.  (Also gleaned from the ADF file.)

--- linux-2.4.5-pre4/drivers/block/ps2esdi.c.1	Mon May 21 00:00:00 2001
+++ linux-2.4.5-pre4/drivers/block/ps2esdi.c.2	Mon May 21 00:03:02 2001
@@ -123,6 +123,7 @@
 static struct timer_list esdi_timer = { function: ps2esdi_reset_timer };
 static int reset_status;
 static int ps2esdi_slot = -1;
+static u_char ps2esdi_pos[8];
 static int tp720esdi = 0;	/* Is it Integrated ESDI of ThinkPad-720? */
 static int intg_esdi = 0;       /* If integrated adapter */
 struct ps2esdi_i_struct {
@@ -281,11 +282,93 @@
 {
 	int len = 0;
 
+	if (ps2esdi_pos[0] == 0xff && ps2esdi_pos[1] == 0xdd) {
+		len += sprintf(buf + len, "Adapter Memory Location: ");
+		switch(ps2esdi_pos[3] & 0x0f) {
+		case 0x02:
+			len += sprintf(buf + len, "Segment C800\n");
+			break;
+		case 0x03:
+			len += sprintf(buf + len, "Segment CC00\n");
+			break;
+		case 0x04:
+			len += sprintf(buf + len, "Segment D000\n");
+			break;
+		case 0x05:
+			len += sprintf(buf + len, "Segment D400\n");
+			break;
+		case 0x06:
+			len += sprintf(buf + len, "Segment D800\n");
+			break;
+		case 0x07:
+			len += sprintf(buf + len, "Segment DC00\n");
+			break;
+		case 0x08:
+		case 0x09:
+		case 0x0a:
+		case 0x0b:
+		case 0x0c:
+		case 0x0d:
+		case 0x0e:
+		case 0x0f:
+			len += sprintf(buf + len, "ROM Disabled\n");
+			break;
+		}
+	}
 	len += sprintf(buf + len, "DMA Arbitration Level: %d\n",
-		       dma_arb_level);
-	len += sprintf(buf + len, "IO Port: %x\n", io_base);
-	len += sprintf(buf + len, "IRQ: 14\n");
-	len += sprintf(buf + len, "Drives: %d\n", ps2esdi_drives);
+		       (ps2esdi_pos[2] >> 2) & 0x07);
+	if (ps2esdi_pos[0] == 0x9f && ps2esdi_pos[1] == 0xdf) {
+		len += sprintf(buf + len, "DMA Burst Pacing Interval: ");
+		switch((ps2esdi_pos[3] >> 4) & 0x03) {
+		case 0x00:
+			len += sprintf(buf + len, "Burst Disabled\n");
+			break;
+		case 0x01:
+			len += sprintf(buf + len, "16 Microseconds\n");
+			break;
+		case 0x02:
+			len += sprintf(buf + len, "24 Microseconds\n");
+			break;
+		case 0x03:
+			len += sprintf(buf + len, "31 Microseconds\n");
+			break;
+		}
+	}
+	else {
+		len += sprintf(buf + len, "DMA Burst Pacing Length: ");
+		switch((ps2esdi_pos[3] >> 4) & 0x03) {
+		case 0x00:
+			len += sprintf(buf + len, "Burst Disabled\n");
+			break;
+		case 0x01:
+			len += sprintf(buf + len, "8 Word Burst\n");
+			break;
+		case 0x02:
+			len += sprintf(buf + len, "16 Word Burst\n");
+			break;
+		case 0x03:
+			len += sprintf(buf + len, "24 Word Burst\n");
+			break;
+		}
+	}
+	len += sprintf(buf + len, "DMA Pacing Control: %s\n", (ps2esdi_pos[4] & 0x01) ? "Disabled" : "Enabled");
+	if (ps2esdi_pos[0] == 0x9f && ps2esdi_pos[1] == 0xdf) {
+		len += sprintf(buf + len, "Time to Release: ");
+		switch((ps2esdi_pos[4] >> 1) & 0x03) {
+		case 0x00:
+			len += sprintf(buf + len, "6 Microseconds\n");
+			break;
+		case 0x01:
+			len += sprintf(buf + len, "3 Microseconds\n");
+			break;
+		case 0x02:
+		case 0x03:
+			len += sprintf(buf + len, "Immediate\n");
+			break;
+		}
+	}
+	len += sprintf(buf + len, "Fairness On/Off: %s\n", ((ps2esdi_pos[2] >> 6) & 0x01) ? "On" : "Off");
+	len += sprintf(buf + len, "Primary/Alternate Port Addresses: %s\n", ((ps2esdi_pos[2] >> 1) & 0x01) ? "Alternate" : "Primary");
 
 	return len;
 }
@@ -307,7 +390,6 @@
 	 */
 
 	int slot = 0, i, reset_start, reset_end;
-	u_char status;
 	unsigned short adapterID;
 
 	if ((slot = mca_find_adapter(INTG_ESDI_ID, 0)) != MCA_NOTFOUND) {
@@ -345,9 +427,11 @@
 	   0             adapter enable
 	 */
 
-	status = mca_read_stored_pos(slot, 2);
+	for(i = 0; i < 8; ++i) {
+		ps2esdi_pos[i] = mca_read_stored_pos(slot, i);
+	}
 	/* is it enabled ? */
-	if (!(status & STATUS_ENABLED)) {
+	if (!(ps2esdi_pos[2] & STATUS_ENABLED)) {
 		printk("%s: ESDI adapter disabled\n", DEVICE_NAME);
 		return;
 	}
@@ -361,13 +445,13 @@
 		printk("%s: Unable to get IRQ %d\n", DEVICE_NAME, PS2ESDI_IRQ);
 		return;
 	}
-	if (status & STATUS_ALTERNATE)
+	if (ps2esdi_pos[2] & 0x02)
 		io_base = ALT_IO_BASE;
 	else
 		io_base = PRIMARY_IO_BASE;
 
 	/* get the dma arbitration level */
-	dma_arb_level = (status >> 2) & 0xf;
+	dma_arb_level = (ps2esdi_pos[2] >> 2) & 0xf;
 
 	/* BA */
 	printk("%s: DMA arbitration level : %d\n",
@@ -418,7 +502,7 @@
 		ps2esdi_blocksizes[i] = 1024;
 
 	request_dma(dma_arb_level, "ed");
-	request_region(io_base, 4, "ed");
+	request_region(io_base, 8, "ed");
 	blksize_size[MAJOR_NR] = ps2esdi_blocksizes;
 
 	for (i = 0; i < ps2esdi_drives; i++) {

                 reply	other threads:[~2001-05-23 22:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.GSO.4.10.10105231735210.23376-200000@sound.net \
    --to=hald@sound.net \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).