Deleted Added
full compact
at91rm9200.c (238330) at91rm9200.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/at91rm9200.c 238330 2012-07-10 02:14:50Z imp $");
28__FBSDID("$FreeBSD: head/sys/arm/at91/at91rm9200.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/at91rm92reg.h>
42#include <arm/at91/at91_aicreg.h>
43#include <arm/at91/at91_pmcreg.h>
44#include <arm/at91/at91_pmcvar.h>
45
46struct at91rm92_softc {
47 device_t dev;
48 bus_space_tag_t sc_st;

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

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

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

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

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

233 panic("Enable to map DBGU registers");
234
235 if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91RM92_AIC_BASE,
236 AT91RM92_AIC_SIZE, &sc->sc_aic_sh) != 0)
237 panic("Enable to map system registers");
238
239 /* XXX Hack to tell atmelarm about the AIC */
240 at91sc->sc_aic_sh = sc->sc_aic_sh;
162 at91_pmc_clock_add(device_get_nameunit(kid), irq0, 0);
163 }
164 if (irq1 != 0)
165 bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1);
166 if (irq2 != 0)
167 bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1);
168 if (addr != 0 && addr < AT91_BASE)
169 addr += AT91_BASE;

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

234 panic("Enable to map DBGU registers");
235
236 if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91RM92_AIC_BASE,
237 AT91RM92_AIC_SIZE, &sc->sc_aic_sh) != 0)
238 panic("Enable to map system registers");
239
240 /* XXX Hack to tell atmelarm about the AIC */
241 at91sc->sc_aic_sh = sc->sc_aic_sh;
241 at91sc->sc_irq_system = AT91RM92_IRQ_SYSTEM;
242 at91sc->sc_irq_system = AT91_IRQ_SYSTEM;
242
243 for (i = 0; i < 32; i++) {
244 bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR +
245 i * 4, i);
246 /* Priority. */
247 bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SMR + i * 4,
248 at91_irq_prio[i]);
249 if (i < 8)

--- 74 unchanged lines hidden ---
243
244 for (i = 0; i < 32; i++) {
245 bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR +
246 i * 4, i);
247 /* Priority. */
248 bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SMR + i * 4,
249 at91_irq_prio[i]);
250 if (i < 8)

--- 74 unchanged lines hidden ---