at91sam9g20.c (238330) | at91sam9g20.c (238331) |
---|---|
1/*- 2 * Copyright (c) 2005 Olivier Houchard. All rights reserved. 3 * Copyright (c) 2010 Greg Ansley. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2005 Olivier Houchard. All rights reserved. 3 * Copyright (c) 2010 Greg Ansley. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/arm/at91/at91sam9g20.c 238330 2012-07-10 02:14:50Z imp $"); | 28__FBSDID("$FreeBSD: head/sys/arm/at91/at91sam9g20.c 238331 2012-07-10 02:39:03Z imp $"); |
29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/bus.h> 33#include <sys/kernel.h> 34#include <sys/malloc.h> 35#include <sys/module.h> 36 37#define _ARM32_BUS_DMA_PRIVATE 38#include <machine/bus.h> 39 40#include <arm/at91/at91var.h> | 29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/bus.h> 33#include <sys/kernel.h> 34#include <sys/malloc.h> 35#include <sys/module.h> 36 37#define _ARM32_BUS_DMA_PRIVATE 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/at91sam9g20reg.h> 43#include <arm/at91/at91_pmcreg.h> 44#include <arm/at91/at91_pmcvar.h> 45 46struct at91sam9_softc { 47 device_t dev; 48 bus_space_tag_t sc_st; --- 96 unchanged lines hidden (view full) --- 145 device_delete_child(dev, kid); 146 printf("Can't add alloc ivar\n"); 147 return; 148 } 149 device_set_ivars(kid, ivar); 150 resource_list_init(&ivar->resources); 151 if (irq0 != -1) { 152 bus_set_resource(kid, SYS_RES_IRQ, 0, irq0, 1); | 42#include <arm/at91/at91_aicreg.h> 43#include <arm/at91/at91sam9g20reg.h> 44#include <arm/at91/at91_pmcreg.h> 45#include <arm/at91/at91_pmcvar.h> 46 47struct at91sam9_softc { 48 device_t dev; 49 bus_space_tag_t sc_st; --- 96 unchanged lines hidden (view full) --- 146 device_delete_child(dev, kid); 147 printf("Can't add alloc ivar\n"); 148 return; 149 } 150 device_set_ivars(kid, ivar); 151 resource_list_init(&ivar->resources); 152 if (irq0 != -1) { 153 bus_set_resource(kid, SYS_RES_IRQ, 0, irq0, 1); |
153 if (irq0 != AT91SAM9G20_IRQ_SYSTEM) | 154 if (irq0 != AT91_IRQ_SYSTEM) |
154 at91_pmc_clock_add(device_get_nameunit(kid), irq0, 0); 155 } 156 if (irq1 != 0) 157 bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1); 158 if (irq2 != 0) 159 bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1); 160 if (addr != 0 && addr < AT91_BASE) 161 addr += AT91_BASE; --- 82 unchanged lines hidden (view full) --- 244 panic("Enable to map DBGU registers"); 245 246 if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9G20_AIC_BASE, 247 AT91SAM9G20_AIC_SIZE, &sc->sc_aic_sh) != 0) 248 panic("Enable to map system registers"); 249 250 /* XXX Hack to tell atmelarm about the AIC */ 251 at91sc->sc_aic_sh = sc->sc_aic_sh; | 155 at91_pmc_clock_add(device_get_nameunit(kid), irq0, 0); 156 } 157 if (irq1 != 0) 158 bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1); 159 if (irq2 != 0) 160 bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1); 161 if (addr != 0 && addr < AT91_BASE) 162 addr += AT91_BASE; --- 82 unchanged lines hidden (view full) --- 245 panic("Enable to map DBGU registers"); 246 247 if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9G20_AIC_BASE, 248 AT91SAM9G20_AIC_SIZE, &sc->sc_aic_sh) != 0) 249 panic("Enable to map system registers"); 250 251 /* XXX Hack to tell atmelarm about the AIC */ 252 at91sc->sc_aic_sh = sc->sc_aic_sh; |
252 at91sc->sc_irq_system = AT91SAM9G20_IRQ_SYSTEM; | 253 at91sc->sc_irq_system = AT91_IRQ_SYSTEM; |
253 254 for (i = 0; i < 32; i++) { 255 bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR + 256 i * 4, i); 257 /* Priority. */ 258 bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SMR + i * 4, 259 at91_irq_prio[i]); 260 if (i < 8) --- 80 unchanged lines hidden --- | 254 255 for (i = 0; i < 32; i++) { 256 bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR + 257 i * 4, i); 258 /* Priority. */ 259 bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SMR + i * 4, 260 at91_irq_prio[i]); 261 if (i < 8) --- 80 unchanged lines hidden --- |