/* $NetBSD: sbusreg.h,v 1.10 2011/03/16 05:49:43 mrg Exp $ */ /* * 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. * */ /* * 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. */ struct sysioreg { struct upareg { uint64_t upa_portid; /* UPA port ID register */ /* 1fe.0000.0000 */ uint64_t upa_config; /* UPA config register */ /* 1fe.0000.0008 */ } sys_upa; uint64_t sys_csr; /* SYSIO control/status register */ /* 1fe.0000.0010 */ uint64_t pad0; uint64_t sys_ecccr; /* ECC control register */ /* 1fe.0000.0020 */ uint64_t reserved; /* 1fe.0000.0028 */ uint64_t sys_ue_afsr; /* Uncorrectable Error AFSR */ /* 1fe.0000.0030 */ uint64_t sys_ue_afar; /* Uncorrectable Error AFAR */ /* 1fe.0000.0038 */ uint64_t sys_ce_afsr; /* Correctable Error AFSR */ /* 1fe.0000.0040 */ uint64_t sys_ce_afar; /* Correctable Error AFAR */ /* 1fe.0000.0048 */ uint64_t pad1[22]; struct perfmon { uint64_t pm_cr; /* Performance monitor control reg */ /* 1fe.0000.0100 */ uint64_t pm_count; /* Performance monitor counter reg */ /* 1fe.0000.0108 */ } sys_pm; uint64_t pad2[990]; struct sbusreg { uint64_t sbus_cr; /* SBUS Control Register */ /* 1fe.0000.2000 */ uint64_t reserved; /* 1fe.0000.2008 */ uint64_t sbus_afsr; /* SBUS AFSR */ /* 1fe.0000.2010 */ uint64_t sbus_afar; /* SBUS AFAR */ /* 1fe.0000.2018 */ uint64_t sbus_config0; /* SBUS Slot 0 config register */ /* 1fe.0000.2020 */ uint64_t sbus_config1; /* SBUS Slot 1 config register */ /* 1fe.0000.2028 */ uint64_t sbus_config2; /* SBUS Slot 2 config register */ /* 1fe.0000.2030 */ uint64_t sbus_config3; /* SBUS Slot 3 config register */ /* 1fe.0000.2038 */ uint64_t sbus_config13; /* Slot 13 config register