hd64465var.h revision 1.1 1 /* $NetBSD: hd64465var.h,v 1.1 2002/02/11 17:27:16 uch Exp $ */
2
3 /*-
4 * Copyright (c) 2002 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by UCHIYAMA Yasushi.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the NetBSD
21 * Foundation, Inc. and its contributors.
22 * 4. Neither the name of The NetBSD Foundation nor the names of its
23 * contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38
39 /*
40 * HD64465 register access macro.
41 */
42 #define hd64465_reg_read_1(r) (*((volatile u_int8_t *)(r)))
43 #define hd64465_reg_write_1(r, v) (*((volatile u_int8_t *)(r)) = (v))
44 #define hd64465_reg_read_2(r) (*((volatile u_int16_t *)(r)))
45 #define hd64465_reg_write_2(r, v) (*((volatile u_int16_t *)(r)) = (v))
46
47 /*
48 * HD64465 modules canonical ID.
49 */
50 enum hd64465_module_id {
51 HD64465_MODULE_INTERFACE = 0,
52 HD64465_MODULE_INTC,
53 HD64465_MODULE_PS2IF,
54 HD64465_MODULE_PCMCIA,
55 HD64465_MODULE_AFE,
56 HD64465_MODULE_GPIO,
57 HD64465_MODULE_TIMER,
58 HD64465_MODULE_KBC,
59 HD64465_MODULE_IRDA,
60 HD64465_MODULE_UART,
61 HD64465_MODULE_PARALEL,
62 HD64465_MODULE_CODEC,
63 HD64465_MODULE_OHCI,
64 HD64465_MODULE_ADC
65 };
66
67 struct hd64465_attach_args {
68 enum hd64465_module_id ha_module_id;
69 };
70
71 enum hd64465_irq {
72 HD64465_IRQ_PS2KB = 0,
73 HD64465_IRQ_PCC0,
74 HD64465_IRQ_PCC1,
75 HD64465_IRQ_AFE,
76 HD64465_IRQ_GPIO,
77 HD64465_IRQ_TMU0,
78 HD64465_IRQ_TMU1,
79 HD64465_IRQ_KBC,
80 HD64465_IRQ_PS2MS,
81 HD64465_IRQ_IRDA,
82 HD64465_IRQ_UART,
83 HD64465_IRQ_PPR,
84 HD64465_IRQ_SCDI,
85 HD64465_IRQ_OHCI,
86 HD64465_IRQ_ADC,
87 };
88
89 void hd64465_intr_disable(void);
90 void hd64465_intr_mask(void);
91 void hd64465_intr_unmask(void);
92 void hd64465_intr_reboot(void);
93 void *hd64465_intr_establish(enum hd64465_irq, int, int, int (*)(void *),
94 void *);
95 void hd64465_intr_disestablish(void *);
96