Home | History | Annotate | Line # | Download | only in at91
at91cfvar.h revision 1.1.22.1
      1  1.1.22.1  simonb /*	$Id: at91cfvar.h,v 1.1.22.1 2008/07/03 18:37:51 simonb Exp $	*/
      2  1.1.22.1  simonb /*	$NetBSD: at91cfvar.h,v 1.1.22.1 2008/07/03 18:37:51 simonb Exp $	*/
      3  1.1.22.1  simonb 
      4  1.1.22.1  simonb /*
      5  1.1.22.1  simonb  * Copyright (c) 2007 Embedtronics Oy. All rights reserved.
      6  1.1.22.1  simonb  *
      7  1.1.22.1  simonb  * Based on arch/arm/ep93xx/eppcicvar.h,
      8  1.1.22.1  simonb  * Copyright (c) 2005 HAMAJIMA Katsuomi. All rights reserved.
      9  1.1.22.1  simonb  *
     10  1.1.22.1  simonb  * Redistribution and use in source and binary forms, with or without
     11  1.1.22.1  simonb  * modification, are permitted provided that the following conditions
     12  1.1.22.1  simonb  * are met:
     13  1.1.22.1  simonb  * 1. Redistributions of source code must retain the above copyright
     14  1.1.22.1  simonb  *    notice, this list of conditions and the following disclaimer.
     15  1.1.22.1  simonb  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.1.22.1  simonb  *    notice, this list of conditions and the following disclaimer in the
     17  1.1.22.1  simonb  *    documentation and/or other materials provided with the distribution.
     18  1.1.22.1  simonb  *
     19  1.1.22.1  simonb  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
     20  1.1.22.1  simonb  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     21  1.1.22.1  simonb  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     22  1.1.22.1  simonb  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
     23  1.1.22.1  simonb  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     24  1.1.22.1  simonb  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     25  1.1.22.1  simonb  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     26  1.1.22.1  simonb  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     27  1.1.22.1  simonb  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     28  1.1.22.1  simonb  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     29  1.1.22.1  simonb  * SUCH DAMAGE.
     30  1.1.22.1  simonb  */
     31  1.1.22.1  simonb 
     32  1.1.22.1  simonb #ifndef	_AT91CFVAR_H_
     33  1.1.22.1  simonb #define	_AT91CFVAR_H_
     34  1.1.22.1  simonb 
     35  1.1.22.1  simonb struct at91cf_chipset_tag {
     36  1.1.22.1  simonb 	int	(*power_ctl)(void *self, int onoff);
     37  1.1.22.1  simonb #define	POWER_OFF	0
     38  1.1.22.1  simonb #define	POWER_ON	1
     39  1.1.22.1  simonb 	int	(*card_detect)(void *self);
     40  1.1.22.1  simonb 	int	(*irq_line)(void *self);
     41  1.1.22.1  simonb 	void *	(*intr_establish)(void *self, int which, int ipl, int (*ih_func)(void *), void *arg);
     42  1.1.22.1  simonb 	void	(*intr_disestablish)(void *self, int wich, void *cookie);
     43  1.1.22.1  simonb #define	CD_IRQ	0	// card detect change interrupt
     44  1.1.22.1  simonb #define	CF_IRQ	1	// compact flash card interrupt
     45  1.1.22.1  simonb };
     46  1.1.22.1  simonb 
     47  1.1.22.1  simonb typedef struct at91cf_chipset_tag *at91cf_chipset_tag_t;
     48  1.1.22.1  simonb 
     49  1.1.22.1  simonb struct at91cf_handle;
     50  1.1.22.1  simonb 
     51  1.1.22.1  simonb struct at91cf_softc {
     52  1.1.22.1  simonb 	device_t		sc_dev;
     53  1.1.22.1  simonb 	bus_space_tag_t		sc_iot;
     54  1.1.22.1  simonb 	bus_space_handle_t	sc_memory_ioh, sc_common_ioh, sc_io_ioh;
     55  1.1.22.1  simonb 	struct at91cf_handle	*sc_ph;
     56  1.1.22.1  simonb 	at91cf_chipset_tag_t	sc_cscf;
     57  1.1.22.1  simonb 	int			sc_enable;
     58  1.1.22.1  simonb };
     59  1.1.22.1  simonb 
     60  1.1.22.1  simonb void at91cf_attach_common(device_t, device_t, void *,
     61  1.1.22.1  simonb 			   at91cf_chipset_tag_t);
     62  1.1.22.1  simonb 
     63  1.1.22.1  simonb #endif	/* _AT91CFVAR_H_ */
     64