Annotation of sys/arch/mvme68k/dev/ipicreg.h, Revision 1.1
1.1 ! nbrk 1: /* $OpenBSD: ipicreg.h,v 1.7 2005/11/24 22:43:16 miod Exp $ */
! 2:
! 3: /*
! 4: * Copyright (c) 1995 Theo de Raadt
! 5: * All rights reserved.
! 6: *
! 7: * Redistribution and use in source and binary forms, with or without
! 8: * modification, are permitted provided that the following conditions
! 9: * are met:
! 10: * 1. Redistributions of source code must retain the above copyright
! 11: * notice, this list of conditions and the following disclaimer.
! 12: * 2. Redistributions in binary form must reproduce the above copyright
! 13: * notice, this list of conditions and the following disclaimer in the
! 14: * documentation and/or other materials provided with the distribution.
! 15: *
! 16: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
! 17: * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
! 18: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
! 19: * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
! 20: * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
! 21: * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
! 22: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
! 23: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
! 24: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
! 25: * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
! 26: */
! 27:
! 28: struct ipicreg {
! 29: volatile u_char ipic_chipid;
! 30: #define IPIC_CHIPID 0x23
! 31: volatile u_char ipic_chiprev;
! 32: volatile u_char x0[2];
! 33: volatile u_short ipic_base[4]; /* [slot] */
! 34: volatile u_char ipic_size[4]; /* [slot] */
! 35: volatile u_char ipic_irq[4][2]; /* [slot][irq#] */
! 36: #define IPIC_IRQ_PLTY 0x80 /* 1 = rising edge activated */
! 37: #define IPIC_IRQ_EL 0x40 /* 1 = edge, 0 = level sensitive */
! 38: #define IPIC_IRQ_INT 0x20 /* interrupt is active */
! 39: #define IPIC_IRQ_IEN 0x10 /* enable interrupt */
! 40: #define IPIC_IRQ_ICLR 0x08 /* clear interrupt */
! 41: #define IPIC_IRQ_IPLMASK 0x07
! 42: volatile u_char ipic_ctl[4]; /* [slot] */
! 43: #define IPIC_CTL_ERR 0x80 /* error from IP module */
! 44: #define IPIC_CTL_RTMASK 0x30 /* recovery time, measured in ms */
! 45: #define IPIC_CTL_RT0MS 0x00
! 46: #define IPIC_CTL_RT2MS 0x10
! 47: #define IPIC_CTL_RT4MS 0x20
! 48: #define IPIC_CTL_RT8MS 0x30
! 49: #define IPIC_CTL_WIDTHMASK 0x0c /* bus width */
! 50: #define IPIC_CTL_WIDTH32 0x00
! 51: #define IPIC_CTL_WIDTH8 0x04
! 52: #define IPIC_CTL_WIDTH16 0x08
! 53: #define IPIC_CTL_MEN 0x01 /* ??? */
! 54: volatile u_char x1[3];
! 55: volatile u_char ipic_reset;
! 56: #define IPIC_RESET 0x01 /* bit clears automatically after 1ms */
! 57: };
! 58:
! 59: /*
! 60: * the following macros convert the size in bytes to/from the
! 61: * ipic_Xsize reg values. you should ensure your size in bytes
! 62: * is a legal value, which are 16K, or all the powers of 2 from
! 63: * 64K to 8M.
! 64: */
! 65: #define IPIC_SIZE_BTOR(x) \
! 66: (((x) == 16*1024) ? (0xff) : (((x) / 64*1024) - 1))
! 67: #define IPIC_SIZE_RTOB(x) \
! 68: (((x) == 0xff) ? (16*1024) : (((x) + 1) * 64*1024))
! 69:
! 70: struct ipid {
! 71: volatile u_char ipid_I; /* must be 'I' */
! 72: volatile u_char :8;
! 73: volatile u_char ipid_P; /* must be 'P' */
! 74: volatile u_char :8;
! 75: volatile u_char ipid_A; /* must be 'A' */
! 76: volatile u_char :8;
! 77: volatile u_char ipid_C; /* must be 'C' */
! 78: volatile u_char :8;
! 79: volatile u_char ipid_manu;
! 80: volatile u_char :8;
! 81: volatile u_char ipid_prod;
! 82: volatile u_char :8;
! 83: volatile u_char ipid_rev;
! 84: volatile u_char :8;
! 85: volatile u_char ipid_zero;
! 86: volatile u_char :8;
! 87: volatile u_char ipid_didl;
! 88: volatile u_char :8;
! 89: volatile u_char ipid_didh;
! 90: volatile u_char :8;
! 91: volatile u_char ipid_pspecn; /* # shorts in pack-spec id */
! 92: volatile u_char :8;
! 93: volatile u_char ipid_crc;
! 94: volatile u_char :8;
! 95: volatile u_char ipic_pspecbase; /* start of pack-spec id */
! 96: };
! 97:
! 98: #define IPIC_IPSPACE 0xfff58000
! 99: #define IPIC_IP_MODSIZE 0x00000100
! 100: #define IPIC_IP_IDOFFSET 0x80
! 101: #define IPIC_IP_REGOFFSET 0x00
! 102:
! 103: struct ipicsoftc {
! 104: struct device sc_dev;
! 105: struct ipicreg *sc_ipic;
! 106:
! 107: vaddr_t sc_ipspace;
! 108: int sc_nip;
! 109: };
! 110:
! 111: int ipicintr_establish(int, struct intrhand *, const char *);
CVSweb