1 /* $NetBSD: at91dbguvar.h,v 1.2 2008/07/03 01:15:38 matt Exp $ */
4 * Copyright (c) 2007 Embedtronics Oy
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
16 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 #ifndef _AT91DBGUVAR_H_
30 #define _AT91DBGUVAR_H_
34 /* Hardware flag masks */
35 #define COM_HW_NOIEN 0x01
36 #define COM_HW_DEV_OK 0x20
37 #define COM_HW_CONSOLE 0x40
38 #define COM_HW_KGDB 0x80
40 #define RX_TTY_BLOCKED 0x01
41 #define RX_TTY_OVERFLOWED 0x02
42 #define RX_IBUF_BLOCKED 0x04
43 #define RX_IBUF_OVERFLOWED 0x08
44 #define RX_ANY_BLOCK 0x0f
46 #define AT91DBGU_RING_SIZE 2048
48 struct at91dbgu_softc
{
51 bus_space_tag_t sc_iot
;
52 bus_space_handle_t sc_ioh
;
58 u_char
*sc_rbuf
, *sc_ebuf
;
63 u_char
*volatile sc_rbget
,
65 volatile u_int sc_rbavail
;
68 int sc_hwflags
, sc_swflags
;
70 volatile u_int sc_rx_flags
,
77 volatile u_int sc_brgr
, sc_ier
, sc_poll
;
79 /* power management hooks */
80 int (*enable
)(struct at91dbgu_softc
*);
81 int (*disable
)(struct at91dbgu_softc
*);
84 #if NRND > 0 && defined(RND_COM)
85 rndsource_element_t rnd_source
;
89 void at91dbgu_attach_subr(struct at91dbgu_softc
*);
90 int at91dbgu_intr(void* arg
);
92 void at91dbgu_attach_cn(bus_space_tag_t
, int, int mode
);
94 #endif /* _AT91DBGUVAR_H_ */