Deleted Added
full compact
at91sam9x5.c (238330) at91sam9x5.c (238331)
1/*-
2 * Copyright (c) 2005 Olivier Houchard. All rights reserved.
3 * Copyright (c) 2010 Greg Ansley. All rights reserved.
4 * Copyright (c) 2012 M. Warner Losh.. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

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
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2005 Olivier Houchard. All rights reserved.
3 * Copyright (c) 2010 Greg Ansley. All rights reserved.
4 * Copyright (c) 2012 M. Warner Losh.. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

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
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/sys/arm/at91/at91sam9x25.c 238330 2012-07-10 02:14:50Z imp $");
29__FBSDID("$FreeBSD: head/sys/arm/at91/at91sam9x25.c 238331 2012-07-10 02:39:03Z imp $");
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/bus.h>
34#include <sys/kernel.h>
35#include <sys/malloc.h>
36#include <sys/module.h>
37
38#include <machine/bus.h>
39
40#include <arm/at91/at91var.h>
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/bus.h>
34#include <sys/kernel.h>
35#include <sys/malloc.h>
36#include <sys/module.h>
37
38#include <machine/bus.h>
39
40#include <arm/at91/at91var.h>
41#include <arm/at91/at91reg.h>
41#include <arm/at91/at91_aicreg.h>
42#include <arm/at91/at91sam9x25reg.h>
43#include <arm/at91/at91_pmcreg.h>
44#include <arm/at91/at91_pmcvar.h>
45
46struct at91sam9x25_softc {
47 device_t dev;
48 bus_space_tag_t sc_st;

--- 99 unchanged lines hidden (view full) ---

148 device_delete_child(dev, kid);
149 printf("Can't add alloc ivar\n");
150 return;
151 }
152 device_set_ivars(kid, ivar);
153 resource_list_init(&ivar->resources);
154 if (irq0 != -1) {
155 bus_set_resource(kid, SYS_RES_IRQ, 0, irq0, 1);
42#include <arm/at91/at91_aicreg.h>
43#include <arm/at91/at91sam9x25reg.h>
44#include <arm/at91/at91_pmcreg.h>
45#include <arm/at91/at91_pmcvar.h>
46
47struct at91sam9x25_softc {
48 device_t dev;
49 bus_space_tag_t sc_st;

--- 99 unchanged lines hidden (view full) ---

149 device_delete_child(dev, kid);
150 printf("Can't add alloc ivar\n");
151 return;
152 }
153 device_set_ivars(kid, ivar);
154 resource_list_init(&ivar->resources);
155 if (irq0 != -1) {
156 bus_set_resource(kid, SYS_RES_IRQ, 0, irq0, 1);
156 if (irq0 != AT91SAM9X25_IRQ_SYSTEM)
157 if (irq0 != AT91_IRQ_SYSTEM)
157 at91_pmc_clock_add(device_get_nameunit(kid), irq0, 0);
158 }
159 if (irq1 != 0)
160 bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1);
161 if (irq2 != 0)
162 bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1);
163 if (addr != 0 && addr < AT91_BASE)
164 addr += AT91_BASE;

--- 82 unchanged lines hidden (view full) ---

247 panic("Enable to map DBGU registers");
248
249 if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9X25_AIC_BASE,
250 AT91SAM9X25_AIC_SIZE, &sc->sc_aic_sh) != 0)
251 panic("Enable to map system registers");
252
253 /* XXX Hack to tell atmelarm about the AIC */
254 at91sc->sc_aic_sh = sc->sc_aic_sh;
158 at91_pmc_clock_add(device_get_nameunit(kid), irq0, 0);
159 }
160 if (irq1 != 0)
161 bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1);
162 if (irq2 != 0)
163 bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1);
164 if (addr != 0 && addr < AT91_BASE)
165 addr += AT91_BASE;

--- 82 unchanged lines hidden (view full) ---

248 panic("Enable to map DBGU registers");
249
250 if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9X25_AIC_BASE,
251 AT91SAM9X25_AIC_SIZE, &sc->sc_aic_sh) != 0)
252 panic("Enable to map system registers");
253
254 /* XXX Hack to tell atmelarm about the AIC */
255 at91sc->sc_aic_sh = sc->sc_aic_sh;
255 at91sc->sc_irq_system = AT91SAM9X25_IRQ_SYSTEM;
256 at91sc->sc_irq_system = AT91_IRQ_SYSTEM;
256
257 for (i = 0; i < 32; i++) {
258 bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR +
259 i * 4, i);
260 /* Priority. */
261 bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SMR + i * 4,
262 at91_irq_prio[i]);
263 if (i < 8)

--- 81 unchanged lines hidden ---
257
258 for (i = 0; i < 32; i++) {
259 bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR +
260 i * 4, i);
261 /* Priority. */
262 bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SMR + i * 4,
263 at91_irq_prio[i]);
264 if (i < 8)

--- 81 unchanged lines hidden ---