xref: /csrg-svn/sys/sparc/sbus/sbusreg.h (revision 63322)
155140Storek /*
2*63322Sbostic  * Copyright (c) 1992, 1993
3*63322Sbostic  *	The Regents of the University of California.  All rights reserved.
455140Storek  *
555140Storek  * This software was developed by the Computer Systems Engineering group
655140Storek  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
755140Storek  * contributed to Berkeley.
855140Storek  *
955503Sbostic  * All advertising materials mentioning features or use of this software
1055503Sbostic  * must display the following acknowledgement:
1155503Sbostic  *	This product includes software developed by the University of
1259213Storek  *	California, Lawrence Berkeley Laboratory.
1355503Sbostic  *
1455140Storek  * %sccs.include.redist.c%
1555140Storek  *
16*63322Sbostic  *	@(#)sbusreg.h	8.1 (Berkeley) 06/11/93
1755140Storek  *
1859213Storek  * from: $Header: sbusreg.h,v 1.6 92/11/26 02:28:14 torek Exp $ (LBL)
1955140Storek  */
2055140Storek 
2155140Storek /*
2255140Storek  * Sun-4c S-bus definitions.  (Should be made generic!)
2355140Storek  *
2455140Storek  * Sbus slot 0 is not a separate slot; it talks to the onboard I/O devices.
2555140Storek  * It is, however, addressed just like any `real' Sbus.
2655140Storek  *
2755140Storek  * Sbus device addresses are obtained from the FORTH PROMs.  They come
2855140Storek  * in `absolute' and `relative' address flavors, so we have to handle both.
2955140Storek  * Relative addresses do *not* include the slot number.
3055140Storek  */
3155140Storek #define	SBUS_BASE		0xf8000000
3255140Storek #define	SBUS_ADDR(slot, off)	(SBUS_BASE + ((slot) << 25) + (off))
3355140Storek #define	SBUS_ABS(a)		((unsigned)(a) >= SBUS_BASE)
3455140Storek #define	SBUS_ABS_TO_SLOT(a)	(((a) - SBUS_BASE) >> 25)
3555140Storek #define	SBUS_ABS_TO_OFFSET(a)	(((a) - SBUS_BASE) & 0x1ffffff)
36