Deleted Added
full compact
at91sam9260.c (237237) at91sam9260.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/at91sam9260.c 237237 2012-06-18 19:22:10Z marius $");
28__FBSDID("$FreeBSD: head/sys/arm/at91/at91sam9260.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/at91sam9260reg.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/at91sam9260reg.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 != AT91SAM9260_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 < AT91SAM9260_BASE)
161 addr += AT91SAM9260_BASE;

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

233 panic("Enable to map DBGU registers");
234
235 if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9260_AIC_BASE,
236 AT91SAM9260_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;
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 < AT91SAM9260_BASE)
162 addr += AT91SAM9260_BASE;

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

234 panic("Enable to map DBGU registers");
235
236 if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9260_AIC_BASE,
237 AT91SAM9260_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 = AT91SAM9260_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)

--- 89 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)

--- 89 unchanged lines hidden ---