[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-rt
Subject:    Re: [rtl] LPT Access Time
From:       "C. Wayne Wright" <wright () osb1 ! wff ! nasa ! gov>
Date:       1999-03-26 14:00:20
[Download RAW message or body]

>
> real-time task.  This takes 2 write operations (1.4 uS each).  I am looking for
>
> a way to access the port more quickly.
>
This is old, and "Dossy",  written in Turbo-C/asm but here it is anyway........


-Wayne



#define FAST 1      // 24 mhz bus speed, min recovery time
#define SLOW 2
#define NORMAL 3          // 8 mhz bus, min recovery
#define STOCK 4     // 8mhz bus, 11clock recovery
#define BUS6  5
#define BUS8  6
#define BUS11 7
#define BUS13 8
#define BUS16 9
#define BUS22 10

/*
        EISA bus speed and I/O bus cycle time tweaker functions
        FAST: switches to 24mhz bus ( on 66mhz cpu) and sets the I/O recovery
        time to "as sone as posible"  Adjusts parameters on the H8001 and H8002
        chips addressed at ports 0xc18, 0xc19 and 0xc1c and 0xc1d.

      W. Wright   wright@osb.wff.nasa.gov
 */

bus_speed( int speed )
{
 switch ( speed ) {
 case BUS22:
  asm {
         mov dx, 0xc18   // speed bus up
         mov al, 2                      // index 2
         out dx, al;
         mov al, 0x34     // 66/3 bus speed
         inc dx;
         out dx, al;
         }
        break;

 case BUS16:
  asm {
         mov dx, 0xc18   // speed bus up
         mov al, 2                      // index 2
         out dx, al;
         mov al, 0x30     // 66/3 bus speed
         inc dx;
         out dx, al;
         }
        break;

 case BUS13:
  asm {
         mov dx, 0xc18   // speed bus up
         mov al, 2                      // index 2
         out dx, al;
         mov al, 0x2c     // 66/3 bus speed
         inc dx;
         out dx, al;
         }
        break;

 case BUS11:
  asm {
         mov dx, 0xc18   // speed bus up
         mov al, 2                      // index 2
         out dx, al;
         mov al, 0x28// 66/3 bus speed
         inc dx;
         out dx, al;
         }
        break;

 case BUS8:
  asm {
         mov dx, 0xc18   // speed bus up
         mov al, 2                      // index 2
        out dx, al;
         mov al, 0x24     // 66/3 bus speed
         inc dx;
         out dx, al;
         }
        break;

 case BUS6:
  asm {
         mov dx, 0xc18   // speed bus up
         mov al, 2                      // index 2
         out dx, al;
         mov al, 0x20     // 66/3 bus speed
         inc dx;
         out dx, al;
         }
        break;

 case FAST:
  asm {
         mov dx, 0xc18   // speed bus up
         mov al, 2                      // index 2
         out dx, al;
         mov al, 0x34     // 66/3 bus speed
         inc dx;
         out dx, al;
         mov dx, 0xc1c   // use min bus cycles
         mov al, 2;
         out dx, al;
         inc dx
         mov al, 0x0c     //
         out dx, al;
  }
  break;

 case STOCK:
  asm {
         mov dx, 0xc18   // speed bus up
         mov al, 2                      // index 2
         out dx, al;
         mov al, 0x24     //
         inc dx;
         out dx, al;
         mov dx, 0xc1c   //
         mov al, 2;
         out dx, al;
         inc dx
         mov al, 0x04     //
         out dx, al;
  }
        break;

 case SLOW:
case NORMAL:
  asm {
         mov dx, 0xc18   // speed bus up
         mov al, 2                      // index 2
         out dx, al;
         mov al, 0x24     //
         inc dx;
         out dx, al;
         mov dx, 0xc1c   //
         mov al, 2;
         out dx, al;
         inc dx
         mov al, 0x0c     //
         out dx, al;
  }
  break;
  } // switch
}


~




> -------------------------------------------------->-+
> C.W. Wright,wright@osb.wff.nasa.gov, Ph:757-824-1698
> Fax: 757-824-1036,
> NASA,Goddard Space Flight Center
> Code 972,  Wallops Flight Facility
> Wallops Island, Va. 23337
> -------+-<-------------------------------------------
>

--- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail majordomo@rtlinux.cs.nmt.edu OR
echo "unsubscribe rtl <Your_email>" | mail majordomo@rtlinux.cs.nmt.edu
----
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic