diff options
author | Andrew Victor <andrew@sanpeople.com> | 2006-09-27 08:23:00 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-09-28 06:53:47 -0400 |
commit | f21738341ca330ec83ef978ee63ffa5ecf13f082 (patch) | |
tree | be42abeb9ef2509a5a0c4187f4aa076d8f3c2dee /arch/arm/mach-at91rm9200/at91rm9200.c | |
parent | 2eeaaa21de68cb8869d3a54438a9224321d3dd03 (diff) |
[ARM] 3867/1: AT91 GPIO update
This patch makes the AT91 gpio.c support processor-generic (AT91RM9200
and AT91SAM9xxx). The GPIO controllers supported by a particular AT91
processor are defined in the processor-specific file and are registered
with gpio.c at startup.
Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-at91rm9200/at91rm9200.c')
-rw-r--r-- | arch/arm/mach-at91rm9200/at91rm9200.c | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/arch/arm/mach-at91rm9200/at91rm9200.c b/arch/arm/mach-at91rm9200/at91rm9200.c index ae04cbdf0bff..c32d0c996f90 100644 --- a/arch/arm/mach-at91rm9200/at91rm9200.c +++ b/arch/arm/mach-at91rm9200/at91rm9200.c | |||
@@ -243,11 +243,34 @@ static void __init at91rm9200_register_clocks(void) | |||
243 | clk_register(&pck3); | 243 | clk_register(&pck3); |
244 | } | 244 | } |
245 | 245 | ||
246 | /* -------------------------------------------------------------------- | ||
247 | * GPIO | ||
248 | * -------------------------------------------------------------------- */ | ||
249 | |||
250 | static struct at91_gpio_bank at91rm9200_gpio[] = { | ||
251 | { | ||
252 | .id = AT91RM9200_ID_PIOA, | ||
253 | .offset = AT91_PIOA, | ||
254 | .clock = &pioA_clk, | ||
255 | }, { | ||
256 | .id = AT91RM9200_ID_PIOB, | ||
257 | .offset = AT91_PIOB, | ||
258 | .clock = &pioB_clk, | ||
259 | }, { | ||
260 | .id = AT91RM9200_ID_PIOC, | ||
261 | .offset = AT91_PIOC, | ||
262 | .clock = &pioC_clk, | ||
263 | }, { | ||
264 | .id = AT91RM9200_ID_PIOD, | ||
265 | .offset = AT91_PIOD, | ||
266 | .clock = &pioD_clk, | ||
267 | } | ||
268 | }; | ||
246 | 269 | ||
247 | /* -------------------------------------------------------------------- | 270 | /* -------------------------------------------------------------------- |
248 | * AT91RM9200 processor initialization | 271 | * AT91RM9200 processor initialization |
249 | * -------------------------------------------------------------------- */ | 272 | * -------------------------------------------------------------------- */ |
250 | void __init at91rm9200_initialize(unsigned long main_clock) | 273 | void __init at91rm9200_initialize(unsigned long main_clock, unsigned short banks) |
251 | { | 274 | { |
252 | /* Map peripherals */ | 275 | /* Map peripherals */ |
253 | iotable_init(at91rm9200_io_desc, ARRAY_SIZE(at91rm9200_io_desc)); | 276 | iotable_init(at91rm9200_io_desc, ARRAY_SIZE(at91rm9200_io_desc)); |
@@ -257,8 +280,16 @@ void __init at91rm9200_initialize(unsigned long main_clock) | |||
257 | 280 | ||
258 | /* Register the processor-specific clocks */ | 281 | /* Register the processor-specific clocks */ |
259 | at91rm9200_register_clocks(); | 282 | at91rm9200_register_clocks(); |
283 | |||
284 | /* Initialize GPIO subsystem */ | ||
285 | at91_gpio_init(at91rm9200_gpio, banks); | ||
260 | } | 286 | } |
261 | 287 | ||
288 | |||
289 | /* -------------------------------------------------------------------- | ||
290 | * Interrupt initialization | ||
291 | * -------------------------------------------------------------------- */ | ||
292 | |||
262 | /* | 293 | /* |
263 | * The default interrupt priority levels (0 = lowest, 7 = highest). | 294 | * The default interrupt priority levels (0 = lowest, 7 = highest). |
264 | */ | 295 | */ |
@@ -297,10 +328,14 @@ static unsigned int at91rm9200_default_irq_priority[NR_AIC_IRQS] __initdata = { | |||
297 | 0 /* Advanced Interrupt Controller (IRQ6) */ | 328 | 0 /* Advanced Interrupt Controller (IRQ6) */ |
298 | }; | 329 | }; |
299 | 330 | ||
300 | void __init at91rm9200_init_irq(unsigned int priority[NR_AIC_IRQS]) | 331 | void __init at91rm9200_init_interrupts(unsigned int priority[NR_AIC_IRQS]) |
301 | { | 332 | { |
302 | if (!priority) | 333 | if (!priority) |
303 | priority = at91rm9200_default_irq_priority; | 334 | priority = at91rm9200_default_irq_priority; |
304 | 335 | ||
336 | /* Initialize the AIC interrupt controller */ | ||
305 | at91_aic_init(priority); | 337 | at91_aic_init(priority); |
338 | |||
339 | /* Enable GPIO interrupts */ | ||
340 | at91_gpio_irq_setup(); | ||
306 | } | 341 | } |