162306a36Sopenharmony_ci/* 262306a36Sopenharmony_ci * Definitions for the SGI CRIME (CPU, Rendering, Interconnect and Memory 362306a36Sopenharmony_ci * Engine) 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public 662306a36Sopenharmony_ci * License. See the file "COPYING" in the main directory of this archive 762306a36Sopenharmony_ci * for more details. 862306a36Sopenharmony_ci * 962306a36Sopenharmony_ci * Copyright (C) 2000 Harald Koerfgen 1062306a36Sopenharmony_ci */ 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ci#ifndef __ASM_CRIME_H__ 1362306a36Sopenharmony_ci#define __ASM_CRIME_H__ 1462306a36Sopenharmony_ci 1562306a36Sopenharmony_ci/* 1662306a36Sopenharmony_ci * Address map 1762306a36Sopenharmony_ci */ 1862306a36Sopenharmony_ci#define CRIME_BASE 0x14000000 /* physical */ 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_cistruct sgi_crime { 2162306a36Sopenharmony_ci volatile unsigned long id; 2262306a36Sopenharmony_ci#define CRIME_ID_MASK 0xff 2362306a36Sopenharmony_ci#define CRIME_ID_IDBITS 0xf0 2462306a36Sopenharmony_ci#define CRIME_ID_IDVALUE 0xa0 2562306a36Sopenharmony_ci#define CRIME_ID_REV 0x0f 2662306a36Sopenharmony_ci#define CRIME_REV_PETTY 0x00 2762306a36Sopenharmony_ci#define CRIME_REV_11 0x11 2862306a36Sopenharmony_ci#define CRIME_REV_13 0x13 2962306a36Sopenharmony_ci#define CRIME_REV_14 0x14 3062306a36Sopenharmony_ci 3162306a36Sopenharmony_ci volatile unsigned long control; 3262306a36Sopenharmony_ci#define CRIME_CONTROL_MASK 0x3fff 3362306a36Sopenharmony_ci#define CRIME_CONTROL_TRITON_SYSADC 0x2000 3462306a36Sopenharmony_ci#define CRIME_CONTROL_CRIME_SYSADC 0x1000 3562306a36Sopenharmony_ci#define CRIME_CONTROL_HARD_RESET 0x0800 3662306a36Sopenharmony_ci#define CRIME_CONTROL_SOFT_RESET 0x0400 3762306a36Sopenharmony_ci#define CRIME_CONTROL_DOG_ENA 0x0200 3862306a36Sopenharmony_ci#define CRIME_CONTROL_ENDIANESS 0x0100 3962306a36Sopenharmony_ci#define CRIME_CONTROL_ENDIAN_BIG 0x0100 4062306a36Sopenharmony_ci#define CRIME_CONTROL_ENDIAN_LITTLE 0x0000 4162306a36Sopenharmony_ci#define CRIME_CONTROL_CQUEUE_HWM 0x000f 4262306a36Sopenharmony_ci#define CRIME_CONTROL_CQUEUE_SHFT 0 4362306a36Sopenharmony_ci#define CRIME_CONTROL_WBUF_HWM 0x00f0 4462306a36Sopenharmony_ci#define CRIME_CONTROL_WBUF_SHFT 8 4562306a36Sopenharmony_ci 4662306a36Sopenharmony_ci volatile unsigned long istat; 4762306a36Sopenharmony_ci volatile unsigned long imask; 4862306a36Sopenharmony_ci volatile unsigned long soft_int; 4962306a36Sopenharmony_ci volatile unsigned long hard_int; 5062306a36Sopenharmony_ci#define MACE_VID_IN1_INT BIT(0) 5162306a36Sopenharmony_ci#define MACE_VID_IN2_INT BIT(1) 5262306a36Sopenharmony_ci#define MACE_VID_OUT_INT BIT(2) 5362306a36Sopenharmony_ci#define MACE_ETHERNET_INT BIT(3) 5462306a36Sopenharmony_ci#define MACE_SUPERIO_INT BIT(4) 5562306a36Sopenharmony_ci#define MACE_MISC_INT BIT(5) 5662306a36Sopenharmony_ci#define MACE_AUDIO_INT BIT(6) 5762306a36Sopenharmony_ci#define MACE_PCI_BRIDGE_INT BIT(7) 5862306a36Sopenharmony_ci#define MACEPCI_SCSI0_INT BIT(8) 5962306a36Sopenharmony_ci#define MACEPCI_SCSI1_INT BIT(9) 6062306a36Sopenharmony_ci#define MACEPCI_SLOT0_INT BIT(10) 6162306a36Sopenharmony_ci#define MACEPCI_SLOT1_INT BIT(11) 6262306a36Sopenharmony_ci#define MACEPCI_SLOT2_INT BIT(12) 6362306a36Sopenharmony_ci#define MACEPCI_SHARED0_INT BIT(13) 6462306a36Sopenharmony_ci#define MACEPCI_SHARED1_INT BIT(14) 6562306a36Sopenharmony_ci#define MACEPCI_SHARED2_INT BIT(15) 6662306a36Sopenharmony_ci#define CRIME_GBE0_INT BIT(16) 6762306a36Sopenharmony_ci#define CRIME_GBE1_INT BIT(17) 6862306a36Sopenharmony_ci#define CRIME_GBE2_INT BIT(18) 6962306a36Sopenharmony_ci#define CRIME_GBE3_INT BIT(19) 7062306a36Sopenharmony_ci#define CRIME_CPUERR_INT BIT(20) 7162306a36Sopenharmony_ci#define CRIME_MEMERR_INT BIT(21) 7262306a36Sopenharmony_ci#define CRIME_RE_EMPTY_E_INT BIT(22) 7362306a36Sopenharmony_ci#define CRIME_RE_FULL_E_INT BIT(23) 7462306a36Sopenharmony_ci#define CRIME_RE_IDLE_E_INT BIT(24) 7562306a36Sopenharmony_ci#define CRIME_RE_EMPTY_L_INT BIT(25) 7662306a36Sopenharmony_ci#define CRIME_RE_FULL_L_INT BIT(26) 7762306a36Sopenharmony_ci#define CRIME_RE_IDLE_L_INT BIT(27) 7862306a36Sopenharmony_ci#define CRIME_SOFT0_INT BIT(28) 7962306a36Sopenharmony_ci#define CRIME_SOFT1_INT BIT(29) 8062306a36Sopenharmony_ci#define CRIME_SOFT2_INT BIT(30) 8162306a36Sopenharmony_ci#define CRIME_SYSCORERR_INT CRIME_SOFT2_INT 8262306a36Sopenharmony_ci#define CRIME_VICE_INT BIT(31) 8362306a36Sopenharmony_ci/* Masks for deciding who handles the interrupt */ 8462306a36Sopenharmony_ci#define CRIME_MACE_INT_MASK 0x8f 8562306a36Sopenharmony_ci#define CRIME_MACEISA_INT_MASK 0x70 8662306a36Sopenharmony_ci#define CRIME_MACEPCI_INT_MASK 0xff00 8762306a36Sopenharmony_ci#define CRIME_CRIME_INT_MASK 0xffff0000 8862306a36Sopenharmony_ci 8962306a36Sopenharmony_ci volatile unsigned long watchdog; 9062306a36Sopenharmony_ci#define CRIME_DOG_POWER_ON_RESET 0x00010000 9162306a36Sopenharmony_ci#define CRIME_DOG_WARM_RESET 0x00080000 9262306a36Sopenharmony_ci#define CRIME_DOG_TIMEOUT (CRIME_DOG_POWER_ON_RESET|CRIME_DOG_WARM_RESET) 9362306a36Sopenharmony_ci#define CRIME_DOG_VALUE 0x00007fff 9462306a36Sopenharmony_ci 9562306a36Sopenharmony_ci volatile unsigned long timer; 9662306a36Sopenharmony_ci#define CRIME_MASTER_FREQ 66666500 /* Crime upcounter frequency */ 9762306a36Sopenharmony_ci#define CRIME_NS_PER_TICK 15 /* for delay_calibrate */ 9862306a36Sopenharmony_ci 9962306a36Sopenharmony_ci volatile unsigned long cpu_error_addr; 10062306a36Sopenharmony_ci#define CRIME_CPU_ERROR_ADDR_MASK 0x3ffffffff 10162306a36Sopenharmony_ci 10262306a36Sopenharmony_ci volatile unsigned long cpu_error_stat; 10362306a36Sopenharmony_ci#define CRIME_CPU_ERROR_MASK 0x7 /* cpu error stat is 3 bits */ 10462306a36Sopenharmony_ci#define CRIME_CPU_ERROR_CPU_ILL_ADDR 0x4 10562306a36Sopenharmony_ci#define CRIME_CPU_ERROR_VICE_WRT_PRTY 0x2 10662306a36Sopenharmony_ci#define CRIME_CPU_ERROR_CPU_WRT_PRTY 0x1 10762306a36Sopenharmony_ci 10862306a36Sopenharmony_ci unsigned long _pad0[54]; 10962306a36Sopenharmony_ci 11062306a36Sopenharmony_ci volatile unsigned long mc_ctrl; 11162306a36Sopenharmony_ci volatile unsigned long bank_ctrl[8]; 11262306a36Sopenharmony_ci#define CRIME_MEM_BANK_CONTROL_MASK 0x11f /* 9 bits 7:5 reserved */ 11362306a36Sopenharmony_ci#define CRIME_MEM_BANK_CONTROL_ADDR 0x01f 11462306a36Sopenharmony_ci#define CRIME_MEM_BANK_CONTROL_SDRAM_SIZE 0x100 11562306a36Sopenharmony_ci#define CRIME_MAXBANKS 8 11662306a36Sopenharmony_ci 11762306a36Sopenharmony_ci volatile unsigned long mem_ref_counter; 11862306a36Sopenharmony_ci#define CRIME_MEM_REF_COUNTER_MASK 0x3ff /* 10bit */ 11962306a36Sopenharmony_ci 12062306a36Sopenharmony_ci volatile unsigned long mem_error_stat; 12162306a36Sopenharmony_ci#define CRIME_MEM_ERROR_STAT_MASK 0x0ff7ffff /* 28-bit register */ 12262306a36Sopenharmony_ci#define CRIME_MEM_ERROR_MACE_ID 0x0000007f 12362306a36Sopenharmony_ci#define CRIME_MEM_ERROR_MACE_ACCESS 0x00000080 12462306a36Sopenharmony_ci#define CRIME_MEM_ERROR_RE_ID 0x00007f00 12562306a36Sopenharmony_ci#define CRIME_MEM_ERROR_RE_ACCESS 0x00008000 12662306a36Sopenharmony_ci#define CRIME_MEM_ERROR_GBE_ACCESS 0x00010000 12762306a36Sopenharmony_ci#define CRIME_MEM_ERROR_VICE_ACCESS 0x00020000 12862306a36Sopenharmony_ci#define CRIME_MEM_ERROR_CPU_ACCESS 0x00040000 12962306a36Sopenharmony_ci#define CRIME_MEM_ERROR_RESERVED 0x00080000 13062306a36Sopenharmony_ci#define CRIME_MEM_ERROR_SOFT_ERR 0x00100000 13162306a36Sopenharmony_ci#define CRIME_MEM_ERROR_HARD_ERR 0x00200000 13262306a36Sopenharmony_ci#define CRIME_MEM_ERROR_MULTIPLE 0x00400000 13362306a36Sopenharmony_ci#define CRIME_MEM_ERROR_ECC 0x01800000 13462306a36Sopenharmony_ci#define CRIME_MEM_ERROR_MEM_ECC_RD 0x00800000 13562306a36Sopenharmony_ci#define CRIME_MEM_ERROR_MEM_ECC_RMW 0x01000000 13662306a36Sopenharmony_ci#define CRIME_MEM_ERROR_INV 0x0e000000 13762306a36Sopenharmony_ci#define CRIME_MEM_ERROR_INV_MEM_ADDR_RD 0x02000000 13862306a36Sopenharmony_ci#define CRIME_MEM_ERROR_INV_MEM_ADDR_WR 0x04000000 13962306a36Sopenharmony_ci#define CRIME_MEM_ERROR_INV_MEM_ADDR_RMW 0x08000000 14062306a36Sopenharmony_ci 14162306a36Sopenharmony_ci volatile unsigned long mem_error_addr; 14262306a36Sopenharmony_ci#define CRIME_MEM_ERROR_ADDR_MASK 0x3fffffff 14362306a36Sopenharmony_ci 14462306a36Sopenharmony_ci volatile unsigned long mem_ecc_syn; 14562306a36Sopenharmony_ci#define CRIME_MEM_ERROR_ECC_SYN_MASK 0xffffffff 14662306a36Sopenharmony_ci 14762306a36Sopenharmony_ci volatile unsigned long mem_ecc_chk; 14862306a36Sopenharmony_ci#define CRIME_MEM_ERROR_ECC_CHK_MASK 0xffffffff 14962306a36Sopenharmony_ci 15062306a36Sopenharmony_ci volatile unsigned long mem_ecc_repl; 15162306a36Sopenharmony_ci#define CRIME_MEM_ERROR_ECC_REPL_MASK 0xffffffff 15262306a36Sopenharmony_ci}; 15362306a36Sopenharmony_ci 15462306a36Sopenharmony_ciextern struct sgi_crime __iomem *crime; 15562306a36Sopenharmony_ci 15662306a36Sopenharmony_ci#define CRIME_HI_MEM_BASE 0x40000000 /* this is where whole 1G of RAM is mapped */ 15762306a36Sopenharmony_ci 15862306a36Sopenharmony_ci#endif /* __ASM_CRIME_H__ */ 159