Path: blob/master/arch/alpha/include/asm/core_irongate.h
15126 views
#ifndef __ALPHA_IRONGATE__H__1#define __ALPHA_IRONGATE__H__23#include <linux/types.h>4#include <asm/compiler.h>56/*7* IRONGATE is the internal name for the AMD-751 K7 core logic chipset8* which provides memory controller and PCI access for NAUTILUS-based9* EV6 (21264) systems.10*11* This file is based on:12*13* IronGate management library, (c) 1999 Alpha Processor, Inc.14* Copyright (C) 1999 Alpha Processor, Inc.,15* (David Daniel, Stig Telfer, Soohoon Lee)16*/1718/*19* The 21264 supports, and internally recognizes, a 44-bit physical20* address space that is divided equally between memory address space21* and I/O address space. Memory address space resides in the lower22* half of the physical address space (PA[43]=0) and I/O address space23* resides in the upper half of the physical address space (PA[43]=1).24*/2526/*27* Irongate CSR map. Some of the CSRs are 8 or 16 bits, but all access28* through the routines given is 32-bit.29*30* The first 0x40 bytes are standard as per the PCI spec.31*/3233typedef volatile __u32 igcsr32;3435typedef struct {36igcsr32 dev_vendor; /* 0x00 - device ID, vendor ID */37igcsr32 stat_cmd; /* 0x04 - status, command */38igcsr32 class; /* 0x08 - class code, rev ID */39igcsr32 latency; /* 0x0C - header type, PCI latency */40igcsr32 bar0; /* 0x10 - BAR0 - AGP */41igcsr32 bar1; /* 0x14 - BAR1 - GART */42igcsr32 bar2; /* 0x18 - Power Management reg block */4344igcsr32 rsrvd0[6]; /* 0x1C-0x33 reserved */4546igcsr32 capptr; /* 0x34 - Capabilities pointer */4748igcsr32 rsrvd1[2]; /* 0x38-0x3F reserved */4950igcsr32 bacsr10; /* 0x40 - base address chip selects */51igcsr32 bacsr32; /* 0x44 - base address chip selects */52igcsr32 bacsr54_eccms761; /* 0x48 - 751: base addr. chip selects53761: ECC, mode/status */5455igcsr32 rsrvd2[1]; /* 0x4C-0x4F reserved */5657igcsr32 drammap; /* 0x50 - address mapping control */58igcsr32 dramtm; /* 0x54 - timing, driver strength */59igcsr32 dramms; /* 0x58 - DRAM mode/status */6061igcsr32 rsrvd3[1]; /* 0x5C-0x5F reserved */6263igcsr32 biu0; /* 0x60 - bus interface unit */64igcsr32 biusip; /* 0x64 - Serial initialisation pkt */6566igcsr32 rsrvd4[2]; /* 0x68-0x6F reserved */6768igcsr32 mro; /* 0x70 - memory request optimiser */6970igcsr32 rsrvd5[3]; /* 0x74-0x7F reserved */7172igcsr32 whami; /* 0x80 - who am I */73igcsr32 pciarb; /* 0x84 - PCI arbitration control */74igcsr32 pcicfg; /* 0x88 - PCI config status */7576igcsr32 rsrvd6[4]; /* 0x8C-0x9B reserved */7778igcsr32 pci_mem; /* 0x9C - PCI top of memory,79761 only */8081/* AGP (bus 1) control registers */82igcsr32 agpcap; /* 0xA0 - AGP Capability Identifier */83igcsr32 agpstat; /* 0xA4 - AGP status register */84igcsr32 agpcmd; /* 0xA8 - AGP control register */85igcsr32 agpva; /* 0xAC - AGP Virtual Address Space */86igcsr32 agpmode; /* 0xB0 - AGP/GART mode control */87} Irongate0;888990typedef struct {9192igcsr32 dev_vendor; /* 0x00 - Device and Vendor IDs */93igcsr32 stat_cmd; /* 0x04 - Status and Command regs */94igcsr32 class; /* 0x08 - subclass, baseclass etc */95igcsr32 htype; /* 0x0C - header type (at 0x0E) */96igcsr32 rsrvd0[2]; /* 0x10-0x17 reserved */97igcsr32 busnos; /* 0x18 - Primary, secondary bus nos */98igcsr32 io_baselim_regs; /* 0x1C - IO base, IO lim, AGP status */99igcsr32 mem_baselim; /* 0x20 - memory base, memory lim */100igcsr32 pfmem_baselim; /* 0x24 - prefetchable base, lim */101igcsr32 rsrvd1[2]; /* 0x28-0x2F reserved */102igcsr32 io_baselim; /* 0x30 - IO base, IO limit */103igcsr32 rsrvd2[2]; /* 0x34-0x3B - reserved */104igcsr32 interrupt; /* 0x3C - interrupt, PCI bridge ctrl */105106} Irongate1;107108extern igcsr32 *IronECC;109110/*111* Memory spaces:112*/113114/* Irongate is consistent with a subset of the Tsunami memory map */115#ifdef USE_48_BIT_KSEG116#define IRONGATE_BIAS 0x80000000000UL117#else118#define IRONGATE_BIAS 0x10000000000UL119#endif120121122#define IRONGATE_MEM (IDENT_ADDR | IRONGATE_BIAS | 0x000000000UL)123#define IRONGATE_IACK_SC (IDENT_ADDR | IRONGATE_BIAS | 0x1F8000000UL)124#define IRONGATE_IO (IDENT_ADDR | IRONGATE_BIAS | 0x1FC000000UL)125#define IRONGATE_CONF (IDENT_ADDR | IRONGATE_BIAS | 0x1FE000000UL)126127/*128* PCI Configuration space accesses are formed like so:129*130* 0x1FE << 24 | : 2 2 2 2 1 1 1 1 : 1 1 1 1 1 1 0 0 : 0 0 0 0 0 0 0 0 :131* : 3 2 1 0 9 8 7 6 : 5 4 3 2 1 0 9 8 : 7 6 5 4 3 2 1 0 :132* ---bus numer--- -device-- -fun- ---register----133*/134135#define IGCSR(dev,fun,reg) ( IRONGATE_CONF | \136((dev)<<11) | \137((fun)<<8) | \138(reg) )139140#define IRONGATE0 ((Irongate0 *) IGCSR(0, 0, 0))141#define IRONGATE1 ((Irongate1 *) IGCSR(1, 0, 0))142143/*144* Data structure for handling IRONGATE machine checks:145* This is the standard OSF logout frame146*/147148#define SCB_Q_SYSERR 0x620 /* OSF definitions */149#define SCB_Q_PROCERR 0x630150#define SCB_Q_SYSMCHK 0x660151#define SCB_Q_PROCMCHK 0x670152153struct el_IRONGATE_sysdata_mcheck {154__u32 FrameSize; /* Bytes, including this field */155__u32 FrameFlags; /* <31> = Retry, <30> = Second Error */156__u32 CpuOffset; /* Offset to CPU-specific into */157__u32 SystemOffset; /* Offset to system-specific info */158__u32 MCHK_Code;159__u32 MCHK_Frame_Rev;160__u64 I_STAT;161__u64 DC_STAT;162__u64 C_ADDR;163__u64 DC1_SYNDROME;164__u64 DC0_SYNDROME;165__u64 C_STAT;166__u64 C_STS;167__u64 RESERVED0;168__u64 EXC_ADDR;169__u64 IER_CM;170__u64 ISUM;171__u64 MM_STAT;172__u64 PAL_BASE;173__u64 I_CTL;174__u64 PCTX;175};176177178#ifdef __KERNEL__179180#ifndef __EXTERN_INLINE181#define __EXTERN_INLINE extern inline182#define __IO_EXTERN_INLINE183#endif184185/*186* I/O functions:187*188* IRONGATE (AMD-751) PCI/memory support chip for the EV6 (21264) and189* K7 can only use linear accesses to get at PCI memory and I/O spaces.190*/191192/*193* Memory functions. All accesses are done through linear space.194*/195196__EXTERN_INLINE void __iomem *irongate_ioportmap(unsigned long addr)197{198return (void __iomem *)(addr + IRONGATE_IO);199}200201extern void __iomem *irongate_ioremap(unsigned long addr, unsigned long size);202extern void irongate_iounmap(volatile void __iomem *addr);203204__EXTERN_INLINE int irongate_is_ioaddr(unsigned long addr)205{206return addr >= IRONGATE_MEM;207}208209__EXTERN_INLINE int irongate_is_mmio(const volatile void __iomem *xaddr)210{211unsigned long addr = (unsigned long)xaddr;212return addr < IRONGATE_IO || addr >= IRONGATE_CONF;213}214215#undef __IO_PREFIX216#define __IO_PREFIX irongate217#define irongate_trivial_rw_bw 1218#define irongate_trivial_rw_lq 1219#define irongate_trivial_io_bw 1220#define irongate_trivial_io_lq 1221#define irongate_trivial_iounmap 0222#include <asm/io_trivial.h>223224#ifdef __IO_EXTERN_INLINE225#undef __EXTERN_INLINE226#undef __IO_EXTERN_INLINE227#endif228229#endif /* __KERNEL__ */230231#endif /* __ALPHA_IRONGATE__H__ */232233234