xref: /csrg-svn/sys/sparc/sbus/sbusreg.h (revision 55503)
155140Storek /*
255140Storek  * Copyright (c) 1992 The Regents of the University of California.
355140Storek  * 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  *
9*55503Sbostic  * All advertising materials mentioning features or use of this software
10*55503Sbostic  * must display the following acknowledgement:
11*55503Sbostic  *	This product includes software developed by the University of
12*55503Sbostic  *	California, Lawrence Berkeley Laboratories.
13*55503Sbostic  *
1455140Storek  * %sccs.include.redist.c%
1555140Storek  *
16*55503Sbostic  *	@(#)sbusreg.h	7.2 (Berkeley) 07/21/92
1755140Storek  *
1855140Storek  * from: $Header: sbusreg.h,v 1.5 92/06/17 06:59:44 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