at91rm9200.c (238376) | at91rm9200.c (238389) |
---|---|
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/at91rm9200.c 238376 2012-07-11 20:17:14Z imp $"); | 28__FBSDID("$FreeBSD: head/sys/arm/at91/at91rm9200.c 238389 2012-07-12 02:58:45Z 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 --- 141 unchanged lines hidden (view full) --- 178 return (0); 179} 180 181static int 182at91_attach(device_t dev) 183{ 184 struct at91_pmc_clock *clk; 185 struct at91rm92_softc *sc = device_get_softc(dev); | 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 --- 141 unchanged lines hidden (view full) --- 178 return (0); 179} 180 181static int 182at91_attach(device_t dev) 183{ 184 struct at91_pmc_clock *clk; 185 struct at91rm92_softc *sc = device_get_softc(dev); |
186 int i; 187 | |
188 struct at91_softc *at91sc = device_get_softc(device_get_parent(dev)); 189 190 sc->sc_st = at91sc->sc_st; 191 sc->sc_sh = at91sc->sc_sh; 192 sc->dev = dev; 193 194 if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91RM92_SYS_BASE, 195 AT91RM92_SYS_SIZE, &sc->sc_sys_sh) != 0) 196 panic("Enable to map system registers"); 197 | 186 struct at91_softc *at91sc = device_get_softc(device_get_parent(dev)); 187 188 sc->sc_st = at91sc->sc_st; 189 sc->sc_sh = at91sc->sc_sh; 190 sc->dev = dev; 191 192 if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91RM92_SYS_BASE, 193 AT91RM92_SYS_SIZE, &sc->sc_sys_sh) != 0) 194 panic("Enable to map system registers"); 195 |
198 if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91RM92_AIC_BASE, 199 AT91RM92_AIC_SIZE, &sc->sc_aic_sh) != 0) 200 panic("Enable to map system registers"); 201 202 /* XXX Hack to tell atmelarm about the AIC */ 203 at91sc->sc_aic_sh = sc->sc_aic_sh; 204 205 for (i = 0; i < 32; i++) { 206 bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR + 207 i * 4, i); 208 /* Priority. */ 209 bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SMR + i * 4, 210 at91_irq_prio[i]); 211 if (i < 8) 212 bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_EOICR, 213 1); 214 } 215 216 bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SPU, 32); 217 /* No debug. */ 218 bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_DCR, 0); 219 /* Disable and clear all interrupts. */ 220 bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_IDCR, 0xffffffff); 221 bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_ICCR, 0xffffffff); 222 | |
223 /* Disable all interrupts for RTC (0xe24 == RTC_IDR) */ 224 bus_space_write_4(sc->sc_st, sc->sc_sys_sh, 0xe24, 0xffffffff); 225 226 /* Disable all interrupts for the SDRAM controller */ 227 bus_space_write_4(sc->sc_st, sc->sc_sys_sh, 0xfa8, 0xffffffff); 228 229 /* Update USB device port clock info */ 230 clk = at91_pmc_clock_ref("udpck"); --- 47 unchanged lines hidden (view full) --- 278}; 279 280static devclass_t at91rm92_devclass; 281 282DRIVER_MODULE(at91rm920, atmelarm, at91rm92_driver, at91rm92_devclass, 0, 0); 283 284static struct at91_soc_data soc_data = { 285 .soc_delay = at91_st_delay, | 196 /* Disable all interrupts for RTC (0xe24 == RTC_IDR) */ 197 bus_space_write_4(sc->sc_st, sc->sc_sys_sh, 0xe24, 0xffffffff); 198 199 /* Disable all interrupts for the SDRAM controller */ 200 bus_space_write_4(sc->sc_st, sc->sc_sys_sh, 0xfa8, 0xffffffff); 201 202 /* Update USB device port clock info */ 203 clk = at91_pmc_clock_ref("udpck"); --- 47 unchanged lines hidden (view full) --- 251}; 252 253static devclass_t at91rm92_devclass; 254 255DRIVER_MODULE(at91rm920, atmelarm, at91rm92_driver, at91rm92_devclass, 0, 0); 256 257static struct at91_soc_data soc_data = { 258 .soc_delay = at91_st_delay, |
286 .soc_reset = at91_st_cpu_reset | 259 .soc_reset = at91_st_cpu_reset, 260 .soc_irq_prio = at91_irq_prio, |
287}; 288 289AT91_SOC(AT91_T_RM9200, &soc_data); | 261}; 262 263AT91_SOC(AT91_T_RM9200, &soc_data); |