xref: /original-bsd/sys/sparc/sbus/sbusreg.h (revision ea3a8ee8)
1 /*
2  * Copyright (c) 1992 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * This software was developed by the Computer Systems Engineering group
6  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
7  * contributed to Berkeley.
8  *
9  * All advertising materials mentioning features or use of this software
10  * must display the following acknowledgement:
11  *	This product includes software developed by the University of
12  *	California, Lawrence Berkeley Laboratories.
13  *
14  * %sccs.include.redist.c%
15  *
16  *	@(#)sbusreg.h	7.2 (Berkeley) 07/21/92
17  *
18  * from: $Header: sbusreg.h,v 1.5 92/06/17 06:59:44 torek Exp $ (LBL)
19  */
20 
21 /*
22  * Sun-4c S-bus definitions.  (Should be made generic!)
23  *
24  * Sbus slot 0 is not a separate slot; it talks to the onboard I/O devices.
25  * It is, however, addressed just like any `real' Sbus.
26  *
27  * Sbus device addresses are obtained from the FORTH PROMs.  They come
28  * in `absolute' and `relative' address flavors, so we have to handle both.
29  * Relative addresses do *not* include the slot number.
30  */
31 #define	SBUS_BASE		0xf8000000
32 #define	SBUS_ADDR(slot, off)	(SBUS_BASE + ((slot) << 25) + (off))
33 #define	SBUS_ABS(a)		((unsigned)(a) >= SBUS_BASE)
34 #define	SBUS_ABS_TO_SLOT(a)	(((a) - SBUS_BASE) >> 25)
35 #define	SBUS_ABS_TO_OFFSET(a)	(((a) - SBUS_BASE) & 0x1ffffff)
36