lkml.org 
[lkml]   [2001]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectPS/2 Esdi Patch #6
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
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++) {
\
 
 \ /
  Last update: 2005-03-22 12:53    [W:0.041 / U:0.792 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site