xref: /netbsd-src/sys/dev/marvell/gtvar.h (revision a748aedcb5b3b2e2c40b4d23f725330e2ae9ef88)
1*a748aedcSkiyohara /*	$NetBSD: gtvar.h,v 1.15 2010/04/28 13:51:56 kiyohara Exp $	*/
2ff2281b4Smatt /*
3*a748aedcSkiyohara  * Copyright (c) 2009 KIYOHARA Takashi
4ff2281b4Smatt  * All rights reserved.
5ff2281b4Smatt  *
6ff2281b4Smatt  * Redistribution and use in source and binary forms, with or without
7ff2281b4Smatt  * modification, are permitted provided that the following conditions
8ff2281b4Smatt  * are met:
9ff2281b4Smatt  * 1. Redistributions of source code must retain the above copyright
10ff2281b4Smatt  *    notice, this list of conditions and the following disclaimer.
11ff2281b4Smatt  * 2. Redistributions in binary form must reproduce the above copyright
12ff2281b4Smatt  *    notice, this list of conditions and the following disclaimer in the
13ff2281b4Smatt  *    documentation and/or other materials provided with the distribution.
14ff2281b4Smatt  *
15*a748aedcSkiyohara  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16*a748aedcSkiyohara  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17*a748aedcSkiyohara  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18*a748aedcSkiyohara  * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
19*a748aedcSkiyohara  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20*a748aedcSkiyohara  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21*a748aedcSkiyohara  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22*a748aedcSkiyohara  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
23*a748aedcSkiyohara  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
24*a748aedcSkiyohara  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25ff2281b4Smatt  * POSSIBILITY OF SUCH DAMAGE.
26ff2281b4Smatt  */
27ff2281b4Smatt 
28*a748aedcSkiyohara #ifndef _DEV_DISCOVERY_GTVAR_H_
29*a748aedcSkiyohara #define	_DEV_DISCOVERY_GTVAR_H_
30ff2281b4Smatt 
31ff2281b4Smatt struct gt_softc {
32*a748aedcSkiyohara 	device_t sc_dev;
33*a748aedcSkiyohara 	int sc_model;
34*a748aedcSkiyohara 	int sc_rev;
35*a748aedcSkiyohara 	bus_addr_t sc_addr;
36*a748aedcSkiyohara 	bus_space_tag_t sc_iot;
37*a748aedcSkiyohara 	bus_space_handle_t sc_ioh;
38*a748aedcSkiyohara 	bus_dma_tag_t sc_dmat;
39ff2281b4Smatt };
40ff2281b4Smatt 
4108ea2a49Smatt struct obio_attach_args {
4208ea2a49Smatt 	const char *oa_name;		/* call name of device */
4308ea2a49Smatt 	bus_space_tag_t oa_memt;	/* bus space tag */
4408ea2a49Smatt 	bus_addr_t oa_offset;		/* offset (absolute) to device */
4508ea2a49Smatt 	bus_size_t oa_size;		/* size (strided) of device */
4608ea2a49Smatt 	int oa_irq;			/* irq */
4708ea2a49Smatt };
4808ea2a49Smatt 
4925287474Sjmc 
50ff2281b4Smatt void	gt_attach_common(struct gt_softc *);
51ff2281b4Smatt 
52*a748aedcSkiyohara #ifdef GT_WATCHDOG
53*a748aedcSkiyohara void	gt_watchdog_service(void);
54*a748aedcSkiyohara void	gt_watchdog_reset(void);
55*a748aedcSkiyohara #else
56*a748aedcSkiyohara #define gt_watchdog_service()	((void)0)
57*a748aedcSkiyohara #define gt_watchdog_reset()	((void)0)
58*a748aedcSkiyohara #endif
59*a748aedcSkiyohara 
6099747a80Scegger int	gt_mii_read(device_t, device_t, int, int);
6199747a80Scegger void	gt_mii_write(device_t, device_t, int, int, int);
62ff2281b4Smatt 
63ff2281b4Smatt 
64*a748aedcSkiyohara uint32_t gt_read_mpp(void);
65ff2281b4Smatt 
66*a748aedcSkiyohara #endif /* _DEV_DISCOVERY_GTVAR_H_ */
67