OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [asm-sparc/] [auxio.h] - Diff between revs 1765 and 1782

Only display areas with differences | Details | Blame | View Log

Rev 1765 Rev 1782
/* $Id: auxio.h,v 1.1 2005-12-20 11:32:11 jcastillo Exp $
/* $Id: auxio.h,v 1.1 2005-12-20 11:32:11 jcastillo Exp $
 * auxio.h:  Definitions and code for the Auxiliary I/O register.
 * auxio.h:  Definitions and code for the Auxiliary I/O register.
 *
 *
 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
 */
 */
#ifndef _SPARC_AUXIO_H
#ifndef _SPARC_AUXIO_H
#define _SPARC_AUXIO_H
#define _SPARC_AUXIO_H
 
 
#include <asm/system.h>
#include <asm/system.h>
#include <asm/vaddrs.h>
#include <asm/vaddrs.h>
 
 
extern unsigned char *auxio_register;
extern unsigned char *auxio_register;
 
 
/* This register is an unsigned char in IO space.  It does two things.
/* This register is an unsigned char in IO space.  It does two things.
 * First, it is used to control the front panel LED light on machines
 * First, it is used to control the front panel LED light on machines
 * that have it (good for testing entry points to trap handlers and irq's)
 * that have it (good for testing entry points to trap handlers and irq's)
 * Secondly, it controls various floppy drive parameters.
 * Secondly, it controls various floppy drive parameters.
 */
 */
#define AUXIO_ORMEIN      0xf0    /* All writes must set these bits. */
#define AUXIO_ORMEIN      0xf0    /* All writes must set these bits. */
#define AUXIO_ORMEIN4M    0xc0    /* sun4m - All writes must set these bits. */
#define AUXIO_ORMEIN4M    0xc0    /* sun4m - All writes must set these bits. */
#define AUXIO_FLPY_DENS   0x20    /* Floppy density, high if set. Read only. */
#define AUXIO_FLPY_DENS   0x20    /* Floppy density, high if set. Read only. */
#define AUXIO_FLPY_DCHG   0x10    /* A disk change occurred.  Read only. */
#define AUXIO_FLPY_DCHG   0x10    /* A disk change occurred.  Read only. */
#define AUXIO_EDGE_ON     0x10    /* sun4m - On means Jumper block is in. */
#define AUXIO_EDGE_ON     0x10    /* sun4m - On means Jumper block is in. */
#define AUXIO_FLPY_DSEL   0x08    /* Drive select/start-motor. Write only. */
#define AUXIO_FLPY_DSEL   0x08    /* Drive select/start-motor. Write only. */
 
 
/* Set the following to one, then zero, after doing a pseudo DMA transfer. */
/* Set the following to one, then zero, after doing a pseudo DMA transfer. */
#define AUXIO_FLPY_TCNT   0x04    /* Floppy terminal count. Write only. */
#define AUXIO_FLPY_TCNT   0x04    /* Floppy terminal count. Write only. */
 
 
/* Set the following to zero to eject the floppy. */
/* Set the following to zero to eject the floppy. */
#define AUXIO_FLPY_EJCT   0x02    /* Eject floppy disk.  Write only. */
#define AUXIO_FLPY_EJCT   0x02    /* Eject floppy disk.  Write only. */
#define AUXIO_LED         0x01    /* On if set, off if unset. Read/Write */
#define AUXIO_LED         0x01    /* On if set, off if unset. Read/Write */
 
 
#define AUXREG   ((volatile unsigned char *)(auxio_register))
#define AUXREG   ((volatile unsigned char *)(auxio_register))
 
 
#define TURN_ON_LED   *AUXREG = (*AUXREG | AUXIO_ORMEIN | AUXIO_LED)
#define TURN_ON_LED   *AUXREG = (*AUXREG | AUXIO_ORMEIN | AUXIO_LED)
#define TURN_OFF_LED  *AUXREG = ((*AUXREG | AUXIO_ORMEIN) & (~AUXIO_LED))
#define TURN_OFF_LED  *AUXREG = ((*AUXREG | AUXIO_ORMEIN) & (~AUXIO_LED))
#define FLIP_LED      *AUXREG = ((*AUXREG | AUXIO_ORMEIN) ^ AUXIO_LED)
#define FLIP_LED      *AUXREG = ((*AUXREG | AUXIO_ORMEIN) ^ AUXIO_LED)
#define FLPY_MOTORON  *AUXREG = ((*AUXREG | AUXIO_ORMEIN) | AUXIO_FLPY_DSEL)
#define FLPY_MOTORON  *AUXREG = ((*AUXREG | AUXIO_ORMEIN) | AUXIO_FLPY_DSEL)
#define FLPY_MOTOROFF *AUXREG = ((*AUXREG | AUXIO_ORMEIN) & (~AUXIO_FLPY_DSEL))
#define FLPY_MOTOROFF *AUXREG = ((*AUXREG | AUXIO_ORMEIN) & (~AUXIO_FLPY_DSEL))
#define FLPY_TCNTON   *AUXREG = ((*AUXREG | AUXIO_ORMEIN) | AUXIO_FLPY_TCNT)
#define FLPY_TCNTON   *AUXREG = ((*AUXREG | AUXIO_ORMEIN) | AUXIO_FLPY_TCNT)
#define FLPY_TCNTOFF  *AUXREG = ((*AUXREG | AUXIO_ORMEIN) & (~AUXIO_FLPY_TCNT))
#define FLPY_TCNTOFF  *AUXREG = ((*AUXREG | AUXIO_ORMEIN) & (~AUXIO_FLPY_TCNT))
 
 
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLY__
extern inline void set_auxio(unsigned char bits_on, unsigned char bits_off)
extern inline void set_auxio(unsigned char bits_on, unsigned char bits_off)
{
{
        unsigned char regval;
        unsigned char regval;
        unsigned long flags;
        unsigned long flags;
 
 
        save_flags(flags); cli();
        save_flags(flags); cli();
 
 
        switch(sparc_cpu_model) {
        switch(sparc_cpu_model) {
        case sun4c:
        case sun4c:
                regval = *AUXREG;
                regval = *AUXREG;
                *AUXREG = ((regval | bits_on) & ~bits_off) | AUXIO_ORMEIN;
                *AUXREG = ((regval | bits_on) & ~bits_off) | AUXIO_ORMEIN;
                break;
                break;
        case sun4m:
        case sun4m:
                regval = *AUXREG;
                regval = *AUXREG;
                *AUXREG = ((regval | bits_on) & ~bits_off) | AUXIO_ORMEIN4M;
                *AUXREG = ((regval | bits_on) & ~bits_off) | AUXIO_ORMEIN4M;
                break;
                break;
        default:
        default:
                panic("Can't set AUXIO register on this machine.");
                panic("Can't set AUXIO register on this machine.");
        };
        };
 
 
        restore_flags(flags);
        restore_flags(flags);
}
}
#endif /* !(__ASSEMBLY__) */
#endif /* !(__ASSEMBLY__) */
 
 
#endif /* !(_SPARC_AUXIO_H) */
#endif /* !(_SPARC_AUXIO_H) */
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.