[BACK]Return to mvme188.h CVS log [TXT][DIR] Up to [local] / sys / arch / mvme88k / include

Annotation of sys/arch/mvme88k/include/mvme188.h, Revision 1.1.1.1

1.1       nbrk        1: /*     $OpenBSD: mvme188.h,v 1.30 2007/05/19 17:03:47 miod Exp $ */
                      2: /*
                      3:  * Copyright (c) 1999 Steve Murphree, Jr.
                      4:  * All rights reserved.
                      5:  *
                      6:  * Redistribution and use in source and binary forms, with or without
                      7:  * modification, are permitted provided that the following conditions
                      8:  * are met:
                      9:  * 1. Redistributions of source code must retain the above copyright
                     10:  *    notice, this list of conditions and the following disclaimer.
                     11:  * 2. Redistributions in binary form must reproduce the above copyright
                     12:  *    notice, this list of conditions and the following disclaimer in the
                     13:  *    documentation and/or other materials provided with the distribution.
                     14:  * 3. All advertising materials mentioning features or use of this software
                     15:  *    must display the following acknowledgement:
                     16:  *      This product includes software developed by Steve Murphree, Jr.
                     17:  * 4. The name of the author may not be used to endorse or promote products
                     18:  *    derived from this software without specific prior written permission
                     19:  *
                     20:  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
                     21:  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
                     22:  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
                     23:  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
                     24:  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
                     25:  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
                     26:  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
                     27:  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
                     28:  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
                     29:  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
                     30:  *
                     31:  */
                     32: /*
                     33:  * Mach Operating System
                     34:  * Copyright (c) 1991 Carnegie Mellon University
                     35:  * Copyright (c) 1991 OMRON Corporation
                     36:  * All Rights Reserved.
                     37:  *
                     38:  * Permission to use, copy, modify and distribute this software and its
                     39:  * documentation is hereby granted, provided that both the copyright
                     40:  * notice and this permission notice appear in all copies of the
                     41:  * software, derivative works or modified versions, and any portions
                     42:  * thereof, and that both notices appear in supporting documentation.
                     43:  *
                     44:  */
                     45:
                     46: #ifndef        __MACHINE_MVME188_H__
                     47: #define        __MACHINE_MVME188_H__
                     48:
                     49: #define MVME188_EPROM          0xffc00000
                     50: #define MVME188_EPROM_SIZE     0x00080000
                     51: #define MVME188_SRAM           0xffe00000
                     52: #define MVME188_SRAM_SIZE      0x00020000
                     53: #define MVME188_UTILITY                0xfff00000
                     54: #define MVME188_UTILITY_SIZE   0x00090000
                     55:
                     56: /*
                     57:  * MVME188 declarations for hardware level device registers and such.
                     58:  */
                     59:
                     60: /* per-processor interrupt enable registers */
                     61: #define        MVME188_IENBASE 0xfff84000
                     62: #define MVME188_IEN0   0xfff84004      /* interrupt enable CPU 0 */
                     63: #define MVME188_IEN1   0xfff84008      /* interrupt enable CPU 1 */
                     64: #define MVME188_IEN2   0xfff84010      /* interrupt enable CPU 2 */
                     65: #define MVME188_IEN3   0xfff84020      /* interrupt enable CPU 3 */
                     66: #define        MVME188_IENALL  0xfff8403c      /* simultaneous write */
                     67: #define        MVME188_IEN(cpu)        (MVME188_IENBASE + (4 << (cpu)))
                     68:
                     69: #define MVME188_IST    0xfff84040      /* interrupt status register */
                     70:
                     71: #define MVME188_SETSWI 0xfff84080      /* generate soft interrupt */
                     72: #define MVME188_CLRSWI 0xfff84084      /* reset soft interrupt */
                     73: #define MVME188_ISTATE 0xfff84088      /* HW interrupt status */
                     74: #define MVME188_CLRINT 0xfff8408c      /* reset HW interrupt */
                     75:
                     76: #define MVME188_VIRQLV 0xfff85000
                     77: #define        MVME188_VIACK1V 0xfff85004
                     78: #define        MVME188_VIACK2V 0xfff85008
                     79: #define        MVME188_VIACK3V 0xfff8500c
                     80: #define        MVME188_VIACK4V 0xfff85010
                     81: #define        MVME188_VIACK5V 0xfff85014
                     82: #define        MVME188_VIACK6V 0xfff85018
                     83: #define        MVME188_VIACK7V 0xfff8501c
                     84: #define        MVME188_VIRQV   0xfff85020
                     85: #define M188_IVEC              0x40    /* vector returned upon MVME188 int */
                     86:
                     87: #define        MVME188_GLOBAL0 0xfff86001      /* global control and status regs */
                     88: #define        MVME188_GLOBAL1 0xfff86003
                     89: #define        M188_LRST               0x80
                     90: #define        M188_SYSCON             0x40
                     91: #define        MVME188_BRDID   0xfff86005
                     92: #define        MVME188_CGCSR0  0xfff86007
                     93: #define        MVME188_CGCSR1  0xfff86009
                     94: #define        MVME188_CGCSR2  0xfff8600b
                     95: #define        MVME188_CGCSR3  0xfff8600d
                     96: #define        MVME188_CGCSR4  0xfff8600f
                     97: #define MVME188_UCSR   0xfff87000      /* utility control and status reg */
                     98: #define        MVME188_BASAD   0xfff87004      /* base address reg */
                     99: #define MVME188_GLBRES 0xfff8700c      /* global reset reg */
                    100:
                    101: #define MVME188_CCSR   0xfff88000      /* CPU board control status reg */
                    102: #define MVME188_ERROR  0xfff88004      /* Mbus fault reg */
                    103: #define MVME188_PCNFA  0xfff88008      /* Pbus A decoder reg */
                    104: #define MVME188_PCNFB  0xfff8800c      /* Pbus B decoder reg */
                    105: #define MVME188_EXTAD  0xfff88010      /* A24 master A24-A31 addr reg */
                    106: #define MVME188_WHOAMI 0xfff88018      /* whoami reg */
                    107: #define MVME188_WMAD   0xfff88020      /* write mbus addr decoder reg */
                    108: #define MVME188_RMAD   0xfff88024      /* read mbus addr decoder reg */
                    109: #define MVME188_WVAD   0xfff88028      /* write vmebus addr decoder reg */
                    110: #define MVME188_RVAD   0xfff8802c      /* read vmebus adds decoder reg */
                    111:
                    112: /*
                    113:  * IEN and IST register bits
                    114:  * Refer to MVME188 RISC Microcomputer User's Manual, table 4.3
                    115:  */
                    116:
                    117: #define IRQ_ABORT              0x80000000      /* 31 */
                    118: #define IRQ_ACF                        0x40000000      /* 30 */
                    119: #define IRQ_ARBTO              0x20000000      /* 29 */
                    120: #define IRQ_DTI                        0x10000000      /* 28 */
                    121: #define IRQ_SWI7               0x08000000      /* 27 */
                    122: #define IRQ_SWI6               0x04000000      /* 26 */
                    123: #define IRQ_SWI5               0x02000000      /* 25 */
                    124: #define IRQ_SWI4               0x01000000      /* 24 */
                    125: #define IRQ_VME7               0x00800000      /* 23 */
                    126: #define IRQ_CIOI               0x00200000      /* 21 */
                    127: #define IRQ_SF                 0x00100000      /* 20 */
                    128: #define IRQ_VME6               0x00080000      /* 19 */
                    129: #define IRQ_DI                 0x00020000      /* 17 */
                    130: #define IRQ_SIGHPI             0x00010000      /* 16 */
                    131: #define IRQ_VME5               0x00004000      /* 14 */
                    132: #define IRQ_VME4               0x00001000      /* 12 */
                    133: #define IRQ_VME3               0x00000400      /* 10 */
                    134: #define IRQ_LMI                        0x00000100      /* 08 */
                    135: #define IRQ_SIGLPI             0x00000080      /* 07 */
                    136: #define IRQ_VME2               0x00000040      /* 06 */
                    137: #define IRQ_VME1               0x00000010      /* 04 */
                    138: #define IRQ_SWI3               0x00000008      /* 03 */
                    139: #define IRQ_SWI2               0x00000004      /* 02 */
                    140: #define IRQ_SWI1               0x00000002      /* 01 */
                    141: #define IRQ_SWI0               0x00000001      /* 00 */
                    142:
                    143: #define IST_STRING     "\20" \
                    144:        "\40ABRT\37ACF\36ARBTO\35DTI\34SWI7\33SWI6\32SWI5\31SWI4" \
                    145:        "\30IRQ7\26CIOI\25SF\24IRQ6\22DI\21SIGHPI" \
                    146:        "\17IRQ5\15IRQ4\13IRQ3\11LMI" \
                    147:        "\10SIGLPI\7IRQ2\5IRQ1\4SWI3\3SWI2\2SWI1\1SWI0"
                    148:
                    149: /* groups by function */
                    150:
                    151: /* hardware irq bits */
                    152: #define HW_FAILURE_MASK                (IRQ_ABORT | IRQ_ACF | IRQ_ARBTO | IRQ_SF)
                    153: /* software irq bits */
                    154: #define SOFT_INTERRUPT_MASK    (IRQ_SWI7 | IRQ_SWI6 | IRQ_SWI5 | IRQ_SWI4)
                    155: /* IPI bits (see below) */
                    156: #define IPI_MASK               (IRQ_SWI3 | IRQ_SWI2 | IRQ_SWI1 | IRQ_SWI0)
                    157: /* VME irq bits */
                    158: #define VME_INTERRUPT_MASK     (IRQ_VME7 | IRQ_VME6 | IRQ_VME5 | IRQ_VME4 | \
                    159:                                 IRQ_VME3 | IRQ_VME2 | IRQ_VME1)
                    160: /* on-board irq bits */
                    161: #define OBIO_INTERRUPT_MASK    (IRQ_DTI | IRQ_CIOI | IRQ_DI | IRQ_SIGHPI | \
                    162:                                 IRQ_LMI | IRQ_SIGLPI)
                    163:
                    164: /* groups by interrupt levels */
                    165:
                    166: #define LVL7                   (IRQ_ABORT | IRQ_ACF /* | IRQ_VME7 */ | IRQ_SF)
                    167: #define LVL6                   (IRQ_VME6)
                    168: #define LVL5                   (IRQ_VME5 | IRQ_DTI | IRQ_CIOI)
                    169: #define LVL4                   (IRQ_VME4)
                    170: #define LVL3                   (IRQ_VME3 | IRQ_DI)
                    171: #define LVL2                   (IRQ_VME2)
                    172: #define LVL1                   (IRQ_VME1)
                    173: #define LVL0                   (0x0)
                    174:
                    175: /* interrupts we want to process on the master CPU only */
                    176: #define SLAVE_MASK (HW_FAILURE_MASK | OBIO_INTERRUPT_MASK | VME_INTERRUPT_MASK)
                    177:
                    178: #define MASK_LVL_0             (LVL7 | LVL6 | LVL5 | LVL4 | LVL3 | LVL2 | LVL1)
                    179: #define MASK_LVL_1             (LVL7 | LVL6 | LVL5 | LVL4 | LVL3 | LVL2)
                    180: #define MASK_LVL_2             (LVL7 | LVL6 | LVL5 | LVL4 | LVL3)
                    181: #define MASK_LVL_3             (LVL7 | LVL6 | LVL5 | LVL4)
                    182: #define MASK_LVL_4             (LVL7 | LVL6 | LVL5)
                    183: #define MASK_LVL_5             (LVL7 | LVL6)
                    184: #define MASK_LVL_6             (LVL7)
                    185: #define MASK_LVL_7             (IRQ_ABORT)
                    186:
                    187: #define INT_LEVEL              8               /* # of interrupt level + 1 */
                    188: #define ISR_GET_CURRENT_MASK(cpu) \
                    189:        (*(volatile u_int *)MVME188_IST & int_mask_reg[cpu])
                    190:
                    191: /*
                    192:  * Software interrupts 0 to 3 are used to deliver IPIs to cpu0-3.
                    193:  * We rely on the fact that the control bits for these interrupts are
                    194:  * the same in the interrupt registers and the set/clear SWI registers.
                    195:  */
                    196: #define        IPI_BIT(cpuid)          (1 << (cpuid))
                    197:
                    198: /*
                    199:  * ISTATE and CLRINT register bits
                    200:  */
                    201:
                    202: #define ISTATE_ABORT           0x04
                    203: #define        ISTATE_ACFAIL           0x02
                    204: #define        ISTATE_SYSFAIL          0x01
                    205:
                    206: /*
                    207:  * UCSR register bits
                    208:  */
                    209:
                    210: #define UCSR_PWRUPBIT  0x00004000      /* powerup indicator */
                    211: #define UCSR_DRVSFBIT  0x00002000      /* Board system fail */
                    212: #define UCSR_BRIRQBIT  0x00001000      /* drives VME IRQ1 broadcast int */
                    213: #define UCSR_ROBINBIT  0x00000800      /* sel round robin VME arbiter mode */
                    214: #define UCSR_BRLVBITS  0x00000600      /* VME bus request level 0-3 */
                    215: #define UCSR_RNEVERBIT  0x00000100     /* VME bus never release once req'd */
                    216: #define UCSR_RONRBIT   0x00000080      /* VME bus req release on no request */
                    217: #define UCSR_RWDBIT    0x00000040      /* VME bus request release when done */
                    218: #define UCSR_EARBTOBIT  0x00000020     /* enable VME arbiter bus timeout */
                    219: #define VTOSELBITS     0x00000018      /* VMEbus timeout select bits */
                    220: #define VTO32US                        0x00    /* 32 usec */
                    221: #define VTO64US                        0x01    /* 64 usec */
                    222: #define VTO128US               0x10    /* 128 usec */
                    223: #define VTODISABLE             0x18    /* disabled */
                    224:
                    225: /* these are the various Z8536 CIO counter/timer registers */
                    226: #define CIO_BASE               0xfff83000
                    227: #define CIO_PORTC              0xfff83000
                    228: #define CIO_PORTB              0xfff83004
                    229: #define CIO_PORTA              0xfff83008
                    230: #define CIO_CTRL               0xfff8300c
                    231:
                    232: #define CIO_MICR               0x00    /* Master interrupt control register */
                    233: #define CIO_MICR_MIE           0x80
                    234: #define CIO_MICR_DLC           0x40
                    235: #define CIO_MICR_NV            0x20
                    236: #define CIO_MICR_PAVIS         0x10
                    237: #define CIO_MICR_PBVIS         0x08
                    238: #define CIO_MICR_CTVIS         0x04
                    239: #define CIO_MICR_RJA           0x02
                    240: #define CIO_MICR_RESET         0x01
                    241:
                    242: #define CIO_MCCR               0x01    /* Master config control register */
                    243: #define CIO_MCCR_PBE           0x80
                    244: #define CIO_MCCR_CT1E          0x40
                    245: #define CIO_MCCR_CT2E          0x20
                    246: #define CIO_MCCR_CT3E          0x10
                    247: #define CIO_MCCR_PLC           0x08
                    248: #define CIO_MCCR_PAE           0x04
                    249:
                    250: #define CIO_CTMS1              0x1c    /* Counter/timer mode specification #1 */
                    251: #define CIO_CTMS2              0x1d    /* Counter/timer mode specification #2 */
                    252: #define CIO_CTMS3              0x1e    /* Counter/timer mode specification #3 */
                    253: #define CIO_CTMS_CSC           0x80    /* Continuous Single Cycle */
                    254: #define CIO_CTMS_EOE           0x40    /* External Output Enable  */
                    255: #define CIO_CTMS_ECE           0x20    /* External Count Enable   */
                    256: #define CIO_CTMS_ETE           0x10    /* External Trigger Enable */
                    257: #define CIO_CTMS_EGE           0x08    /* External Gate Enable    */
                    258: #define CIO_CTMS_REB           0x04    /* Retrigger Enable Bit    */
                    259: #define CIO_CTMS_PO            0x00    /* Pulse Output            */
                    260: #define CIO_CTMS_OSO           0x01    /* One Shot Output         */
                    261: #define CIO_CTMS_SWO           0x02    /* Square Wave Output      */
                    262:
                    263: #define CIO_IVR                        0x04    /* Interrupt vector register */
                    264:
                    265: #define CIO_CSR1               0x0a    /* Command and status register CTC #1 */
                    266: #define CIO_CSR2               0x0b    /* Command and status register CTC #2 */
                    267: #define CIO_CSR3               0x0c    /* Command and status register CTC #3 */
                    268:
                    269: #define CIO_CT1MSB             0x16    /* CTC #1 Timer constant - MSB */
                    270: #define CIO_CT1LSB             0x17    /* CTC #1 Timer constant - LSB */
                    271: #define CIO_CT2MSB             0x18    /* CTC #2 Timer constant - MSB */
                    272: #define CIO_CT2LSB             0x19    /* CTC #2 Timer constant - LSB */
                    273: #define CIO_CT3MSB             0x1a    /* CTC #3 Timer constant - MSB */
                    274: #define CIO_CT3LSB             0x1b    /* CTC #3 Timer constant - LSB */
                    275: #define CIO_PDCA               0x23    /* Port A data direction control */
                    276: #define CIO_PDCB               0x2b    /* Port B data direction control */
                    277:
                    278: #define CIO_GCB                        0x04    /* CTC Gate command bit */
                    279: #define CIO_TCB                        0x02    /* CTC Trigger command bit */
                    280: #define CIO_IE                 0xc0    /* CTC Interrupt enable (set) */
                    281: #define CIO_CIP                        0x20    /* CTC Clear interrupt pending */
                    282: #define CIO_IP                 0x20    /* CTC Interrupt pending */
                    283:
                    284: #define DART_BASE              0xfff82000
                    285:
                    286: /*
                    287:  * HYPERmodule CMMU addresses
                    288:  */
                    289:
                    290: #define VME_CMMU_I0    0xfff7e000
                    291: #define VME_CMMU_I1    0xfff7d000
                    292: #define VME_CMMU_I2    0xfff7b000
                    293: #define VME_CMMU_I3    0xfff77000
                    294: #define VME_CMMU_D0    0xfff6f000
                    295: #define VME_CMMU_D1    0xfff5f000
                    296: #define VME_CMMU_D2    0xfff3f000
                    297: #define VME_CMMU_D3    0xfff7f000
                    298:
                    299: #if defined(_KERNEL) && !defined(_LOCORE)
                    300: extern u_int32_t pfsr_save_188_straight[];
                    301: extern u_int32_t pfsr_save_188_double[];
                    302: extern u_int32_t pfsr_save_188_quad[];
                    303: #endif
                    304:
                    305: #endif /* __MACHINE_MVME188_H__ */

CVSweb