Home | History | Annotate | Line # | Download | only in dev
crimereg.h revision 1.4
      1  1.4   pooka /*	$NetBSD: crimereg.h,v 1.4 2002/12/23 20:04:22 pooka Exp $	*/
      2  1.1   soren 
      3  1.1   soren /*
      4  1.1   soren  * Copyright (c) 2000 Soren S. Jorvang
      5  1.1   soren  * All rights reserved.
      6  1.3  simonb  *
      7  1.1   soren  * Redistribution and use in source and binary forms, with or without
      8  1.1   soren  * modification, are permitted provided that the following conditions
      9  1.1   soren  * are met:
     10  1.1   soren  * 1. Redistributions of source code must retain the above copyright
     11  1.1   soren  *    notice, this list of conditions and the following disclaimer.
     12  1.1   soren  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.1   soren  *    notice, this list of conditions and the following disclaimer in the
     14  1.1   soren  *    documentation and/or other materials provided with the distribution.
     15  1.1   soren  * 3. All advertising materials mentioning features or use of this software
     16  1.1   soren  *    must display the following acknowledgement:
     17  1.1   soren  *          This product includes software developed for the
     18  1.1   soren  *          NetBSD Project.  See http://www.netbsd.org/ for
     19  1.1   soren  *          information about NetBSD.
     20  1.1   soren  * 4. The name of the author may not be used to endorse or promote products
     21  1.1   soren  *    derived from this software without specific prior written permission.
     22  1.3  simonb  *
     23  1.1   soren  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     24  1.1   soren  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     25  1.1   soren  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     26  1.1   soren  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     27  1.1   soren  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     28  1.1   soren  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     29  1.1   soren  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     30  1.1   soren  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     31  1.1   soren  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     32  1.1   soren  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     33  1.1   soren  */
     34  1.1   soren 
     35  1.1   soren /*
     36  1.1   soren  * O2 CRIME register definitions
     37  1.1   soren  */
     38  1.1   soren 
     39  1.4   pooka #define CRIME_BASE		0x14000000 /* all registers 64-bit access */
     40  1.4   pooka 
     41  1.4   pooka /* Offset 0x00 -- revision register */
     42  1.4   pooka #define CRIME_REV         (CRIME_BASE+0x000)
     43  1.4   pooka #define CRIME_ID_IDBITS   0xf0
     44  1.4   pooka #define CRIME_ID_IDVALUE  0xa0
     45  1.4   pooka #define CRIME_ID_REV      0x0f
     46  1.4   pooka #define CRIME_REV_PETTY   0x0
     47  1.4   pooka #define CRIME_REV_11      0x11
     48  1.4   pooka #define CRIME_REV_13      0x13
     49  1.4   pooka #define CRIME_REV_14      0x14
     50  1.4   pooka 
     51  1.4   pooka /* offset 0x08 -- control register.  Only lower 14 bits are valid*/
     52  1.4   pooka #define CRIME_CONTROL			  (CRIME_BASE+0x008)
     53  1.4   pooka #define CRIME_CONTROL_TRITON_SYSADC       0x2000
     54  1.4   pooka #define CRIME_CONTROL_CRIME_SYSADC        0x1000
     55  1.4   pooka #define CRIME_CONTROL_HARD_RESET          0x0800
     56  1.4   pooka #define CRIME_CONTROL_SOFT_RESET          0x0400
     57  1.4   pooka #define CRIME_CONTROL_DOG_ENABLE          0x0200
     58  1.4   pooka #define CRIME_CONTROL_ENDIANESS           0x0100 /* assert for BE */
     59  1.4   pooka #define CRIME_CONTROL_CQUEUE_HWM          0x000f
     60  1.4   pooka #define CRIME_CONTROL_CQUEUE_SHFT         0
     61  1.4   pooka #define CRIME_CONTROL_WBUF_HWM            0x00f0
     62  1.4   pooka #define CRIME_CONTROL_WBUF_SHFT           8
     63  1.4   pooka 
     64  1.4   pooka /*
     65  1.4   pooka  * macros to manipulate CRIME High Water Mark bits in
     66  1.4   pooka  * the CRIME control register.  Examples:
     67  1.4   pooka  *
     68  1.4   pooka  * foo = CRM_CONTROL_GET_CQUEUE_HWM(*(__uint64_t *)CRM_CONTROL)
     69  1.4   pooka  * CRM_CONTROL_SET_CQUEUE_HWM(*(__uint64_t *)CRM_CONTROL, 4)
     70  1.4   pooka  *
     71  1.4   pooka  * foo = CRM_CONTROL_GET_WBUF_HWM(*(__uint64_t *)CRM_CONTROL)
     72  1.4   pooka  * CRM_CONTROL_SET_WBUF_HWM(*(__uint64_t *)CRM_CONTROL, 4)
     73  1.4   pooka  */
     74  1.4   pooka #define CRM_CONTROL_GET_CQUEUE_HWM(x)   \
     75  1.4   pooka         (((x) & CRM_CONTROL_CQUEUE_HWM) >> CRM_CONTROL_CQUEUE_SHFT)
     76  1.4   pooka #define CRM_CONTROL_SET_CQUEUE_HWM(x,v) \
     77  1.4   pooka         (((v) << CRM_CONTROL_CQUEUE_SHFT) | ((x) & ~CRM_CONTROL_CQUEUE_HWM))
     78  1.4   pooka 
     79  1.4   pooka #define CRM_CONTROL_GET_WBUF_HWM(x)     \
     80  1.4   pooka         (((x) & CRM_CONTROL_WBUF_HWM) >> CRM_CONTROL_WBUF_SHFT)
     81  1.4   pooka #define CRM_CONTROL_SET_WBUF_HWM(x,v)   \
     82  1.4   pooka         (((v) << CRM_CONTROL_WBUF_SHFT) | ((x) & ~CRM_CONTROL_WBUF_HWM))
     83  1.4   pooka 
     84  1.4   pooka 
     85  1.4   pooka /* Offset 0x010 -- interrupt status register.  All 32 bits valid */
     86  1.4   pooka #define CRIME_INTSTAT		(CRIME_BASE+0x010)
     87  1.4   pooka #define CRIME_INT_VICE		0x80000000
     88  1.4   pooka #define CRIME_INT_SOFT2		0x40000000 /* Also CPU_SysCorErr */
     89  1.4   pooka #define CRIME_INT_SOFT1		0x20000000
     90  1.4   pooka #define CRIME_INT_SOFT0		0x10000000
     91  1.4   pooka #define CRIME_INT_RE5		0x08000000
     92  1.4   pooka #define CRIME_INT_RE4		0x04000000
     93  1.4   pooka #define CRIME_INT_RE3		0x02000000
     94  1.4   pooka #define CRIME_INT_RE2		0x01000000
     95  1.4   pooka #define CRIME_INT_RE1		0x00800000
     96  1.4   pooka #define CRIME_INT_RE0		0x00400000
     97  1.4   pooka #define CRIME_INT_MEMERR	0x00200000
     98  1.4   pooka #define CRIME_INT_CRMERR	0x00100000
     99  1.4   pooka #define CRIME_INT_GBE3		0x00080000
    100  1.4   pooka #define CRIME_INT_GBE2		0x00040000
    101  1.4   pooka #define CRIME_INT_GBE1		0x00020000
    102  1.4   pooka #define CRIME_INT_GBE0		0x00010000
    103  1.4   pooka #define CRIME_INT_PCI_SHARED2	0x00008000 /* from here, actually mace irqs */
    104  1.4   pooka #define CRIME_INT_PCI_SHARED1	0x00004000
    105  1.4   pooka #define CRIME_INT_PCI_SHARED0	0x00002000
    106  1.4   pooka #define CRIME_INT_PCI_SLOT2	0x00001000
    107  1.4   pooka #define CRIME_INT_PCI_SLOT1	0x00000800
    108  1.4   pooka #define CRIME_INT_PCI_SLOT0	0x00000400
    109  1.4   pooka #define CRIME_INT_PCI_SCSI1	0x00000200
    110  1.4   pooka #define CRIME_INT_PCI_SCSI0	0x00000100
    111  1.4   pooka #define CRIME_INT_PCI_BRIDGE	0x00000080
    112  1.4   pooka #define CRIME_INT_PERIPH_AUD	0x00000040
    113  1.4   pooka #define CRIME_INT_PERIPH_MISC	0x00000020
    114  1.4   pooka #define CRIME_INT_PERIPH_SERIAL	0x00000010
    115  1.4   pooka #define CRIME_INT_ETHERNET	0x00000008
    116  1.4   pooka #define CRIME_INT_VID_OUT	0x00000004
    117  1.4   pooka #define CRIME_INT_VID_IN2	0x00000002
    118  1.4   pooka #define CRIME_INT_VID_IN1	0x00000001
    119  1.4   pooka 
    120  1.4   pooka /* Masks, hard interrupts, soft interrupts.  Don't know what to do with these */
    121  1.4   pooka #define CRIME_INTMASK		(CRIME_BASE+0x018)
    122  1.4   pooka #define CRIME_SOFTINT		(CRIME_BASE+0x020)
    123  1.4   pooka #define CRIME_HARDINT		(CRIME_BASE+0x028)
    124  1.4   pooka 
    125  1.4   pooka /*
    126  1.4   pooka  * Offset 0x030 -- watchdog register.  33 bits are valid
    127  1.4   pooka  * Bit   32:  power on reset
    128  1.4   pooka  * Bit	  31:  warm reset
    129  1.4   pooka  * Write zero here to reset watchdog
    130  1.4   pooka  */
    131  1.4   pooka 
    132  1.4   pooka #define CRIME_DOG		(CRIME_BASE+0x030)
    133  1.4   pooka #define CRIME_WATCHDOG		CRIME_DOG
    134  1.4   pooka #define CRIME_TIME		(CRIME_BASE+0x038)
    135  1.4   pooka #define CRIME_CPU_ERROR_ADDR	(CRIME_BASE+0x040)
    136  1.4   pooka #define CRIME_CPU_ERROR_STAT	(CRIME_BASE+0x048)
    137  1.4   pooka #define CRIME_CPU_ERROR_ENA	(CRIME_BASE+0x050)
    138  1.4   pooka #define CRIME_VICE_ERROR_ADDR	(CRIME_BASE+0x058)
    139  1.4   pooka #define CRIME_MEM_CONTROL	(CRIME_BASE+0x200)
    140  1.4   pooka #define CRIME_MEM_BANK_CTRL0	(CRIME_BASE+0x208)
    141  1.4   pooka #define CRIME_MEM_BANK_CTRL1	(CRIME_BASE+0x218)
    142  1.4   pooka #define CRIME_MEM_BANK_CTRL2	(CRIME_BASE+0x210)
    143  1.4   pooka #define CRIME_MEM_BANK_CTRL3	(CRIME_BASE+0x228)
    144  1.4   pooka #define CRIME_MEM_BANK_CTRL4	(CRIME_BASE+0x220)
    145  1.4   pooka #define CRIME_MEM_BANK_CTRL5	(CRIME_BASE+0x238)
    146  1.4   pooka #define CRIME_MEM_BANK_CTRL6	(CRIME_BASE+0x230)
    147  1.4   pooka #define CRIME_MEM_BANK_CTRL7	(CRIME_BASE+0x248)
    148  1.4   pooka #define CRIME_MEM_REFRESH_CNTR	(CRIME_BASE+0x248)
    149  1.4   pooka #define CRIME_MEM_ERROR_STAT	(CRIME_BASE+0x250)
    150  1.4   pooka #define CRIME_MEM_ERROR_ADDR	(CRIME_BASE+0x258)
    151  1.4   pooka #define CRIME_MEM_ERROR_ECC_SYN	(CRIME_BASE+0x260)
    152  1.4   pooka #define CRIME_MEM_ERROR_ECC_CHK	(CRIME_BASE+0x268)
    153  1.4   pooka #define CRIME_MEM_ERROR_ECC_REPL (CRIME_BASE+0x270)
    154  1.4   pooka 
    155  1.4   pooka #define McGriff CRIME_DOG /* Baseball compatibility */
    156