xref: /netbsd/sys/arch/arm/at91/at91sam9260busvar.h (revision c341b1a5)
1*c341b1a5Saymeric /*	$NetBSD: at91sam9260busvar.h,v 1.1 2011/11/04 17:20:54 aymeric Exp $ */
2*c341b1a5Saymeric 
3*c341b1a5Saymeric /*
4*c341b1a5Saymeric  * Copyright (c) 2007 Embedtronics Oy
5*c341b1a5Saymeric  * All rights reserved.
6*c341b1a5Saymeric  *
7*c341b1a5Saymeric  * Redistribution and use in source and binary forms, with or without
8*c341b1a5Saymeric  * modification, are permitted provided that the following conditions
9*c341b1a5Saymeric  * are met:
10*c341b1a5Saymeric  * 1. Redistributions of source code must retain the above copyright
11*c341b1a5Saymeric  *    notice, this list of conditions and the following disclaimer.
12*c341b1a5Saymeric  * 2. Redistributions in binary form must reproduce the above copyright
13*c341b1a5Saymeric  *    notice, this list of conditions and the following disclaimer in the
14*c341b1a5Saymeric  *    documentation and/or other materials provided with the distribution.
15*c341b1a5Saymeric  *
16*c341b1a5Saymeric  * THIS SOFTWARE IS PROVIDED BY ICHIRO FUKUHARA ``AS IS'' AND ANY EXPRESS OR
17*c341b1a5Saymeric  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18*c341b1a5Saymeric  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19*c341b1a5Saymeric  * IN NO EVENT SHALL ICHIRO FUKUHARA OR THE VOICES IN HIS HEAD BE LIABLE FOR
20*c341b1a5Saymeric  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21*c341b1a5Saymeric  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22*c341b1a5Saymeric  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23*c341b1a5Saymeric  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24*c341b1a5Saymeric  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25*c341b1a5Saymeric  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26*c341b1a5Saymeric  * SUCH DAMAGE.
27*c341b1a5Saymeric  */
28*c341b1a5Saymeric /* Adaptation to AT91SAM9260 by Aymeric Vincent is in the public domain */
29*c341b1a5Saymeric 
30*c341b1a5Saymeric #ifndef _AT91SAM9260BUSVAR_H_
31*c341b1a5Saymeric #define _AT91SAM9260BUSVAR_H_
32*c341b1a5Saymeric 
33*c341b1a5Saymeric #include <arm/at91/at91busvar.h>
34*c341b1a5Saymeric #include <arm/at91/at91pmcvar.h>
35*c341b1a5Saymeric #include <arm/at91/at91aicvar.h>
36*c341b1a5Saymeric #include <arm/at91/at91dbguvar.h>
37*c341b1a5Saymeric #include <arm/at91/at91sam9260reg.h>
38*c341b1a5Saymeric 
39*c341b1a5Saymeric #include "at91dbgu.h"
40*c341b1a5Saymeric 
41*c341b1a5Saymeric void at91sam9260bus_init(struct at91bus_clocks *);
42*c341b1a5Saymeric #if NAT91DBGU > 0
43*c341b1a5Saymeric #define	at91sam9260bus_attach_cn		at91dbgu_attach_cn
44*c341b1a5Saymeric #else
45*c341b1a5Saymeric void at91sam9260bus_attach_cn(bus_space_tag_t iot, int ospeed, int cflag);
46*c341b1a5Saymeric #endif
47*c341b1a5Saymeric const struct pmap_devmap *at91sam9260bus_devmap(void);
48*c341b1a5Saymeric void at91sam9260bus_peripheral_clock(int pid, int enable);
49*c341b1a5Saymeric at91pio_port at91sam9260bus_pio_port(int pid);
50*c341b1a5Saymeric uint32_t at91sam9260bus_gpio_mask(int pid);
51*c341b1a5Saymeric #define	at91sam9260bus_intr_init		at91aic_init
52*c341b1a5Saymeric #define	at91sam9260bus_intr_establish	at91aic_intr_establish
53*c341b1a5Saymeric #define	at91sam9260bus_intr_disestablish	at91aic_intr_disestablish
54*c341b1a5Saymeric #define	at91sam9260bus_intr_poll		at91aic_intr_poll
55*c341b1a5Saymeric #define	at91sam9260bus_intr_dispatch	at91aic_intr_dispatch
56*c341b1a5Saymeric const char *at91sam9260bus_peripheral_name(int pid);
57*c341b1a5Saymeric void at91sam9260bus_search_peripherals(device_t self,
58*c341b1a5Saymeric 				   device_t (*found_func)(device_t, bus_addr_t, int));
59*c341b1a5Saymeric 
60*c341b1a5Saymeric extern const struct at91bus_machdep at91sam9260bus;
61*c341b1a5Saymeric 
62*c341b1a5Saymeric #endif	// _AT91SAM9260BUSVAR_H_
63