gumstixvar.h revision 1.3 1 1.3 kiyohara /* $NetBSD: gumstixvar.h,v 1.3 2008/05/11 08:23:17 kiyohara Exp $ */
2 1.1 kiyohara /*
3 1.1 kiyohara * Copyright (C) 2005, 2006 WIDE Project and SOUM Corporation.
4 1.1 kiyohara * All rights reserved.
5 1.1 kiyohara *
6 1.1 kiyohara * Written by Takashi Kiyohara and Susumu Miki for WIDE Project and SOUM
7 1.1 kiyohara * Corporation.
8 1.1 kiyohara *
9 1.1 kiyohara * Redistribution and use in source and binary forms, with or without
10 1.1 kiyohara * modification, are permitted provided that the following conditions
11 1.1 kiyohara * are met:
12 1.1 kiyohara * 1. Redistributions of source code must retain the above copyright
13 1.1 kiyohara * notice, this list of conditions and the following disclaimer.
14 1.1 kiyohara * 2. Redistributions in binary form must reproduce the above copyright
15 1.1 kiyohara * notice, this list of conditions and the following disclaimer in the
16 1.1 kiyohara * documentation and/or other materials provided with the distribution.
17 1.1 kiyohara * 3. Neither the name of the project nor the name of SOUM Corporation
18 1.1 kiyohara * may be used to endorse or promote products derived from this software
19 1.1 kiyohara * without specific prior written permission.
20 1.1 kiyohara *
21 1.1 kiyohara * THIS SOFTWARE IS PROVIDED BY THE PROJECT and SOUM CORPORATION ``AS IS''
22 1.1 kiyohara * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23 1.1 kiyohara * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 1.1 kiyohara * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT AND SOUM CORPORATION
25 1.1 kiyohara * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 1.1 kiyohara * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 1.1 kiyohara * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 1.1 kiyohara * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 1.1 kiyohara * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 1.1 kiyohara * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 1.1 kiyohara * POSSIBILITY OF SUCH DAMAGE.
32 1.1 kiyohara */
33 1.1 kiyohara #ifndef _EVBARM_GUMSTIXVAR_H_
34 1.1 kiyohara #define _EVBARM_GUMSTIXVAR_H_
35 1.1 kiyohara
36 1.1 kiyohara #include <sys/conf.h>
37 1.1 kiyohara #include <sys/device.h>
38 1.1 kiyohara
39 1.1 kiyohara #include <machine/bus.h>
40 1.1 kiyohara #include <arm/xscale/pxa2x0_gpio.h>
41 1.1 kiyohara #include <evbarm/gumstix/gumstixreg.h>
42 1.1 kiyohara
43 1.1 kiyohara
44 1.1 kiyohara extern uint32_t system_serial_high;
45 1.1 kiyohara extern uint32_t system_serial_low;
46 1.1 kiyohara
47 1.1 kiyohara
48 1.1 kiyohara struct gxio_softc {
49 1.3 kiyohara device_t sc_dev;
50 1.1 kiyohara bus_space_tag_t sc_iot;
51 1.1 kiyohara bus_space_handle_t sc_ioh;
52 1.1 kiyohara };
53 1.1 kiyohara
54 1.1 kiyohara typedef void *gxio_chipset_tag_t;
55 1.1 kiyohara
56 1.1 kiyohara struct gxio_attach_args {
57 1.1 kiyohara gxio_chipset_tag_t gxa_sc;
58 1.1 kiyohara bus_space_tag_t gxa_iot; /* bus tag */
59 1.1 kiyohara bus_addr_t gxa_addr; /* I/O address */
60 1.1 kiyohara int gxa_gpirq; /* IRQ on GPIO */
61 1.1 kiyohara };
62 1.1 kiyohara
63 1.1 kiyohara /*
64 1.1 kiyohara * IRQ handler
65 1.1 kiyohara */
66 1.1 kiyohara #define gxio_intr_establish(sc, gpirq, level, spl, func, arg) \
67 1.1 kiyohara pxa2x0_gpio_intr_establish((gpirq), (level), (spl), (func), (arg))
68 1.1 kiyohara #define gxio_intr_disestablish(sc, cookie) \
69 1.1 kiyohara pxa2x0_gpio_intr_disestablish((cookie))
70 1.1 kiyohara
71 1.1 kiyohara #endif /* _EVBARM_GUMSTIXVAR_H_ */
72