/*- * Copyright (c) 1996-1999 Eduardo Horvath * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * from: NetBSD: sbusreg.h,v 1.7 1999/06/07 05:28:03 eeh Exp * * $FreeBSD$ */ #ifndef _SPARC64_SBUS_SBUSREG_H_ #define _SPARC64_SBUS_SBUSREG_H_ /* * Sbus device addresses are obtained from the FORTH PROMs. They come * in `absolute' and `relative' address flavors, so we have to handle both. * Relative addresses do *not* include the slot number. */ #define SBUS_BASE 0xf8000000 #define SBUS_ADDR(slot, off) (SBUS_BASE + ((slot) << 25) + (off)) #define SBUS_ABS(a) ((unsigned)(a) >= SBUS_BASE) #define SBUS_ABS_TO_SLOT(a) (((a) - SBUS_BASE) >> 25) #define SBUS_ABS_TO_OFFSET(a) (((a) - SBUS_BASE) & 0x1ffffff) /* * Sun4u S-bus definitions. Here's where we deal w/the machine * dependencies of sysio. * * SYSIO implements or is the interface to several things: * * o The SBUS interface itself * o The IOMMU * o The DVMA units * o The interrupt controller * o The counter/timers * * Since it has registers to control lots of different things * as well as several on-board SBUS devices and external SBUS * slots scattered throughout its address space, it's a pain. * * One good point, however, is that all registers are 64-bit. */ #define SBR_UPA_PORTID 0x0000 /* UPA port ID register */ #define SBR_UPA_CONFIG 0x0008 /* UPA config register */ #define SBR_CS 0x0010 /* SYSIO control/status register */ #define SBR_ECCC 0x0020 /* ECC control register */ #define SBR_UE_AFS 0x0030 /* Uncorrectable Error AFSR */ #define SBR_UE_AFA 0x0038 /* Uncorrectable Error AFAR */ #define SBR_CE_AFS 0x0040 /* Correctable Error AFSR */ #define SBR_CE_AFA 0x0048 /* Correctable Error AFAR */ #define SBR_PM_CTL 0x0100 /* Performance monitor control reg */ #define SBR_PM_COUNT 0x0108 /* Performance monitor counter reg */ #define SBR_CTL 0x2000 /* SBUS Control Register */ #define SBR_AFS 0x2010 /* SBUS AFSR */ #define SBR_AFA 0x2018 /* SBUS AFAR */ #define SBR_CONFIG0 0x2020 /* SBUS Slot 0 config register */ #define SBR_CONFIG1 0x2028 /* SBUS Slot 1 config register */ #define SBR_CONFIG2 0x2030 /* SBUS Slot 2 config register */ #define SBR_CONFIG3 0x2038 /* SBUS Slot 3 config register */ #define SBR_CONFIG13 0x2040 /* Slot 13 config register