bus.h revision 1.10
11.10Sscw/*	$NetBSD: bus.h,v 1.10 2003/07/28 07:58:51 scw Exp $	*/
21.1Snonaka/*	$OpenBSD: bus.h,v 1.1 1997/10/13 10:53:42 pefo Exp $	*/
31.1Snonaka
41.1Snonaka/*-
51.5Sthorpej * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
61.1Snonaka * All rights reserved.
71.1Snonaka *
81.1Snonaka * This code is derived from software contributed to The NetBSD Foundation
91.1Snonaka * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
101.1Snonaka * NASA Ames Research Center.
111.1Snonaka *
121.1Snonaka * Redistribution and use in source and binary forms, with or without
131.1Snonaka * modification, are permitted provided that the following conditions
141.1Snonaka * are met:
151.1Snonaka * 1. Redistributions of source code must retain the above copyright
161.1Snonaka *    notice, this list of conditions and the following disclaimer.
171.1Snonaka * 2. Redistributions in binary form must reproduce the above copyright
181.1Snonaka *    notice, this list of conditions and the following disclaimer in the
191.1Snonaka *    documentation and/or other materials provided with the distribution.
201.1Snonaka * 3. All advertising materials mentioning features or use of this software
211.1Snonaka *    must display the following acknowledgement:
221.1Snonaka *	This product includes software developed by the NetBSD
231.1Snonaka *	Foundation, Inc. and its contributors.
241.1Snonaka * 4. Neither the name of The NetBSD Foundation nor the names of its
251.1Snonaka *    contributors may be used to endorse or promote products derived
261.1Snonaka *    from this software without specific prior written permission.
271.1Snonaka *
281.1Snonaka * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
291.1Snonaka * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
301.1Snonaka * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
311.1Snonaka * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
321.1Snonaka * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
331.1Snonaka * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
341.1Snonaka * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
351.1Snonaka * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
361.1Snonaka * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
371.1Snonaka * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
381.1Snonaka * POSSIBILITY OF SUCH DAMAGE.
391.1Snonaka */
401.1Snonaka
411.1Snonaka/*
421.1Snonaka * Copyright (c) 1996 Charles M. Hannum.  All rights reserved.
431.1Snonaka * Copyright (c) 1996 Jason R. Thorpe.  All rights reserved.
441.1Snonaka * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
451.1Snonaka *
461.1Snonaka * Redistribution and use in source and binary forms, with or without
471.1Snonaka * modification, are permitted provided that the following conditions
481.1Snonaka * are met:
491.1Snonaka * 1. Redistributions of source code must retain the above copyright
501.1Snonaka *    notice, this list of conditions and the following disclaimer.
511.1Snonaka * 2. Redistributions in binary form must reproduce the above copyright
521.1Snonaka *    notice, this list of conditions and the following disclaimer in the
531.1Snonaka *    documentation and/or other materials provided with the distribution.
541.1Snonaka * 3. All advertising materials mentioning features or use of this software
551.1Snonaka *    must display the following acknowledgement:
561.1Snonaka *      This product includes software developed by Christopher G. Demetriou
571.1Snonaka *	for the NetBSD Project.
581.1Snonaka * 4. The name of the author may not be used to endorse or promote products
591.1Snonaka *    derived from this software without specific prior written permission
601.1Snonaka *
611.1Snonaka * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
621.1Snonaka * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
631.1Snonaka * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
641.1Snonaka * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
651.1Snonaka * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
661.1Snonaka * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
671.1Snonaka * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
681.1Snonaka * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
691.1Snonaka * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
701.1Snonaka * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
711.1Snonaka */
721.1Snonaka
731.1Snonaka/*
741.1Snonaka * Copyright (c) 1997 Per Fogelstrom.  All rights reserved.
751.1Snonaka * Copyright (c) 1996 Niklas Hallqvist.  All rights reserved.
761.1Snonaka *
771.1Snonaka * Redistribution and use in source and binary forms, with or without
781.1Snonaka * modification, are permitted provided that the following conditions
791.1Snonaka * are met:
801.1Snonaka * 1. Redistributions of source code must retain the above copyright
811.1Snonaka *    notice, this list of conditions and the following disclaimer.
821.1Snonaka * 2. Redistributions in binary form must reproduce the above copyright
831.1Snonaka *    notice, this list of conditions and the following disclaimer in the
841.1Snonaka *    documentation and/or other materials provided with the distribution.
851.1Snonaka * 3. All advertising materials mentioning features or use of this software
861.1Snonaka *    must display the following acknowledgement:
871.1Snonaka *      This product includes software developed by Christopher G. Demetriou
881.1Snonaka *	for the NetBSD Project.
891.1Snonaka * 4. The name of the author may not be used to endorse or promote products
901.1Snonaka *    derived from this software without specific prior written permission
911.1Snonaka *
921.1Snonaka * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
931.1Snonaka * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
941.1Snonaka * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
951.1Snonaka * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
961.1Snonaka * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
971.1Snonaka * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
981.1Snonaka * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
991.1Snonaka * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1001.1Snonaka * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1011.1Snonaka * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1021.1Snonaka */
1031.1Snonaka
1041.1Snonaka#ifndef _PREP_BUS_H_
1051.1Snonaka#define _PREP_BUS_H_
1061.1Snonaka
1071.1Snonaka/*
1081.1Snonaka * Values for the Be bus space tag, not to be used directly by MI code.
1091.1Snonaka */
1101.1Snonaka#define	PREP_BUS_SPACE_IO	0x80000000	/* i/o space */
1111.1Snonaka#define PREP_BUS_SPACE_MEM	0xC0000000	/* mem space */
1121.1Snonaka
1131.1Snonaka/*
1141.1Snonaka * Address conversion as seen from a PCI master.
1151.1Snonaka */
1161.1Snonaka#define MPC105_DIRECT_MAPPED_SPACE	0x80000000
1171.8Smatt#define PHYS_TO_BUS_MEM(t, x)	((x) | MPC105_DIRECT_MAPPED_SPACE)
1181.8Smatt#define BUS_MEM_TO_PHYS(t, x)	((x) & ~MPC105_DIRECT_MAPPED_SPACE)
1191.1Snonaka
1201.7Smatt#ifdef _KERNEL
1211.8Smattextern struct powerpc_bus_space prep_io_space_tag;
1221.8Smattextern struct powerpc_bus_space prep_isa_io_space_tag;
1231.8Smattextern struct powerpc_bus_space prep_mem_space_tag;
1241.8Smattextern struct powerpc_bus_space prep_isa_mem_space_tag;
1251.7Smatt#endif
1261.10Sscw
1271.10Sscw#include <powerpc/bus.h>
1281.1Snonaka
1291.1Snonaka#endif /* _PREP_BUS_H_ */
130