root/include/asm-sparc/auxio.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. set_auxio

   1 /* $Id: auxio.h,v 1.8 1995/11/25 02:31:13 davem Exp $
   2  * auxio.h:  Definitons and code for the Auxiliary I/O register.
   3  *
   4  * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
   5  */
   6 #ifndef _SPARC_AUXIO_H
   7 #define _SPARC_AUXIO_H
   8 
   9 #include <asm/system.h>
  10 #include <asm/vaddrs.h>
  11 
  12 /* This register is an unsigned char in IO space.  It does two things.
  13  * First, it is used to control the front panel LED light on machines
  14  * that have it (good for testing entry points to trap handlers and irq's)
  15  * Secondly, it controls various floppy drive parameters.
  16  */
  17 
  18 #define AUXIO_ORMEIN      0xf0    /* All writes must set these bits. */
  19 #define AUXIO_ORMEIN4M    0xc0    /* sun4m - All writes must set these bits. */
  20 #define AUXIO_FLPY_DENS   0x20    /* Floppy density, high if set. Read only. */
  21 #define AUXIO_FLPY_DCHG   0x10    /* A disk change occurred.  Read only. */
  22 #define AUXIO_EDGE_ON     0x10    /* sun4m - On means Jumper block is in. */
  23 #define AUXIO_FLPY_DSEL   0x08    /* Drive select/start-motor. Write only. */
  24 
  25 /* Set the following to one, then zero, after doing a pseudo DMA transfer. */
  26 #define AUXIO_FLPY_TCNT   0x04    /* Floppy terminal count. Write only. */
  27 
  28 /* Set the following to zero to eject the floppy. */
  29 #define AUXIO_FLPY_EJCT   0x02    /* Eject floppy disk.  Write only. */
  30 #define AUXIO_LED         0x01    /* On if set, off if unset. Read/Write */
  31 
  32 #define AUXREG   ((volatile unsigned char *)(AUXIO_VADDR + 3))
  33 #define AUXREG4M ((volatile unsigned char *)(AUXIO_VADDR))
  34 
  35 #define TURN_ON_LED   *AUXREG = (*AUXREG | AUXIO_ORMEIN | AUXIO_LED)
  36 #define TURN_OFF_LED  *AUXREG = ((*AUXREG | AUXIO_ORMEIN) & (~AUXIO_LED))
  37 #define FLIP_LED      *AUXREG = ((*AUXREG | AUXIO_ORMEIN) ^ AUXIO_LED)
  38 #define FLPY_MOTORON  *AUXREG = ((*AUXREG | AUXIO_ORMEIN) | AUXIO_FLPY_DSEL)
  39 #define FLPY_MOTOROFF *AUXREG = ((*AUXREG | AUXIO_ORMEIN) & (~AUXIO_FLPY_DSEL))
  40 #define FLPY_TCNTON   *AUXREG = ((*AUXREG | AUXIO_ORMEIN) | AUXIO_FLPY_TCNT)
  41 #define FLPY_TCNTOFF  *AUXREG = ((*AUXREG | AUXIO_ORMEIN) & (~AUXIO_FLPY_TCNT))
  42 
  43 #ifndef __ASSEMBLY__
  44 extern inline void set_auxio(unsigned char bits_on, unsigned char bits_off)
     /* [previous][next][first][last][top][bottom][index][help] */
  45 {
  46         unsigned char regval;
  47 
  48         cli();
  49 
  50         switch(sparc_cpu_model) {
  51         case sun4c:
  52                 regval = *AUXREG;
  53                 *AUXREG = ((regval | bits_on) & ~bits_off) | AUXIO_ORMEIN;
  54                 break;
  55         case sun4m:
  56                 regval = *AUXREG4M;
  57                 *AUXREG4M = ((regval | bits_on) & ~bits_off) | AUXIO_ORMEIN4M;
  58                 break;
  59         default:
  60                 panic("Can't set AUXIO register on this machine.");
  61         };
  62 
  63         sti();
  64 
  65         return;
  66 }
  67 #endif /* !(__ASSEMBLY__) */
  68 
  69 #endif /* !(_SPARC_AUXIO_H) */

/* [previous][next][first][last][top][bottom][index][help] */