Home | History | Annotate | Line # | Download | only in dev
sbusreg.h revision 1.6
      1 /*	$NetBSD: sbusreg.h,v 1.6 1999/05/24 00:25:31 mrg Exp $ */
      2 
      3 /*
      4  * Copyright (c) 1992, 1993
      5  *	The Regents of the University of California.  All rights reserved.
      6  *
      7  * This software was developed by the Computer Systems Engineering group
      8  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
      9  * contributed to Berkeley.
     10  *
     11  * All advertising materials mentioning features or use of this software
     12  * must display the following acknowledgement:
     13  *	This product includes software developed by the University of
     14  *	California, Lawrence Berkeley Laboratory.
     15  *
     16  * Redistribution and use in source and binary forms, with or without
     17  * modification, are permitted provided that the following conditions
     18  * are met:
     19  * 1. Redistributions of source code must retain the above copyright
     20  *    notice, this list of conditions and the following disclaimer.
     21  * 2. Redistributions in binary form must reproduce the above copyright
     22  *    notice, this list of conditions and the following disclaimer in the
     23  *    documentation and/or other materials provided with the distribution.
     24  * 3. All advertising materials mentioning features or use of this software
     25  *    must display the following acknowledgement:
     26  *	This product includes software developed by the University of
     27  *	California, Berkeley and its contributors.
     28  * 4. Neither the name of the University nor the names of its contributors
     29  *    may be used to endorse or promote products derived from this software
     30  *    without specific prior written permission.
     31  *
     32  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     33  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     34  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     35  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     36  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     37  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     38  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     39  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     40  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     41  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     42  * SUCH DAMAGE.
     43  *
     44  *	@(#)sbusreg.h	8.1 (Berkeley) 6/11/93
     45  */
     46 
     47 /*
     48  * Sun-4c S-bus definitions.  (Should be made generic!)
     49  *
     50  * Sbus slot 0 is not a separate slot; it talks to the onboard I/O devices.
     51  * It is, however, addressed just like any `real' Sbus.
     52  *
     53  * Sbus device addresses are obtained from the FORTH PROMs.  They come
     54  * in `absolute' and `relative' address flavors, so we have to handle both.
     55  * Relative addresses do *not* include the slot number.
     56  */
     57 #define	SBUS_BASE		0xf8000000
     58 #define	SBUS_ADDR(slot, off)	(SBUS_BASE + ((slot) << 25) + (off))
     59 #define	SBUS_ABS(a)		((unsigned)(a) >= SBUS_BASE)
     60 #define	SBUS_ABS_TO_SLOT(a)	(((a) - SBUS_BASE) >> 25)
     61 #define	SBUS_ABS_TO_OFFSET(a)	(((a) - SBUS_BASE) & 0x1ffffff)
     62 
     63 /*
     64  * Sun4u S-bus definitions.  Here's where we deal w/the machine
     65  * dependencies of sysio.
     66  *
     67  * SYSIO implements or is the interface to several things:
     68  *
     69  * o The SBUS interface itself
     70  * o The IOMMU
     71  * o The DVMA units
     72  * o The interrupt controller
     73  * o The counter/timers
     74  *
     75  * Since it has registers to control lots of different things
     76  * as well as several on-board SBUS devices and external SBUS
     77  * slots scattered throughout its address space, it's a pain.
     78  *
     79  * One good point, however, is that all registers are 64-bit.
     80  */
     81 
     82 struct sysioreg {
     83 	struct upareg {
     84 		u_int64_t	upa_portid;		/* UPA port ID register */		/* 1fe.0000.0000 */
     85 		u_int64_t	upa_config;		/* UPA config register */		/* 1fe.0000.0008 */
     86 	} sys_upa;
     87 
     88 	u_int64_t	sys_csr;		/* SYSIO control/status register */	/* 1fe.0000.0010 */
     89 	u_int64_t	pad0;
     90 	u_int64_t	sys_ecccr;		/* ECC control register */		/* 1fe.0000.0020 */
     91 	u_int64_t	reserved;							/* 1fe.0000.0028 */
     92 	u_int64_t	sys_ue_afsr;		/* Uncorrectable Error AFSR */		/* 1fe.0000.0030 */
     93 	u_int64_t	sys_ue_afar;		/* Uncorrectable Error AFAR */		/* 1fe.0000.0038 */
     94 	u_int64_t	sys_ce_afsr;		/* Correctable Error AFSR */		/* 1fe.0000.0040 */
     95 	u_int64_t	sys_ce_afar;		/* Correctable Error AFAR */		/* 1fe.0000.0048 */
     96 
     97 	u_int64_t	pad1[22];
     98 
     99 	struct perfmon {
    100 		u_int64_t	pm_cr;			/* Performance monitor control reg */	/* 1fe.0000.0100 */
    101 		u_int64_t	pm_count;		/* Performance monitor counter reg */	/* 1fe.0000.0108 */
    102 	} sys_pm;
    103 
    104 	u_int64_t	pad2[990];
    105 
    106 	struct sbusreg {
    107 		u_int64_t	sbus_cr;		/* SBUS Control Register */		/* 1fe.0000.2000 */
    108 		u_int64_t	reserved;							/* 1fe.0000.2008 */
    109 		u_int64_t	sbus_afsr;		/* SBUS AFSR */				/* 1fe.0000.2010 */
    110 		u_int64_t	sbus_afar;		/* SBUS AFAR */				/* 1fe.0000.2018 */
    111 		u_int64_t	sbus_config0;	/* SBUS Slot 0 config register */	/* 1fe.0000.2020 */
    112 		u_int64_t	sbus_config1;	/* SBUS Slot 1 config register */	/* 1fe.0000.2028 */
    113 		u_int64_t	sbus_config2;	/* SBUS Slot 2 config register */	/* 1fe.0000.2030 */
    114 		u_int64_t	sbus_config3;	/* SBUS Slot 3 config register */	/* 1fe.0000.2038 */
    115 		u_int64_t	sbus_config13;	/* Slot 13 config register <audio> */	/* 1fe.0000.2040 */
    116 		u_int64_t	sbus_config14;	/* Slot 14 config register <macio> */	/* 1fe.0000.2048 */
    117 		u_int64_t	sbus_config15;	/* Slot 15 config register <slavio> */	/* 1fe.0000.2050 */
    118 	} sys_sbus;
    119 
    120 	u_int64_t	pad3[117];
    121 
    122 	struct iommureg sys_iommu;							/* 1fe.0000.2400,2410 */
    123 
    124 	u_int64_t	pad4[125];
    125 
    126 	struct iommu_strbuf	sys_strbuf;						/* 1fe.0000.2800-2810 */
    127 
    128 	u_int64_t	pad5[125];
    129 
    130 	u_int64_t	sbus_slot0_int;		/* SBUS slot 0 interrupt map reg */	/* 1fe.0000.2c00 */
    131 	u_int64_t	sbus_slot1_int;		/* SBUS slot 1 interrupt map reg */	/* 1fe.0000.2c08 */
    132 	u_int64_t	sbus_slot2_int;		/* SBUS slot 2 interrupt map reg */	/* 1fe.0000.2c10 */
    133 	u_int64_t	sbus_slot3_int;		/* SBUS slot 3 interrupt map reg */	/* 1fe.0000.2c18 */
    134 	u_int64_t	intr_retry;		/* interrupt retry timer reg */		/* 1fe.0000.2c20 */
    135 
    136 	u_int64_t	pad6[123];
    137 
    138 	u_int64_t	scsi_int_map;		/* SCSI interrupt map reg */		/* 1fe.0000.3000 */
    139 	u_int64_t	ether_int_map;		/* ethernet interrupt map reg */	/* 1fe.0000.3008 */
    140 	u_int64_t	bpp_int_map;		/* parallel interrupt map reg */	/* 1fe.0000.3010 */
    141 	u_int64_t	audio_int_map;		/* audio interrupt map reg */		/* 1fe.0000.3018 */
    142 	u_int64_t	power_int_map;		/* power fail interrupt map reg */	/* 1fe.0000.3020 */
    143 	u_int64_t	ser_kbd_ms_int_map;	/* serial/kbd/mouse interrupt map reg *//* 1fe.0000.3028 */
    144 	u_int64_t	fd_int_map;		/* floppy interrupt map reg */		/* 1fe.0000.3030 */
    145 	u_int64_t	therm_int_map;		/* thermal warn interrupt map reg */	/* 1fe.0000.3038 */
    146 	u_int64_t	kbd_int_map;		/* kbd [unused] interrupt map reg */	/* 1fe.0000.3040 */
    147 	u_int64_t	mouse_int_map;		/* mouse [unused] interrupt map reg */	/* 1fe.0000.3048 */
    148 	u_int64_t	serial_int_map;		/* second serial interrupt map reg */	/* 1fe.0000.3050 */
    149 	u_int64_t	pad7;
    150 	u_int64_t	timer0_int_map;		/* timer 0 interrupt map reg */		/* 1fe.0000.3060 */
    151 	u_int64_t	timer1_int_map;		/* timer 1 interrupt map reg */		/* 1fe.0000.3068 */
    152 	u_int64_t	ue_int_map;		/* UE interrupt map reg */		/* 1fe.0000.3070 */
    153 	u_int64_t	ce_int_map;		/* CE interrupt map reg */		/* 1fe.0000.3078 */
    154 	u_int64_t	sbus_async_int_map;	/* SBUS error interrupt map reg */	/* 1fe.0000.3080 */
    155 	u_int64_t	pwrmgt_int_map;		/* power mgmt wake interrupt map reg */	/* 1fe.0000.3088 */
    156 	u_int64_t	upagr_int_map;		/* UPA graphics interrupt map reg */	/* 1fe.0000.3090 */
    157 	u_int64_t	reserved_int_map;	/* reserved interrupt map reg */	/* 1fe.0000.3098 */
    158 
    159 	u_int64_t	pad8[108];
    160 
    161 	/* Note: clear interrupt 0 registers are not really used */
    162 	u_int64_t	sbus0_clr_int[8];	/* SBUS slot 0 clear int regs 0..7 */	/* 1fe.0000.3400-3438 */
    163 	u_int64_t	sbus1_clr_int[8];	/* SBUS slot 1 clear int regs 0..7 */	/* 1fe.0000.3440-3478 */
    164 	u_int64_t	sbus2_clr_int[8];	/* SBUS slot 2 clear int regs 0..7 */	/* 1fe.0000.3480-34b8 */
    165 	u_int64_t	sbus3_clr_int[8];	/* SBUS slot 3 clear int regs 0..7 */	/* 1fe.0000.34c0-34f8 */
    166 
    167 	u_int64_t	pad9[96];
    168 
    169 	u_int64_t	scsi_clr_int;		/* SCSI clear int reg */		/* 1fe.0000.3800 */
    170 	u_int64_t	ether_clr_int;		/* ethernet clear int reg */		/* 1fe.0000.3808 */
    171 	u_int64_t	bpp_clr_int;		/* parallel clear int reg */		/* 1fe.0000.3810 */
    172 	u_int64_t	audio_clr_int;		/* audio clear int reg */		/* 1fe.0000.3818 */
    173 	u_int64_t	power_clr_int;		/* power fail clear int reg */		/* 1fe.0000.3820 */
    174 	u_int64_t	ser_kb_ms_clr_int;	/* serial/kbd/mouse clear int reg */	/* 1fe.0000.3828 */
    175 	u_int64_t	fd_clr_int;		/* floppy clear int reg */		/* 1fe.0000.3830 */
    176 	u_int64_t	therm_clr_int;		/* thermal warn clear int reg */	/* 1fe.0000.3838 */
    177 	u_int64_t	kbd_clr_int;		/* kbd [unused] clear int reg */	/* 1fe.0000.3840 */
    178 	u_int64_t	mouse_clr_int;		/* mouse [unused] clear int reg */	/* 1fe.0000.3848 */
    179 	u_int64_t	serial_clr_int;		/* second serial clear int reg */	/* 1fe.0000.3850 */
    180 	u_int64_t	pad10;
    181 	u_int64_t	timer0_clr_int;		/* timer 0 clear int reg */		/* 1fe.0000.3860 */
    182 	u_int64_t	timer1_clr_int;		/* timer 1 clear int reg */		/* 1fe.0000.3868 */
    183 	u_int64_t	ue_clr_int;		/* UE clear int reg */			/* 1fe.0000.3870 */
    184 	u_int64_t	ce_clr_int;		/* CE clear int reg */			/* 1fe.0000.3878 */
    185 	u_int64_t	sbus_clr_async_int;	/* SBUS error clr interrupt reg */	/* 1fe.0000.3880 */
    186 	u_int64_t	pwrmgt_clr_int;		/* power mgmt wake clr interrupt reg */	/* 1fe.0000.3888 */
    187 
    188 	u_int64_t	pad11[110];
    189 
    190 	struct timer_counter {
    191 		u_int64_t	tc_count;	/* timer/counter 0/1 count register */	/* ife.0000.3c00,3c10 */
    192 		u_int64_t	tc_limit;	/* timer/counter 0/1 limit register */	/* ife.0000.3c08,3c18 */
    193 	} tc[2];
    194 
    195 	u_int64_t	pad12[252];
    196 
    197 	u_int64_t	sys_svadiag;		/* SBUS virtual addr diag reg */	/* 1fe.0000.4400 */
    198 
    199 	u_int64_t	pad13[31];
    200 
    201 	u_int64_t	iommu_queue_diag[16];	/* IOMMU LRU queue diag */		/* 1fe.0000.4500-457f */
    202 	u_int64_t	tlb_tag_diag[16];	/* TLB tag diag */			/* 1fe.0000.4580-45ff */
    203 	u_int64_t	tlb_data_diag[32];	/* TLB data RAM diag */			/* 1fe.0000.4600-46ff */
    204 
    205 	u_int64_t	pad14[32];
    206 
    207 	u_int64_t	sbus_int_diag;		/* SBUS int state diag reg */		/* 1fe.0000.4800 */
    208 	u_int64_t	obio_int_diag;		/* OBIO and misc int state diag reg */	/* 1fe.0000.4808 */
    209 
    210 	u_int64_t	pad15[254];
    211 
    212 	u_int64_t	strbuf_data_diag[128];	/* streaming buffer data RAM diag */	/* 1fe.0000.5000-53f8 */
    213 	u_int64_t	strbuf_error_diag[128];	/* streaming buffer error status diag *//* 1fe.0000.5400-57f8 */
    214 	u_int64_t	strbuf_pg_tag_diag[16];	/* streaming buffer page tag diag */	/* 1fe.0000.5800-5878 */
    215 	u_int64_t	pad16[16];
    216 	u_int64_t	strbuf_ln_tag_diag[16];	/* streaming buffer line tag diag */	/* 1fe.0000.5900-5978 */
    217 };
    218