1 /* $NetBSD: lubbock_var.h,v 1.1 2003/06/18 10:51:15 bsh Exp $ */
4 * Copyright (c) 2002, 2003 Genetec Corporation. All rights reserved.
5 * Written by Hiroyuki Bessho for Genetec Corporation.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. The name of Genetec Corporation may not be used to endorse or
16 * promote products derived from this software without specific prior
19 * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GENETEC CORPORATION
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
32 #ifndef _EVBARM_LUBBOCK_VAR_H
33 #define _EVBARM_LUBBOCK_VAR_H
36 #include <sys/device.h>
38 #include <machine/bus.h>
39 #include <evbarm/lubbock/lubbock_reg.h>
43 * Lubbock on-board IO bus
49 bus_space_tag_t sc_iot
;
50 bus_space_handle_t sc_obioreg_ioh
;
51 void *sc_ih
; /* interrupt handler for obio on pxaip */
52 void *sc_si
; /* software interrupt handler */
54 int sc_obio_intr_mask
;
55 int sc_obio_intr_pending
;
56 int sc_ipl
; /* Max ipl among sub interrupts */
61 } sc_handler
[N_OBIO_IRQ
];
64 typedef void *obio_chipset_tag_t
;
66 struct obio_attach_args
{
67 obio_chipset_tag_t oba_sc
;
68 bus_space_tag_t oba_iot
; /* Bus tag */
69 bus_addr_t oba_addr
; /* i/o address */
73 /* on-board hex LED */
74 void hex_led_blank( uint32_t value
, int blank
);
75 #define hex_led(value) ioreg_write( LUBBOCK_OBIO_VBASE+LUBBOCK_HEXLED, (value) )
76 #define hex_led_p(value) ioreg_write( LUBBOCK_OBIO_PBASE+LUBBOCK_HEXLED, (value) )
78 #define d_led(value) ioreg16_write( LUBBOCK_OBIO_VBASE+LUBBOCK_LEDCTL, (value) )
83 void *obio_intr_establish(struct obio_softc
*, int, int, int (*)(void *), void *);
84 void obio_intr_disestablish(void *);
86 #define obio_read(offset) ioreg_read(LUBBOCK_OBIO_VBASE+(offset))
87 #define obio_write(offset,value) \
88 ioreg_write(LUBBOCK_OBIO_VBASE+(offset), (value))
91 #define obio16_read(offset) ioreg16_read(LUBBOCK_OBIO_VBASE+(offset))
92 #define obio16_write(offset,value) \
93 ioreg16_write(LUBBOCK_OBIO_VBASE+(offset), (value))
95 #define obio8_read(offset) ioreg8_read(LUBBOCK_OBIO_VBASE+(offset))
96 #define obio8_write(offset,value) \
97 ioreg8_write(LUBBOCK_OBIO_VBASE+(offset), (value))
100 #endif /* _EVBARM_LUBBOCK_VAR_H */