pxa2x0var.h revision 1.1 1 1.1 bsh /* $NetBSD: pxa2x0var.h,v 1.1 2002/10/19 19:31:41 bsh Exp $ */
2 1.1 bsh
3 1.1 bsh /*
4 1.1 bsh * Copyright (c) 2002 Genetec Corporation. All rights reserved.
5 1.1 bsh * Written by Hiroyuki Bessho for Genetec Corporation.
6 1.1 bsh *
7 1.1 bsh * Redistribution and use in source and binary forms, with or without
8 1.1 bsh * modification, are permitted provided that the following conditions
9 1.1 bsh * are met:
10 1.1 bsh * 1. Redistributions of source code must retain the above copyright
11 1.1 bsh * notice, this list of conditions and the following disclaimer.
12 1.1 bsh * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 bsh * notice, this list of conditions and the following disclaimer in the
14 1.1 bsh * documentation and/or other materials provided with the distribution.
15 1.1 bsh * 3. All advertising materials mentioning features or use of this software
16 1.1 bsh * must display the following acknowledgement:
17 1.1 bsh * This product includes software developed for the NetBSD Project by
18 1.1 bsh * Genetec Corporation.
19 1.1 bsh * 4. The name of Genetec Corporation may not be used to endorse or
20 1.1 bsh * promote products derived from this software without specific prior
21 1.1 bsh * written permission.
22 1.1 bsh *
23 1.1 bsh * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND
24 1.1 bsh * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
25 1.1 bsh * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
26 1.1 bsh * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GENETEC CORPORATION
27 1.1 bsh * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 1.1 bsh * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 1.1 bsh * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 1.1 bsh * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 1.1 bsh * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 1.1 bsh * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 1.1 bsh * POSSIBILITY OF SUCH DAMAGE.
34 1.1 bsh */
35 1.1 bsh
36 1.1 bsh
37 1.1 bsh #ifndef _ARM_XSCALE_PXA2X0VAR_H_
38 1.1 bsh #define _ARM_XSCALE_PXA2X0VAR_H_
39 1.1 bsh
40 1.1 bsh #include <arm/sa11x0/sa11x0_var.h>
41 1.1 bsh
42 1.1 bsh /* PXA2X0's integrated peripheral bus.
43 1.1 bsh *
44 1.1 bsh * pxaip_softc `inherits' sa11x0_softc. This is a hack to make OS
45 1.1 bsh * timer driver for SA11x0 (arm/sa11x0/sa11x0_ost.c) work on PXA2X0.
46 1.1 bsh * PXA2X0 has a same OS timer unit as SA11X0 has.
47 1.1 bsh */
48 1.1 bsh
49 1.1 bsh typedef int (* pxa2x0_irq_handler_t)(void *);
50 1.1 bsh
51 1.1 bsh struct pxa2x0_softc {
52 1.1 bsh struct sa11x0_softc saip;
53 1.1 bsh
54 1.1 bsh bus_space_handle_t sc_memctl_ioh; /* Memory controller */
55 1.1 bsh bus_space_handle_t sc_clkman_ioh; /* Clock manager */
56 1.1 bsh bus_space_handle_t sc_rtc_ioh; /* real time clock */
57 1.1 bsh };
58 1.1 bsh
59 1.1 bsh extern struct pxa2x0_softc *pxa2x0_softc;
60 1.1 bsh
61 1.1 bsh struct pxa2x0_attach_args {
62 1.1 bsh struct sa11x0_attach_args pxa_sa;
63 1.1 bsh
64 1.1 bsh int pxa_index; /* to specify device by index number */
65 1.1 bsh
66 1.1 bsh #define pxa_sc pxa_sa.sa_sc
67 1.1 bsh #define pxa_iot pxa_sa.sa_iot
68 1.1 bsh #define pxa_addr pxa_sa.sa_addr
69 1.1 bsh #define pxa_size pxa_sa.sa_size
70 1.1 bsh #define pxa_intr pxa_sa.sa_intr
71 1.1 bsh #define pxa_gpio pxa_sa.sa_gpio
72 1.1 bsh };
73 1.1 bsh
74 1.1 bsh
75 1.1 bsh extern struct bus_space pxa2x0_bs_tag;
76 1.1 bsh extern struct arm32_bus_dma_tag pxa2x0_bus_dma_tag;
77 1.1 bsh extern struct bus_space pxa2x0_a4x_bs_tag;
78 1.1 bsh
79 1.1 bsh void pxa2x0_set_intcbase(vaddr_t);
80 1.1 bsh void pxa2x0_intr_init(void);
81 1.1 bsh void *pxa2x0_intr_establish(int irqno, int level,
82 1.1 bsh int (*func)(void *), void *cookie);
83 1.1 bsh void pxa2x0_update_intr_masks( int irqno, int level );
84 1.1 bsh extern int current_spl_level;
85 1.1 bsh
86 1.1 bsh /* Integrated UART */
87 1.1 bsh enum pxa2x0_uart_id { UART_FFUART, UART_BTUART, UART_STUART };
88 1.1 bsh extern void com_pxaip_setup( struct pxa2x0_softc *, enum pxa2x0_uart_id );
89 1.1 bsh
90 1.1 bsh
91 1.1 bsh /* misc. */
92 1.1 bsh extern int pxa2x0_measure_cpuclock( struct pxa2x0_softc * );
93 1.1 bsh extern void pxa2x0_fcs_init(void);
94 1.1 bsh extern void pxa2x0_freq_change(int);
95 1.1 bsh extern void pxa2x0_turbo_mode(int);
96 1.1 bsh extern int pxa2x0_i2c_master_tx( int, uint8_t *, int );
97 1.1 bsh
98 1.1 bsh void pxa2x0_irq_handler(struct clockframe *);
99 1.1 bsh
100 1.1 bsh
101 1.1 bsh #endif /* _ARM_XSCALE_PXA2X0VAR_H_ */
102