Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Definitions for the SGI CRIME (CPU, Rendering, Interconnect and Memory
0003  * Engine)
0004  *
0005  * This file is subject to the terms and conditions of the GNU General Public
0006  * License.  See the file "COPYING" in the main directory of this archive
0007  * for more details.
0008  *
0009  * Copyright (C) 2000 Harald Koerfgen
0010  */
0011 
0012 #ifndef __ASM_CRIME_H__
0013 #define __ASM_CRIME_H__
0014 
0015 /*
0016  * Address map
0017  */
0018 #define CRIME_BASE  0x14000000  /* physical */
0019 
0020 struct sgi_crime {
0021     volatile unsigned long id;
0022 #define CRIME_ID_MASK           0xff
0023 #define CRIME_ID_IDBITS         0xf0
0024 #define CRIME_ID_IDVALUE        0xa0
0025 #define CRIME_ID_REV            0x0f
0026 #define CRIME_REV_PETTY         0x00
0027 #define CRIME_REV_11            0x11
0028 #define CRIME_REV_13            0x13
0029 #define CRIME_REV_14            0x14
0030 
0031     volatile unsigned long control;
0032 #define CRIME_CONTROL_MASK      0x3fff
0033 #define CRIME_CONTROL_TRITON_SYSADC 0x2000
0034 #define CRIME_CONTROL_CRIME_SYSADC  0x1000
0035 #define CRIME_CONTROL_HARD_RESET    0x0800
0036 #define CRIME_CONTROL_SOFT_RESET    0x0400
0037 #define CRIME_CONTROL_DOG_ENA       0x0200
0038 #define CRIME_CONTROL_ENDIANESS     0x0100
0039 #define CRIME_CONTROL_ENDIAN_BIG    0x0100
0040 #define CRIME_CONTROL_ENDIAN_LITTLE 0x0000
0041 #define CRIME_CONTROL_CQUEUE_HWM    0x000f
0042 #define CRIME_CONTROL_CQUEUE_SHFT   0
0043 #define CRIME_CONTROL_WBUF_HWM      0x00f0
0044 #define CRIME_CONTROL_WBUF_SHFT     8
0045 
0046     volatile unsigned long istat;
0047     volatile unsigned long imask;
0048     volatile unsigned long soft_int;
0049     volatile unsigned long hard_int;
0050 #define MACE_VID_IN1_INT        BIT(0)
0051 #define MACE_VID_IN2_INT        BIT(1)
0052 #define MACE_VID_OUT_INT        BIT(2)
0053 #define MACE_ETHERNET_INT       BIT(3)
0054 #define MACE_SUPERIO_INT        BIT(4)
0055 #define MACE_MISC_INT           BIT(5)
0056 #define MACE_AUDIO_INT          BIT(6)
0057 #define MACE_PCI_BRIDGE_INT     BIT(7)
0058 #define MACEPCI_SCSI0_INT       BIT(8)
0059 #define MACEPCI_SCSI1_INT       BIT(9)
0060 #define MACEPCI_SLOT0_INT       BIT(10)
0061 #define MACEPCI_SLOT1_INT       BIT(11)
0062 #define MACEPCI_SLOT2_INT       BIT(12)
0063 #define MACEPCI_SHARED0_INT     BIT(13)
0064 #define MACEPCI_SHARED1_INT     BIT(14)
0065 #define MACEPCI_SHARED2_INT     BIT(15)
0066 #define CRIME_GBE0_INT          BIT(16)
0067 #define CRIME_GBE1_INT          BIT(17)
0068 #define CRIME_GBE2_INT          BIT(18)
0069 #define CRIME_GBE3_INT          BIT(19)
0070 #define CRIME_CPUERR_INT        BIT(20)
0071 #define CRIME_MEMERR_INT        BIT(21)
0072 #define CRIME_RE_EMPTY_E_INT        BIT(22)
0073 #define CRIME_RE_FULL_E_INT     BIT(23)
0074 #define CRIME_RE_IDLE_E_INT     BIT(24)
0075 #define CRIME_RE_EMPTY_L_INT        BIT(25)
0076 #define CRIME_RE_FULL_L_INT     BIT(26)
0077 #define CRIME_RE_IDLE_L_INT     BIT(27)
0078 #define CRIME_SOFT0_INT         BIT(28)
0079 #define CRIME_SOFT1_INT         BIT(29)
0080 #define CRIME_SOFT2_INT         BIT(30)
0081 #define CRIME_SYSCORERR_INT     CRIME_SOFT2_INT
0082 #define CRIME_VICE_INT          BIT(31)
0083 /* Masks for deciding who handles the interrupt */
0084 #define CRIME_MACE_INT_MASK     0x8f
0085 #define CRIME_MACEISA_INT_MASK      0x70
0086 #define CRIME_MACEPCI_INT_MASK      0xff00
0087 #define CRIME_CRIME_INT_MASK        0xffff0000
0088 
0089     volatile unsigned long watchdog;
0090 #define CRIME_DOG_POWER_ON_RESET    0x00010000
0091 #define CRIME_DOG_WARM_RESET        0x00080000
0092 #define CRIME_DOG_TIMEOUT       (CRIME_DOG_POWER_ON_RESET|CRIME_DOG_WARM_RESET)
0093 #define CRIME_DOG_VALUE         0x00007fff
0094 
0095     volatile unsigned long timer;
0096 #define CRIME_MASTER_FREQ       66666500    /* Crime upcounter frequency */
0097 #define CRIME_NS_PER_TICK       15      /* for delay_calibrate */
0098 
0099     volatile unsigned long cpu_error_addr;
0100 #define CRIME_CPU_ERROR_ADDR_MASK   0x3ffffffff
0101 
0102     volatile unsigned long cpu_error_stat;
0103 #define CRIME_CPU_ERROR_MASK        0x7     /* cpu error stat is 3 bits */
0104 #define CRIME_CPU_ERROR_CPU_ILL_ADDR    0x4
0105 #define CRIME_CPU_ERROR_VICE_WRT_PRTY   0x2
0106 #define CRIME_CPU_ERROR_CPU_WRT_PRTY    0x1
0107 
0108     unsigned long _pad0[54];
0109 
0110     volatile unsigned long mc_ctrl;
0111     volatile unsigned long bank_ctrl[8];
0112 #define CRIME_MEM_BANK_CONTROL_MASK     0x11f   /* 9 bits 7:5 reserved */
0113 #define CRIME_MEM_BANK_CONTROL_ADDR     0x01f
0114 #define CRIME_MEM_BANK_CONTROL_SDRAM_SIZE   0x100
0115 #define CRIME_MAXBANKS              8
0116 
0117     volatile unsigned long mem_ref_counter;
0118 #define CRIME_MEM_REF_COUNTER_MASK  0x3ff       /* 10bit */
0119 
0120     volatile unsigned long mem_error_stat;
0121 #define CRIME_MEM_ERROR_STAT_MASK   0x0ff7ffff  /* 28-bit register */
0122 #define CRIME_MEM_ERROR_MACE_ID     0x0000007f
0123 #define CRIME_MEM_ERROR_MACE_ACCESS 0x00000080
0124 #define CRIME_MEM_ERROR_RE_ID       0x00007f00
0125 #define CRIME_MEM_ERROR_RE_ACCESS   0x00008000
0126 #define CRIME_MEM_ERROR_GBE_ACCESS  0x00010000
0127 #define CRIME_MEM_ERROR_VICE_ACCESS 0x00020000
0128 #define CRIME_MEM_ERROR_CPU_ACCESS  0x00040000
0129 #define CRIME_MEM_ERROR_RESERVED    0x00080000
0130 #define CRIME_MEM_ERROR_SOFT_ERR    0x00100000
0131 #define CRIME_MEM_ERROR_HARD_ERR    0x00200000
0132 #define CRIME_MEM_ERROR_MULTIPLE    0x00400000
0133 #define CRIME_MEM_ERROR_ECC     0x01800000
0134 #define CRIME_MEM_ERROR_MEM_ECC_RD  0x00800000
0135 #define CRIME_MEM_ERROR_MEM_ECC_RMW 0x01000000
0136 #define CRIME_MEM_ERROR_INV     0x0e000000
0137 #define CRIME_MEM_ERROR_INV_MEM_ADDR_RD 0x02000000
0138 #define CRIME_MEM_ERROR_INV_MEM_ADDR_WR 0x04000000
0139 #define CRIME_MEM_ERROR_INV_MEM_ADDR_RMW 0x08000000
0140 
0141     volatile unsigned long mem_error_addr;
0142 #define CRIME_MEM_ERROR_ADDR_MASK   0x3fffffff
0143 
0144     volatile unsigned long mem_ecc_syn;
0145 #define CRIME_MEM_ERROR_ECC_SYN_MASK    0xffffffff
0146 
0147     volatile unsigned long mem_ecc_chk;
0148 #define CRIME_MEM_ERROR_ECC_CHK_MASK    0xffffffff
0149 
0150     volatile unsigned long mem_ecc_repl;
0151 #define CRIME_MEM_ERROR_ECC_REPL_MASK   0xffffffff
0152 };
0153 
0154 extern struct sgi_crime __iomem *crime;
0155 
0156 #define CRIME_HI_MEM_BASE   0x40000000  /* this is where whole 1G of RAM is mapped */
0157 
0158 #endif /* __ASM_CRIME_H__ */