xref: /netbsd-src/sys/arch/dreamcast/dev/g2/g2busvar.h (revision cbab9cadce21ae72fac13910001079fff214cc29)
1*cbab9cadSchs /*	$NetBSD: g2busvar.h,v 1.7 2012/10/27 17:17:44 chs Exp $	*/
263885cd0Sthorpej 
363885cd0Sthorpej /*-
463885cd0Sthorpej  * Copyright (c) 2001 Marcus Comstedt
563885cd0Sthorpej  * All rights reserved.
663885cd0Sthorpej  *
763885cd0Sthorpej  * Redistribution and use in source and binary forms, with or without
863885cd0Sthorpej  * modification, are permitted provided that the following conditions
963885cd0Sthorpej  * are met:
1063885cd0Sthorpej  * 1. Redistributions of source code must retain the above copyright
1163885cd0Sthorpej  *    notice, this list of conditions and the following disclaimer.
1263885cd0Sthorpej  * 2. Redistributions in binary form must reproduce the above copyright
1363885cd0Sthorpej  *    notice, this list of conditions and the following disclaimer in the
1463885cd0Sthorpej  *    documentation and/or other materials provided with the distribution.
1563885cd0Sthorpej  * 3. All advertising materials mentioning features or use of this software
1663885cd0Sthorpej  *    must display the following acknowledgement:
1763885cd0Sthorpej  *	This product includes software developed by Marcus Comstedt.
1863885cd0Sthorpej  * 4. Neither the name of The NetBSD Foundation nor the names of its
1963885cd0Sthorpej  *    contributors may be used to endorse or promote products derived
2063885cd0Sthorpej  *    from this software without specific prior written permission.
2163885cd0Sthorpej  *
2263885cd0Sthorpej  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
2363885cd0Sthorpej  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
2463885cd0Sthorpej  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2563885cd0Sthorpej  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
2663885cd0Sthorpej  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2763885cd0Sthorpej  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2863885cd0Sthorpej  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2963885cd0Sthorpej  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
3063885cd0Sthorpej  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
3163885cd0Sthorpej  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3263885cd0Sthorpej  * POSSIBILITY OF SUCH DAMAGE.
3363885cd0Sthorpej  */
3463885cd0Sthorpej 
3563885cd0Sthorpej #ifndef _DREAMCAST_G2BUSVAR_H_
3663885cd0Sthorpej #define _DREAMCAST_G2BUSVAR_H_
3763885cd0Sthorpej 
3886b5be6eSdyoung #include <sys/bus.h>
3963885cd0Sthorpej 
4063885cd0Sthorpej /*
4163885cd0Sthorpej  * G2 driver attach arguments
4263885cd0Sthorpej  */
4363885cd0Sthorpej struct g2bus_attach_args {
4463885cd0Sthorpej 	bus_space_tag_t ga_memt;
4563885cd0Sthorpej };
4663885cd0Sthorpej 
4763885cd0Sthorpej /*
4863885cd0Sthorpej  * Per-device G2 variables
4963885cd0Sthorpej  */
5063885cd0Sthorpej struct g2busdev {
51*cbab9cadSchs 	device_t gd_dev;		/* back pointer to generic */
5263885cd0Sthorpej 	TAILQ_ENTRY(g2busdev)
5363885cd0Sthorpej 		gd_bchain;		/* bus chain */
5463885cd0Sthorpej };
5563885cd0Sthorpej 
5663885cd0Sthorpej /*
5763885cd0Sthorpej  * G2 master bus
5863885cd0Sthorpej  */
5963885cd0Sthorpej struct g2bus_softc {
60b1361f43Stsutsui 	device_t sc_dev;		/* base device */
6163885cd0Sthorpej 	struct dreamcast_bus_space sc_memt;
6263885cd0Sthorpej 	TAILQ_HEAD(, g2busdev)
6363885cd0Sthorpej 		sc_subdevs;		/* list of all children */
6463885cd0Sthorpej };
6563885cd0Sthorpej 
6663885cd0Sthorpej void	g2bus_bus_mem_init(struct g2bus_softc *);
67c6800505Stsutsui void	g2bus_set_bus_mem_sparse(bus_space_tag_t);
6863885cd0Sthorpej 
691bfd32c4Stsutsui #endif /* _DREAMCAST_G2BUSVAR_H_ */
70