Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'at91/cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/linux-arm-soc

* 'at91/cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/linux-arm-soc:
at91: add arch specific ioremap support
at91: factorize sram init
at91: move register clocks to soc generic init
at91: move clock subsystem init to soc generic init
at91: use structure to store the current soc
at91: remove AT91_DBGU offset from dbgu register macro
at91: factorize at91 interrupts init to soc
at91: introduce commom AT91_BASE_SYS

+698 -747
+1 -1
arch/arm/mach-at91/Makefile
··· 2 2 # Makefile for the linux kernel. 3 3 # 4 4 5 - obj-y := irq.o gpio.o 5 + obj-y := irq.o gpio.o setup.o 6 6 obj-m := 7 7 obj-n := 8 8 obj- :=
+10 -35
arch/arm/mach-at91/at91cap9.c
··· 25 25 #include <mach/at91_rstc.h> 26 26 #include <mach/at91_shdwc.h> 27 27 28 + #include "soc.h" 28 29 #include "generic.h" 29 30 #include "clock.h" 30 - 31 - static struct map_desc at91cap9_io_desc[] __initdata = { 32 - { 33 - .virtual = AT91_VA_BASE_SYS, 34 - .pfn = __phys_to_pfn(AT91_BASE_SYS), 35 - .length = SZ_16K, 36 - .type = MT_DEVICE, 37 - }, { 38 - .virtual = AT91_IO_VIRT_BASE - AT91CAP9_SRAM_SIZE, 39 - .pfn = __phys_to_pfn(AT91CAP9_SRAM_BASE), 40 - .length = AT91CAP9_SRAM_SIZE, 41 - .type = MT_DEVICE, 42 - }, 43 - }; 44 31 45 32 /* -------------------------------------------------------------------- 46 33 * Clocks ··· 326 339 * AT91CAP9 processor initialization 327 340 * -------------------------------------------------------------------- */ 328 341 329 - void __init at91cap9_map_io(void) 342 + static void __init at91cap9_map_io(void) 330 343 { 331 - /* Map peripherals */ 332 - iotable_init(at91cap9_io_desc, ARRAY_SIZE(at91cap9_io_desc)); 344 + at91_init_sram(0, AT91CAP9_SRAM_BASE, AT91CAP9_SRAM_SIZE); 333 345 } 334 346 335 - void __init at91cap9_initialize(unsigned long main_clock) 347 + static void __init at91cap9_initialize(void) 336 348 { 337 349 at91_arch_reset = at91cap9_reset; 338 350 pm_power_off = at91cap9_poweroff; 339 351 at91_extern_irq = (1 << AT91CAP9_ID_IRQ0) | (1 << AT91CAP9_ID_IRQ1); 340 - 341 - /* Init clock subsystem */ 342 - at91_clock_init(main_clock); 343 - 344 - /* Register the processor-specific clocks */ 345 - at91cap9_register_clocks(); 346 352 347 353 /* Register GPIO subsystem */ 348 354 at91_gpio_init(at91cap9_gpio, 4); ··· 389 409 0, /* Advanced Interrupt Controller (IRQ1) */ 390 410 }; 391 411 392 - void __init at91cap9_init_interrupts(unsigned int priority[NR_AIC_IRQS]) 393 - { 394 - if (!priority) 395 - priority = at91cap9_default_irq_priority; 396 - 397 - /* Initialize the AIC interrupt controller */ 398 - at91_aic_init(priority); 399 - 400 - /* Enable GPIO interrupts */ 401 - at91_gpio_irq_setup(); 402 - } 412 + struct at91_init_soc __initdata at91cap9_soc = { 413 + .map_io = at91cap9_map_io, 414 + .default_irq_priority = at91cap9_default_irq_priority, 415 + .register_clocks = at91cap9_register_clocks, 416 + .init = at91cap9_initialize, 417 + };
+10 -37
arch/arm/mach-at91/at91rm9200.c
··· 20 20 #include <mach/at91_st.h> 21 21 #include <mach/cpu.h> 22 22 23 + #include "soc.h" 23 24 #include "generic.h" 24 25 #include "clock.h" 25 26 26 27 static struct map_desc at91rm9200_io_desc[] __initdata = { 27 28 { 28 - .virtual = AT91_VA_BASE_SYS, 29 - .pfn = __phys_to_pfn(AT91_BASE_SYS), 30 - .length = SZ_4K, 31 - .type = MT_DEVICE, 32 - }, { 33 29 .virtual = AT91_VA_BASE_EMAC, 34 30 .pfn = __phys_to_pfn(AT91RM9200_BASE_EMAC), 35 31 .length = SZ_16K, 36 - .type = MT_DEVICE, 37 - }, { 38 - .virtual = AT91_IO_VIRT_BASE - AT91RM9200_SRAM_SIZE, 39 - .pfn = __phys_to_pfn(AT91RM9200_SRAM_BASE), 40 - .length = AT91RM9200_SRAM_SIZE, 41 32 .type = MT_DEVICE, 42 33 }, 43 34 }; ··· 295 304 at91_sys_write(AT91_ST_CR, AT91_ST_WDRST); 296 305 } 297 306 298 - int rm9200_type; 299 - EXPORT_SYMBOL(rm9200_type); 300 - 301 - void __init at91rm9200_set_type(int type) 302 - { 303 - rm9200_type = type; 304 - } 305 - 306 307 /* -------------------------------------------------------------------- 307 308 * AT91RM9200 processor initialization 308 309 * -------------------------------------------------------------------- */ 309 - void __init at91rm9200_map_io(void) 310 + static void __init at91rm9200_map_io(void) 310 311 { 311 312 /* Map peripherals */ 313 + at91_init_sram(0, AT91RM9200_SRAM_BASE, AT91RM9200_SRAM_SIZE); 312 314 iotable_init(at91rm9200_io_desc, ARRAY_SIZE(at91rm9200_io_desc)); 313 315 } 314 316 315 - void __init at91rm9200_initialize(unsigned long main_clock) 317 + static void __init at91rm9200_initialize(void) 316 318 { 317 319 at91_arch_reset = at91rm9200_reset; 318 320 at91_extern_irq = (1 << AT91RM9200_ID_IRQ0) | (1 << AT91RM9200_ID_IRQ1) 319 321 | (1 << AT91RM9200_ID_IRQ2) | (1 << AT91RM9200_ID_IRQ3) 320 322 | (1 << AT91RM9200_ID_IRQ4) | (1 << AT91RM9200_ID_IRQ5) 321 323 | (1 << AT91RM9200_ID_IRQ6); 322 - 323 - /* Init clock subsystem */ 324 - at91_clock_init(main_clock); 325 - 326 - /* Register the processor-specific clocks */ 327 - at91rm9200_register_clocks(); 328 324 329 325 /* Initialize GPIO subsystem */ 330 326 at91_gpio_init(at91rm9200_gpio, ··· 361 383 0 /* Advanced Interrupt Controller (IRQ6) */ 362 384 }; 363 385 364 - void __init at91rm9200_init_interrupts(unsigned int priority[NR_AIC_IRQS]) 365 - { 366 - if (!priority) 367 - priority = at91rm9200_default_irq_priority; 368 - 369 - /* Initialize the AIC interrupt controller */ 370 - at91_aic_init(priority); 371 - 372 - /* Enable GPIO interrupts */ 373 - at91_gpio_irq_setup(); 374 - } 386 + struct at91_init_soc __initdata at91rm9200_soc = { 387 + .map_io = at91rm9200_map_io, 388 + .default_irq_priority = at91rm9200_default_irq_priority, 389 + .register_clocks = at91rm9200_register_clocks, 390 + .init = at91rm9200_initialize, 391 + };
+21 -79
arch/arm/mach-at91/at91sam9260.c
··· 17 17 #include <asm/mach/arch.h> 18 18 #include <asm/mach/map.h> 19 19 #include <mach/cpu.h> 20 + #include <mach/at91_dbgu.h> 20 21 #include <mach/at91sam9260.h> 21 22 #include <mach/at91_pmc.h> 22 23 #include <mach/at91_rstc.h> 23 24 #include <mach/at91_shdwc.h> 24 25 26 + #include "soc.h" 25 27 #include "generic.h" 26 28 #include "clock.h" 27 - 28 - static struct map_desc at91sam9260_io_desc[] __initdata = { 29 - { 30 - .virtual = AT91_VA_BASE_SYS, 31 - .pfn = __phys_to_pfn(AT91_BASE_SYS), 32 - .length = SZ_16K, 33 - .type = MT_DEVICE, 34 - } 35 - }; 36 - 37 - static struct map_desc at91sam9260_sram_desc[] __initdata = { 38 - { 39 - .virtual = AT91_IO_VIRT_BASE - AT91SAM9260_SRAM0_SIZE, 40 - .pfn = __phys_to_pfn(AT91SAM9260_SRAM0_BASE), 41 - .length = AT91SAM9260_SRAM0_SIZE, 42 - .type = MT_DEVICE, 43 - }, { 44 - .virtual = AT91_IO_VIRT_BASE - AT91SAM9260_SRAM0_SIZE - AT91SAM9260_SRAM1_SIZE, 45 - .pfn = __phys_to_pfn(AT91SAM9260_SRAM1_BASE), 46 - .length = AT91SAM9260_SRAM1_SIZE, 47 - .type = MT_DEVICE, 48 - } 49 - }; 50 - 51 - static struct map_desc at91sam9g20_sram_desc[] __initdata = { 52 - { 53 - .virtual = AT91_IO_VIRT_BASE - AT91SAM9G20_SRAM0_SIZE, 54 - .pfn = __phys_to_pfn(AT91SAM9G20_SRAM0_BASE), 55 - .length = AT91SAM9G20_SRAM0_SIZE, 56 - .type = MT_DEVICE, 57 - }, { 58 - .virtual = AT91_IO_VIRT_BASE - AT91SAM9G20_SRAM0_SIZE - AT91SAM9G20_SRAM1_SIZE, 59 - .pfn = __phys_to_pfn(AT91SAM9G20_SRAM1_BASE), 60 - .length = AT91SAM9G20_SRAM1_SIZE, 61 - .type = MT_DEVICE, 62 - } 63 - }; 64 - 65 - static struct map_desc at91sam9xe_sram_desc[] __initdata = { 66 - { 67 - .pfn = __phys_to_pfn(AT91SAM9XE_SRAM_BASE), 68 - .type = MT_DEVICE, 69 - } 70 - }; 71 29 72 30 /* -------------------------------------------------------------------- 73 31 * Clocks ··· 288 330 289 331 static void __init at91sam9xe_map_io(void) 290 332 { 291 - unsigned long cidr, sram_size; 333 + unsigned long sram_size; 292 334 293 - cidr = at91_sys_read(AT91_DBGU_CIDR); 294 - 295 - switch (cidr & AT91_CIDR_SRAMSIZ) { 335 + switch (at91_soc_initdata.cidr & AT91_CIDR_SRAMSIZ) { 296 336 case AT91_CIDR_SRAMSIZ_32K: 297 337 sram_size = 2 * SZ_16K; 298 338 break; ··· 299 343 sram_size = SZ_16K; 300 344 } 301 345 302 - at91sam9xe_sram_desc->virtual = AT91_IO_VIRT_BASE - sram_size; 303 - at91sam9xe_sram_desc->length = sram_size; 304 - 305 - iotable_init(at91sam9xe_sram_desc, ARRAY_SIZE(at91sam9xe_sram_desc)); 346 + at91_init_sram(0, AT91SAM9XE_SRAM_BASE, sram_size); 306 347 } 307 348 308 - void __init at91sam9260_map_io(void) 349 + static void __init at91sam9260_map_io(void) 309 350 { 310 - /* Map peripherals */ 311 - iotable_init(at91sam9260_io_desc, ARRAY_SIZE(at91sam9260_io_desc)); 312 - 313 - if (cpu_is_at91sam9xe()) 351 + if (cpu_is_at91sam9xe()) { 314 352 at91sam9xe_map_io(); 315 - else if (cpu_is_at91sam9g20()) 316 - iotable_init(at91sam9g20_sram_desc, ARRAY_SIZE(at91sam9g20_sram_desc)); 317 - else 318 - iotable_init(at91sam9260_sram_desc, ARRAY_SIZE(at91sam9260_sram_desc)); 353 + } else if (cpu_is_at91sam9g20()) { 354 + at91_init_sram(0, AT91SAM9G20_SRAM0_BASE, AT91SAM9G20_SRAM0_SIZE); 355 + at91_init_sram(1, AT91SAM9G20_SRAM1_BASE, AT91SAM9G20_SRAM1_SIZE); 356 + } else { 357 + at91_init_sram(0, AT91SAM9260_SRAM0_BASE, AT91SAM9260_SRAM0_SIZE); 358 + at91_init_sram(1, AT91SAM9260_SRAM1_BASE, AT91SAM9260_SRAM1_SIZE); 359 + } 319 360 } 320 361 321 - void __init at91sam9260_initialize(unsigned long main_clock) 362 + static void __init at91sam9260_initialize(void) 322 363 { 323 364 at91_arch_reset = at91sam9_alt_reset; 324 365 pm_power_off = at91sam9260_poweroff; 325 366 at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1) 326 367 | (1 << AT91SAM9260_ID_IRQ2); 327 - 328 - /* Init clock subsystem */ 329 - at91_clock_init(main_clock); 330 - 331 - /* Register the processor-specific clocks */ 332 - at91sam9260_register_clocks(); 333 368 334 369 /* Register GPIO subsystem */ 335 370 at91_gpio_init(at91sam9260_gpio, 3); ··· 368 421 0, /* Advanced Interrupt Controller */ 369 422 }; 370 423 371 - void __init at91sam9260_init_interrupts(unsigned int priority[NR_AIC_IRQS]) 372 - { 373 - if (!priority) 374 - priority = at91sam9260_default_irq_priority; 375 - 376 - /* Initialize the AIC interrupt controller */ 377 - at91_aic_init(priority); 378 - 379 - /* Enable GPIO interrupts */ 380 - at91_gpio_irq_setup(); 381 - } 424 + struct at91_init_soc __initdata at91sam9260_soc = { 425 + .map_io = at91sam9260_map_io, 426 + .default_irq_priority = at91sam9260_default_irq_priority, 427 + .register_clocks = at91sam9260_register_clocks, 428 + .init = at91sam9260_initialize, 429 + };
+11 -51
arch/arm/mach-at91/at91sam9261.c
··· 22 22 #include <mach/at91_rstc.h> 23 23 #include <mach/at91_shdwc.h> 24 24 25 + #include "soc.h" 25 26 #include "generic.h" 26 27 #include "clock.h" 27 - 28 - static struct map_desc at91sam9261_io_desc[] __initdata = { 29 - { 30 - .virtual = AT91_VA_BASE_SYS, 31 - .pfn = __phys_to_pfn(AT91_BASE_SYS), 32 - .length = SZ_16K, 33 - .type = MT_DEVICE, 34 - }, 35 - }; 36 - 37 - static struct map_desc at91sam9261_sram_desc[] __initdata = { 38 - { 39 - .virtual = AT91_IO_VIRT_BASE - AT91SAM9261_SRAM_SIZE, 40 - .pfn = __phys_to_pfn(AT91SAM9261_SRAM_BASE), 41 - .length = AT91SAM9261_SRAM_SIZE, 42 - .type = MT_DEVICE, 43 - }, 44 - }; 45 - 46 - static struct map_desc at91sam9g10_sram_desc[] __initdata = { 47 - { 48 - .virtual = AT91_IO_VIRT_BASE - AT91SAM9G10_SRAM_SIZE, 49 - .pfn = __phys_to_pfn(AT91SAM9G10_SRAM_BASE), 50 - .length = AT91SAM9G10_SRAM_SIZE, 51 - .type = MT_DEVICE, 52 - }, 53 - }; 54 28 55 29 /* -------------------------------------------------------------------- 56 30 * Clocks ··· 276 302 * AT91SAM9261 processor initialization 277 303 * -------------------------------------------------------------------- */ 278 304 279 - void __init at91sam9261_map_io(void) 305 + static void __init at91sam9261_map_io(void) 280 306 { 281 - /* Map peripherals */ 282 - iotable_init(at91sam9261_io_desc, ARRAY_SIZE(at91sam9261_io_desc)); 283 - 284 307 if (cpu_is_at91sam9g10()) 285 - iotable_init(at91sam9g10_sram_desc, ARRAY_SIZE(at91sam9g10_sram_desc)); 308 + at91_init_sram(0, AT91SAM9G10_SRAM_BASE, AT91SAM9G10_SRAM_SIZE); 286 309 else 287 - iotable_init(at91sam9261_sram_desc, ARRAY_SIZE(at91sam9261_sram_desc)); 310 + at91_init_sram(0, AT91SAM9261_SRAM_BASE, AT91SAM9261_SRAM_SIZE); 288 311 } 289 312 290 - void __init at91sam9261_initialize(unsigned long main_clock) 313 + static void __init at91sam9261_initialize(void) 291 314 { 292 315 at91_arch_reset = at91sam9_alt_reset; 293 316 pm_power_off = at91sam9261_poweroff; 294 317 at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1) 295 318 | (1 << AT91SAM9261_ID_IRQ2); 296 - 297 - /* Init clock subsystem */ 298 - at91_clock_init(main_clock); 299 - 300 - /* Register the processor-specific clocks */ 301 - at91sam9261_register_clocks(); 302 319 303 320 /* Register GPIO subsystem */ 304 321 at91_gpio_init(at91sam9261_gpio, 3); ··· 337 372 0, /* Advanced Interrupt Controller */ 338 373 }; 339 374 340 - void __init at91sam9261_init_interrupts(unsigned int priority[NR_AIC_IRQS]) 341 - { 342 - if (!priority) 343 - priority = at91sam9261_default_irq_priority; 344 - 345 - /* Initialize the AIC interrupt controller */ 346 - at91_aic_init(priority); 347 - 348 - /* Enable GPIO interrupts */ 349 - at91_gpio_irq_setup(); 350 - } 375 + struct at91_init_soc __initdata at91sam9261_soc = { 376 + .map_io = at91sam9261_map_io, 377 + .default_irq_priority = at91sam9261_default_irq_priority, 378 + .register_clocks = at91sam9261_register_clocks, 379 + .init = at91sam9261_initialize, 380 + };
+11 -40
arch/arm/mach-at91/at91sam9263.c
··· 21 21 #include <mach/at91_rstc.h> 22 22 #include <mach/at91_shdwc.h> 23 23 24 + #include "soc.h" 24 25 #include "generic.h" 25 26 #include "clock.h" 26 - 27 - static struct map_desc at91sam9263_io_desc[] __initdata = { 28 - { 29 - .virtual = AT91_VA_BASE_SYS, 30 - .pfn = __phys_to_pfn(AT91_BASE_SYS), 31 - .length = SZ_16K, 32 - .type = MT_DEVICE, 33 - }, { 34 - .virtual = AT91_IO_VIRT_BASE - AT91SAM9263_SRAM0_SIZE, 35 - .pfn = __phys_to_pfn(AT91SAM9263_SRAM0_BASE), 36 - .length = AT91SAM9263_SRAM0_SIZE, 37 - .type = MT_DEVICE, 38 - }, { 39 - .virtual = AT91_IO_VIRT_BASE - AT91SAM9263_SRAM0_SIZE - AT91SAM9263_SRAM1_SIZE, 40 - .pfn = __phys_to_pfn(AT91SAM9263_SRAM1_BASE), 41 - .length = AT91SAM9263_SRAM1_SIZE, 42 - .type = MT_DEVICE, 43 - }, 44 - }; 45 27 46 28 /* -------------------------------------------------------------------- 47 29 * Clocks ··· 295 313 * AT91SAM9263 processor initialization 296 314 * -------------------------------------------------------------------- */ 297 315 298 - void __init at91sam9263_map_io(void) 316 + static void __init at91sam9263_map_io(void) 299 317 { 300 - /* Map peripherals */ 301 - iotable_init(at91sam9263_io_desc, ARRAY_SIZE(at91sam9263_io_desc)); 318 + at91_init_sram(0, AT91SAM9263_SRAM0_BASE, AT91SAM9263_SRAM0_SIZE); 319 + at91_init_sram(1, AT91SAM9263_SRAM1_BASE, AT91SAM9263_SRAM1_SIZE); 302 320 } 303 321 304 - void __init at91sam9263_initialize(unsigned long main_clock) 322 + static void __init at91sam9263_initialize(void) 305 323 { 306 324 at91_arch_reset = at91sam9_alt_reset; 307 325 pm_power_off = at91sam9263_poweroff; 308 326 at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1); 309 - 310 - /* Init clock subsystem */ 311 - at91_clock_init(main_clock); 312 - 313 - /* Register the processor-specific clocks */ 314 - at91sam9263_register_clocks(); 315 327 316 328 /* Register GPIO subsystem */ 317 329 at91_gpio_init(at91sam9263_gpio, 5); ··· 353 377 0, /* Advanced Interrupt Controller (IRQ1) */ 354 378 }; 355 379 356 - void __init at91sam9263_init_interrupts(unsigned int priority[NR_AIC_IRQS]) 357 - { 358 - if (!priority) 359 - priority = at91sam9263_default_irq_priority; 360 - 361 - /* Initialize the AIC interrupt controller */ 362 - at91_aic_init(priority); 363 - 364 - /* Enable GPIO interrupts */ 365 - at91_gpio_irq_setup(); 366 - } 380 + struct at91_init_soc __initdata at91sam9263_soc = { 381 + .map_io = at91sam9263_map_io, 382 + .default_irq_priority = at91sam9263_default_irq_priority, 383 + .register_clocks = at91sam9263_register_clocks, 384 + .init = at91sam9263_initialize, 385 + };
+10 -35
arch/arm/mach-at91/at91sam9g45.c
··· 22 22 #include <mach/at91_shdwc.h> 23 23 #include <mach/cpu.h> 24 24 25 + #include "soc.h" 25 26 #include "generic.h" 26 27 #include "clock.h" 27 - 28 - static struct map_desc at91sam9g45_io_desc[] __initdata = { 29 - { 30 - .virtual = AT91_VA_BASE_SYS, 31 - .pfn = __phys_to_pfn(AT91_BASE_SYS), 32 - .length = SZ_16K, 33 - .type = MT_DEVICE, 34 - }, { 35 - .virtual = AT91_IO_VIRT_BASE - AT91SAM9G45_SRAM_SIZE, 36 - .pfn = __phys_to_pfn(AT91SAM9G45_SRAM_BASE), 37 - .length = AT91SAM9G45_SRAM_SIZE, 38 - .type = MT_DEVICE, 39 - } 40 - }; 41 28 42 29 /* -------------------------------------------------------------------- 43 30 * Clocks ··· 316 329 * AT91SAM9G45 processor initialization 317 330 * -------------------------------------------------------------------- */ 318 331 319 - void __init at91sam9g45_map_io(void) 332 + static void __init at91sam9g45_map_io(void) 320 333 { 321 - /* Map peripherals */ 322 - iotable_init(at91sam9g45_io_desc, ARRAY_SIZE(at91sam9g45_io_desc)); 334 + at91_init_sram(0, AT91SAM9G45_SRAM_BASE, AT91SAM9G45_SRAM_SIZE); 323 335 } 324 336 325 - void __init at91sam9g45_initialize(unsigned long main_clock) 337 + static void __init at91sam9g45_initialize(void) 326 338 { 327 339 at91_arch_reset = at91sam9g45_reset; 328 340 pm_power_off = at91sam9g45_poweroff; 329 341 at91_extern_irq = (1 << AT91SAM9G45_ID_IRQ0); 330 - 331 - /* Init clock subsystem */ 332 - at91_clock_init(main_clock); 333 - 334 - /* Register the processor-specific clocks */ 335 - at91sam9g45_register_clocks(); 336 342 337 343 /* Register GPIO subsystem */ 338 344 at91_gpio_init(at91sam9g45_gpio, 5); ··· 373 393 0, /* Advanced Interrupt Controller (IRQ0) */ 374 394 }; 375 395 376 - void __init at91sam9g45_init_interrupts(unsigned int priority[NR_AIC_IRQS]) 377 - { 378 - if (!priority) 379 - priority = at91sam9g45_default_irq_priority; 380 - 381 - /* Initialize the AIC interrupt controller */ 382 - at91_aic_init(priority); 383 - 384 - /* Enable GPIO interrupts */ 385 - at91_gpio_irq_setup(); 386 - } 396 + struct at91_init_soc __initdata at91sam9g45_soc = { 397 + .map_io = at91sam9g45_map_io, 398 + .default_irq_priority = at91sam9g45_default_irq_priority, 399 + .register_clocks = at91sam9g45_register_clocks, 400 + .init = at91sam9g45_initialize, 401 + };
+13 -46
arch/arm/mach-at91/at91sam9rl.c
··· 16 16 #include <asm/mach/arch.h> 17 17 #include <asm/mach/map.h> 18 18 #include <mach/cpu.h> 19 + #include <mach/at91_dbgu.h> 19 20 #include <mach/at91sam9rl.h> 20 21 #include <mach/at91_pmc.h> 21 22 #include <mach/at91_rstc.h> 22 23 #include <mach/at91_shdwc.h> 23 24 25 + #include "soc.h" 24 26 #include "generic.h" 25 27 #include "clock.h" 26 - 27 - static struct map_desc at91sam9rl_io_desc[] __initdata = { 28 - { 29 - .virtual = AT91_VA_BASE_SYS, 30 - .pfn = __phys_to_pfn(AT91_BASE_SYS), 31 - .length = SZ_16K, 32 - .type = MT_DEVICE, 33 - }, 34 - }; 35 - 36 - static struct map_desc at91sam9rl_sram_desc[] __initdata = { 37 - { 38 - .pfn = __phys_to_pfn(AT91SAM9RL_SRAM_BASE), 39 - .type = MT_DEVICE, 40 - } 41 - }; 42 28 43 29 /* -------------------------------------------------------------------- 44 30 * Clocks ··· 273 287 * AT91SAM9RL processor initialization 274 288 * -------------------------------------------------------------------- */ 275 289 276 - void __init at91sam9rl_map_io(void) 290 + static void __init at91sam9rl_map_io(void) 277 291 { 278 - unsigned long cidr, sram_size; 292 + unsigned long sram_size; 279 293 280 - /* Map peripherals */ 281 - iotable_init(at91sam9rl_io_desc, ARRAY_SIZE(at91sam9rl_io_desc)); 282 - 283 - cidr = at91_sys_read(AT91_DBGU_CIDR); 284 - 285 - switch (cidr & AT91_CIDR_SRAMSIZ) { 294 + switch (at91_soc_initdata.cidr & AT91_CIDR_SRAMSIZ) { 286 295 case AT91_CIDR_SRAMSIZ_32K: 287 296 sram_size = 2 * SZ_16K; 288 297 break; ··· 286 305 sram_size = SZ_16K; 287 306 } 288 307 289 - at91sam9rl_sram_desc->virtual = AT91_IO_VIRT_BASE - sram_size; 290 - at91sam9rl_sram_desc->length = sram_size; 291 - 292 308 /* Map SRAM */ 293 - iotable_init(at91sam9rl_sram_desc, ARRAY_SIZE(at91sam9rl_sram_desc)); 309 + at91_init_sram(0, AT91SAM9RL_SRAM_BASE, sram_size); 294 310 } 295 311 296 - void __init at91sam9rl_initialize(unsigned long main_clock) 312 + static void __init at91sam9rl_initialize(void) 297 313 { 298 314 at91_arch_reset = at91sam9_alt_reset; 299 315 pm_power_off = at91sam9rl_poweroff; 300 316 at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0); 301 - 302 - /* Init clock subsystem */ 303 - at91_clock_init(main_clock); 304 - 305 - /* Register the processor-specific clocks */ 306 - at91sam9rl_register_clocks(); 307 317 308 318 /* Register GPIO subsystem */ 309 319 at91_gpio_init(at91sam9rl_gpio, 4); ··· 342 370 0, /* Advanced Interrupt Controller */ 343 371 }; 344 372 345 - void __init at91sam9rl_init_interrupts(unsigned int priority[NR_AIC_IRQS]) 346 - { 347 - if (!priority) 348 - priority = at91sam9rl_default_irq_priority; 349 - 350 - /* Initialize the AIC interrupt controller */ 351 - at91_aic_init(priority); 352 - 353 - /* Enable GPIO interrupts */ 354 - at91_gpio_irq_setup(); 355 - } 373 + struct at91_init_soc __initdata at91sam9rl_soc = { 374 + .map_io = at91sam9rl_map_io, 375 + .default_irq_priority = at91sam9rl_default_irq_priority, 376 + .register_clocks = at91sam9rl_register_clocks, 377 + .init = at91sam9rl_initialize, 378 + };
+3 -8
arch/arm/mach-at91/board-1arm.c
··· 46 46 at91rm9200_set_type(ARCH_REVISON_9200_PQFP); 47 47 48 48 /* Initialize processor: 18.432 MHz crystal */ 49 - at91rm9200_initialize(18432000); 49 + at91_initialize(18432000); 50 50 51 51 /* DBGU on ttyS0. (Rx & Tx only) */ 52 52 at91_register_uart(0, 0, 0); ··· 61 61 62 62 /* set serial console to ttyS0 (ie, DBGU) */ 63 63 at91_set_serial_console(0); 64 - } 65 - 66 - static void __init onearm_init_irq(void) 67 - { 68 - at91rm9200_init_interrupts(NULL); 69 64 } 70 65 71 66 static struct at91_eth_data __initdata onearm_eth_data = { ··· 92 97 MACHINE_START(ONEARM, "Ajeco 1ARM single board computer") 93 98 /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */ 94 99 .timer = &at91rm9200_timer, 95 - .map_io = at91rm9200_map_io, 100 + .map_io = at91_map_io, 96 101 .init_early = onearm_init_early, 97 - .init_irq = onearm_init_irq, 102 + .init_irq = at91_init_irq_default, 98 103 .init_machine = onearm_board_init, 99 104 MACHINE_END
+3 -9
arch/arm/mach-at91/board-afeb-9260v1.c
··· 51 51 static void __init afeb9260_init_early(void) 52 52 { 53 53 /* Initialize processor: 18.432 MHz crystal */ 54 - at91sam9260_initialize(18432000); 54 + at91_initialize(18432000); 55 55 56 56 /* DBGU on ttyS0. (Rx & Tx only) */ 57 57 at91_register_uart(0, 0, 0); ··· 69 69 /* set serial console to ttyS0 (ie, DBGU) */ 70 70 at91_set_serial_console(0); 71 71 } 72 - 73 - static void __init afeb9260_init_irq(void) 74 - { 75 - at91sam9260_init_interrupts(NULL); 76 - } 77 - 78 72 79 73 /* 80 74 * USB Host port ··· 213 219 MACHINE_START(AFEB9260, "Custom afeb9260 board") 214 220 /* Maintainer: Sergey Lapin <slapin@ossfans.org> */ 215 221 .timer = &at91sam926x_timer, 216 - .map_io = at91sam9260_map_io, 222 + .map_io = at91_map_io, 217 223 .init_early = afeb9260_init_early, 218 - .init_irq = afeb9260_init_irq, 224 + .init_irq = at91_init_irq_default, 219 225 .init_machine = afeb9260_board_init, 220 226 MACHINE_END 221 227
+3 -9
arch/arm/mach-at91/board-cam60.c
··· 48 48 static void __init cam60_init_early(void) 49 49 { 50 50 /* Initialize processor: 10 MHz crystal */ 51 - at91sam9260_initialize(10000000); 51 + at91_initialize(10000000); 52 52 53 53 /* DBGU on ttyS0. (Rx & Tx only) */ 54 54 at91_register_uart(0, 0, 0); ··· 56 56 /* set serial console to ttyS0 (ie, DBGU) */ 57 57 at91_set_serial_console(0); 58 58 } 59 - 60 - static void __init cam60_init_irq(void) 61 - { 62 - at91sam9260_init_interrupts(NULL); 63 - } 64 - 65 59 66 60 /* 67 61 * USB Host ··· 193 199 MACHINE_START(CAM60, "KwikByte CAM60") 194 200 /* Maintainer: KwikByte */ 195 201 .timer = &at91sam926x_timer, 196 - .map_io = at91sam9260_map_io, 202 + .map_io = at91_map_io, 197 203 .init_early = cam60_init_early, 198 - .init_irq = cam60_init_irq, 204 + .init_irq = at91_init_irq_default, 199 205 .init_machine = cam60_board_init, 200 206 MACHINE_END
+3 -9
arch/arm/mach-at91/board-cap9adk.c
··· 53 53 static void __init cap9adk_init_early(void) 54 54 { 55 55 /* Initialize processor: 12 MHz crystal */ 56 - at91cap9_initialize(12000000); 56 + at91_initialize(12000000); 57 57 58 58 /* Setup the LEDs: USER1 and USER2 LED for cpu/timer... */ 59 59 at91_init_leds(AT91_PIN_PA10, AT91_PIN_PA11); ··· 64 64 at91_register_uart(0, 0, 0); /* DBGU = ttyS0 */ 65 65 at91_set_serial_console(0); 66 66 } 67 - 68 - static void __init cap9adk_init_irq(void) 69 - { 70 - at91cap9_init_interrupts(NULL); 71 - } 72 - 73 67 74 68 /* 75 69 * USB Host port ··· 391 397 MACHINE_START(AT91CAP9ADK, "Atmel AT91CAP9A-DK") 392 398 /* Maintainer: Stelian Pop <stelian.pop@leadtechdesign.com> */ 393 399 .timer = &at91sam926x_timer, 394 - .map_io = at91cap9_map_io, 400 + .map_io = at91_map_io, 395 401 .init_early = cap9adk_init_early, 396 - .init_irq = cap9adk_init_irq, 402 + .init_irq = at91_init_irq_default, 397 403 .init_machine = cap9adk_board_init, 398 404 MACHINE_END
+3 -8
arch/arm/mach-at91/board-carmeva.c
··· 43 43 static void __init carmeva_init_early(void) 44 44 { 45 45 /* Initialize processor: 20.000 MHz crystal */ 46 - at91rm9200_initialize(20000000); 46 + at91_initialize(20000000); 47 47 48 48 /* DBGU on ttyS0. (Rx & Tx only) */ 49 49 at91_register_uart(0, 0, 0); ··· 55 55 56 56 /* set serial console to ttyS0 (ie, DBGU) */ 57 57 at91_set_serial_console(0); 58 - } 59 - 60 - static void __init carmeva_init_irq(void) 61 - { 62 - at91rm9200_init_interrupts(NULL); 63 58 } 64 59 65 60 static struct at91_eth_data __initdata carmeva_eth_data = { ··· 158 163 MACHINE_START(CARMEVA, "Carmeva") 159 164 /* Maintainer: Conitec Datasystems */ 160 165 .timer = &at91rm9200_timer, 161 - .map_io = at91rm9200_map_io, 166 + .map_io = at91_map_io, 162 167 .init_early = carmeva_init_early, 163 - .init_irq = carmeva_init_irq, 168 + .init_irq = at91_init_irq_default, 164 169 .init_machine = carmeva_board_init, 165 170 MACHINE_END
+3 -8
arch/arm/mach-at91/board-cpu9krea.c
··· 50 50 static void __init cpu9krea_init_early(void) 51 51 { 52 52 /* Initialize processor: 18.432 MHz crystal */ 53 - at91sam9260_initialize(18432000); 53 + at91_initialize(18432000); 54 54 55 55 /* DGBU on ttyS0. (Rx & Tx only) */ 56 56 at91_register_uart(0, 0, 0); ··· 79 79 80 80 /* set serial console to ttyS0 (ie, DBGU) */ 81 81 at91_set_serial_console(0); 82 - } 83 - 84 - static void __init cpu9krea_init_irq(void) 85 - { 86 - at91sam9260_init_interrupts(NULL); 87 82 } 88 83 89 84 /* ··· 371 376 #endif 372 377 /* Maintainer: Eric Benard - EUKREA Electromatique */ 373 378 .timer = &at91sam926x_timer, 374 - .map_io = at91sam9260_map_io, 379 + .map_io = at91_map_io, 375 380 .init_early = cpu9krea_init_early, 376 - .init_irq = cpu9krea_init_irq, 381 + .init_irq = at91_init_irq_default, 377 382 .init_machine = cpu9krea_board_init, 378 383 MACHINE_END
+3 -8
arch/arm/mach-at91/board-cpuat91.c
··· 57 57 at91rm9200_set_type(ARCH_REVISON_9200_PQFP); 58 58 59 59 /* Initialize processor: 18.432 MHz crystal */ 60 - at91rm9200_initialize(18432000); 60 + at91_initialize(18432000); 61 61 62 62 /* DBGU on ttyS0. (Rx & Tx only) */ 63 63 at91_register_uart(0, 0, 0); ··· 80 80 81 81 /* set serial console to ttyS0 (ie, DBGU) */ 82 82 at91_set_serial_console(0); 83 - } 84 - 85 - static void __init cpuat91_init_irq(void) 86 - { 87 - at91rm9200_init_interrupts(NULL); 88 83 } 89 84 90 85 static struct at91_eth_data __initdata cpuat91_eth_data = { ··· 175 180 MACHINE_START(CPUAT91, "Eukrea") 176 181 /* Maintainer: Eric Benard - EUKREA Electromatique */ 177 182 .timer = &at91rm9200_timer, 178 - .map_io = at91rm9200_map_io, 183 + .map_io = at91_map_io, 179 184 .init_early = cpuat91_init_early, 180 - .init_irq = cpuat91_init_irq, 185 + .init_irq = at91_init_irq_default, 181 186 .init_machine = cpuat91_board_init, 182 187 MACHINE_END
+3 -8
arch/arm/mach-at91/board-csb337.c
··· 46 46 static void __init csb337_init_early(void) 47 47 { 48 48 /* Initialize processor: 3.6864 MHz crystal */ 49 - at91rm9200_initialize(3686400); 49 + at91_initialize(3686400); 50 50 51 51 /* Setup the LEDs */ 52 52 at91_init_leds(AT91_PIN_PB0, AT91_PIN_PB1); ··· 56 56 57 57 /* make console=ttyS0 the default */ 58 58 at91_set_serial_console(0); 59 - } 60 - 61 - static void __init csb337_init_irq(void) 62 - { 63 - at91rm9200_init_interrupts(NULL); 64 59 } 65 60 66 61 static struct at91_eth_data __initdata csb337_eth_data = { ··· 253 258 MACHINE_START(CSB337, "Cogent CSB337") 254 259 /* Maintainer: Bill Gatliff */ 255 260 .timer = &at91rm9200_timer, 256 - .map_io = at91rm9200_map_io, 261 + .map_io = at91_map_io, 257 262 .init_early = csb337_init_early, 258 - .init_irq = csb337_init_irq, 263 + .init_irq = at91_init_irq_default, 259 264 .init_machine = csb337_board_init, 260 265 MACHINE_END
+3 -8
arch/arm/mach-at91/board-csb637.c
··· 43 43 static void __init csb637_init_early(void) 44 44 { 45 45 /* Initialize processor: 3.6864 MHz crystal */ 46 - at91rm9200_initialize(3686400); 46 + at91_initialize(3686400); 47 47 48 48 /* DBGU on ttyS0. (Rx & Tx only) */ 49 49 at91_register_uart(0, 0, 0); 50 50 51 51 /* make console=ttyS0 (ie, DBGU) the default */ 52 52 at91_set_serial_console(0); 53 - } 54 - 55 - static void __init csb637_init_irq(void) 56 - { 57 - at91rm9200_init_interrupts(NULL); 58 53 } 59 54 60 55 static struct at91_eth_data __initdata csb637_eth_data = { ··· 134 139 MACHINE_START(CSB637, "Cogent CSB637") 135 140 /* Maintainer: Bill Gatliff */ 136 141 .timer = &at91rm9200_timer, 137 - .map_io = at91rm9200_map_io, 142 + .map_io = at91_map_io, 138 143 .init_early = csb637_init_early, 139 - .init_irq = csb637_init_irq, 144 + .init_irq = at91_init_irq_default, 140 145 .init_machine = csb637_board_init, 141 146 MACHINE_END
+3 -8
arch/arm/mach-at91/board-eb9200.c
··· 43 43 static void __init eb9200_init_early(void) 44 44 { 45 45 /* Initialize processor: 18.432 MHz crystal */ 46 - at91rm9200_initialize(18432000); 46 + at91_initialize(18432000); 47 47 48 48 /* DBGU on ttyS0. (Rx & Tx only) */ 49 49 at91_register_uart(0, 0, 0); ··· 58 58 59 59 /* set serial console to ttyS0 (ie, DBGU) */ 60 60 at91_set_serial_console(0); 61 - } 62 - 63 - static void __init eb9200_init_irq(void) 64 - { 65 - at91rm9200_init_interrupts(NULL); 66 61 } 67 62 68 63 static struct at91_eth_data __initdata eb9200_eth_data = { ··· 116 121 117 122 MACHINE_START(ATEB9200, "Embest ATEB9200") 118 123 .timer = &at91rm9200_timer, 119 - .map_io = at91rm9200_map_io, 124 + .map_io = at91_map_io, 120 125 .init_early = eb9200_init_early, 121 - .init_irq = eb9200_init_irq, 126 + .init_irq = at91_init_irq_default, 122 127 .init_machine = eb9200_board_init, 123 128 MACHINE_END
+3 -8
arch/arm/mach-at91/board-ecbat91.c
··· 49 49 at91rm9200_set_type(ARCH_REVISON_9200_PQFP); 50 50 51 51 /* Initialize processor: 18.432 MHz crystal */ 52 - at91rm9200_initialize(18432000); 52 + at91_initialize(18432000); 53 53 54 54 /* Setup the LEDs */ 55 55 at91_init_leds(AT91_PIN_PC7, AT91_PIN_PC7); ··· 62 62 63 63 /* set serial console to ttyS0 (ie, DBGU) */ 64 64 at91_set_serial_console(0); 65 - } 66 - 67 - static void __init ecb_at91init_irq(void) 68 - { 69 - at91rm9200_init_interrupts(NULL); 70 65 } 71 66 72 67 static struct at91_eth_data __initdata ecb_at91eth_data = { ··· 168 173 MACHINE_START(ECBAT91, "emQbit's ECB_AT91") 169 174 /* Maintainer: emQbit.com */ 170 175 .timer = &at91rm9200_timer, 171 - .map_io = at91rm9200_map_io, 176 + .map_io = at91_map_io, 172 177 .init_early = ecb_at91init_early, 173 - .init_irq = ecb_at91init_irq, 178 + .init_irq = at91_init_irq_default, 174 179 .init_machine = ecb_at91board_init, 175 180 MACHINE_END
+3 -8
arch/arm/mach-at91/board-eco920.c
··· 35 35 /* Set cpu type: PQFP */ 36 36 at91rm9200_set_type(ARCH_REVISON_9200_PQFP); 37 37 38 - at91rm9200_initialize(18432000); 38 + at91_initialize(18432000); 39 39 40 40 /* Setup the LEDs */ 41 41 at91_init_leds(AT91_PIN_PB0, AT91_PIN_PB1); ··· 45 45 46 46 /* set serial console to ttyS0 (ie, DBGU) */ 47 47 at91_set_serial_console(0); 48 - } 49 - 50 - static void __init eco920_init_irq(void) 51 - { 52 - at91rm9200_init_interrupts(NULL); 53 48 } 54 49 55 50 static struct at91_eth_data __initdata eco920_eth_data = { ··· 130 135 MACHINE_START(ECO920, "eco920") 131 136 /* Maintainer: Sascha Hauer */ 132 137 .timer = &at91rm9200_timer, 133 - .map_io = at91rm9200_map_io, 138 + .map_io = at91_map_io, 134 139 .init_early = eco920_init_early, 135 - .init_irq = eco920_init_irq, 140 + .init_irq = at91_init_irq_default, 136 141 .init_machine = eco920_board_init, 137 142 MACHINE_END
+3 -8
arch/arm/mach-at91/board-flexibity.c
··· 40 40 static void __init flexibity_init_early(void) 41 41 { 42 42 /* Initialize processor: 18.432 MHz crystal */ 43 - at91sam9260_initialize(18432000); 43 + at91_initialize(18432000); 44 44 45 45 /* DBGU on ttyS0. (Rx & Tx only) */ 46 46 at91_register_uart(0, 0, 0); 47 47 48 48 /* set serial console to ttyS0 (ie, DBGU) */ 49 49 at91_set_serial_console(0); 50 - } 51 - 52 - static void __init flexibity_init_irq(void) 53 - { 54 - at91sam9260_init_interrupts(NULL); 55 50 } 56 51 57 52 /* USB Host port */ ··· 150 155 MACHINE_START(FLEXIBITY, "Flexibity Connect") 151 156 /* Maintainer: Maxim Osipov */ 152 157 .timer = &at91sam926x_timer, 153 - .map_io = at91sam9260_map_io, 158 + .map_io = at91_map_io, 154 159 .init_early = flexibity_init_early, 155 - .init_irq = flexibity_init_irq, 160 + .init_irq = at91_init_irq_default, 156 161 .init_machine = flexibity_board_init, 157 162 MACHINE_END
+3 -9
arch/arm/mach-at91/board-foxg20.c
··· 60 60 static void __init foxg20_init_early(void) 61 61 { 62 62 /* Initialize processor: 18.432 MHz crystal */ 63 - at91sam9260_initialize(18432000); 63 + at91_initialize(18432000); 64 64 65 65 /* DBGU on ttyS0. (Rx & Tx only) */ 66 66 at91_register_uart(0, 0, 0); ··· 100 100 at91_set_A_periph(AT91_PIN_PB14, 1); 101 101 102 102 } 103 - 104 - static void __init foxg20_init_irq(void) 105 - { 106 - at91sam9260_init_interrupts(NULL); 107 - } 108 - 109 103 110 104 /* 111 105 * USB Host port ··· 261 267 MACHINE_START(ACMENETUSFOXG20, "Acme Systems srl FOX Board G20") 262 268 /* Maintainer: Sergio Tanzilli */ 263 269 .timer = &at91sam926x_timer, 264 - .map_io = at91sam9260_map_io, 270 + .map_io = at91_map_io, 265 271 .init_early = foxg20_init_early, 266 - .init_irq = foxg20_init_irq, 272 + .init_irq = at91_init_irq_default, 267 273 .init_machine = foxg20_board_init, 268 274 MACHINE_END
+2 -7
arch/arm/mach-at91/board-gsia18s.c
··· 75 75 at91_register_uart(AT91SAM9260_ID_US4, 5, 0); 76 76 } 77 77 78 - static void __init init_irq(void) 79 - { 80 - at91sam9260_init_interrupts(NULL); 81 - } 82 - 83 78 /* 84 79 * Two USB Host ports 85 80 */ ··· 572 577 573 578 MACHINE_START(GSIA18S, "GS_IA18_S") 574 579 .timer = &at91sam926x_timer, 575 - .map_io = at91sam9260_map_io, 580 + .map_io = at91_map_io, 576 581 .init_early = gsia18s_init_early, 577 - .init_irq = init_irq, 582 + .init_irq = at91_init_irq_default, 578 583 .init_machine = gsia18s_board_init, 579 584 MACHINE_END
+3 -8
arch/arm/mach-at91/board-kafa.c
··· 46 46 at91rm9200_set_type(ARCH_REVISON_9200_PQFP); 47 47 48 48 /* Initialize processor: 18.432 MHz crystal */ 49 - at91rm9200_initialize(18432000); 49 + at91_initialize(18432000); 50 50 51 51 /* Set up the LEDs */ 52 52 at91_init_leds(AT91_PIN_PB4, AT91_PIN_PB4); ··· 59 59 60 60 /* set serial console to ttyS0 (ie, DBGU) */ 61 61 at91_set_serial_console(0); 62 - } 63 - 64 - static void __init kafa_init_irq(void) 65 - { 66 - at91rm9200_init_interrupts(NULL); 67 62 } 68 63 69 64 static struct at91_eth_data __initdata kafa_eth_data = { ··· 94 99 MACHINE_START(KAFA, "Sperry-Sun KAFA") 95 100 /* Maintainer: Sergei Sharonov */ 96 101 .timer = &at91rm9200_timer, 97 - .map_io = at91rm9200_map_io, 102 + .map_io = at91_map_io, 98 103 .init_early = kafa_init_early, 99 - .init_irq = kafa_init_irq, 104 + .init_irq = at91_init_irq_default, 100 105 .init_machine = kafa_board_init, 101 106 MACHINE_END
+3 -8
arch/arm/mach-at91/board-kb9202.c
··· 48 48 at91rm9200_set_type(ARCH_REVISON_9200_PQFP); 49 49 50 50 /* Initialize processor: 10 MHz crystal */ 51 - at91rm9200_initialize(10000000); 51 + at91_initialize(10000000); 52 52 53 53 /* Set up the LEDs */ 54 54 at91_init_leds(AT91_PIN_PC19, AT91_PIN_PC18); ··· 67 67 68 68 /* set serial console to ttyS0 (ie, DBGU) */ 69 69 at91_set_serial_console(0); 70 - } 71 - 72 - static void __init kb9202_init_irq(void) 73 - { 74 - at91rm9200_init_interrupts(NULL); 75 70 } 76 71 77 72 static struct at91_eth_data __initdata kb9202_eth_data = { ··· 135 140 MACHINE_START(KB9200, "KB920x") 136 141 /* Maintainer: KwikByte, Inc. */ 137 142 .timer = &at91rm9200_timer, 138 - .map_io = at91rm9200_map_io, 143 + .map_io = at91_map_io, 139 144 .init_early = kb9202_init_early, 140 - .init_irq = kb9202_init_irq, 145 + .init_irq = at91_init_irq_default, 141 146 .init_machine = kb9202_board_init, 142 147 MACHINE_END
+3 -9
arch/arm/mach-at91/board-neocore926.c
··· 54 54 static void __init neocore926_init_early(void) 55 55 { 56 56 /* Initialize processor: 20 MHz crystal */ 57 - at91sam9263_initialize(20000000); 57 + at91_initialize(20000000); 58 58 59 59 /* DBGU on ttyS0. (Rx & Tx only) */ 60 60 at91_register_uart(0, 0, 0); ··· 65 65 /* set serial console to ttyS0 (ie, DBGU) */ 66 66 at91_set_serial_console(0); 67 67 } 68 - 69 - static void __init neocore926_init_irq(void) 70 - { 71 - at91sam9263_init_interrupts(NULL); 72 - } 73 - 74 68 75 69 /* 76 70 * USB Host port ··· 382 388 MACHINE_START(NEOCORE926, "ADENEO NEOCORE 926") 383 389 /* Maintainer: ADENEO */ 384 390 .timer = &at91sam926x_timer, 385 - .map_io = at91sam9263_map_io, 391 + .map_io = at91_map_io, 386 392 .init_early = neocore926_init_early, 387 - .init_irq = neocore926_init_irq, 393 + .init_irq = at91_init_irq_default, 388 394 .init_machine = neocore926_board_init, 389 395 MACHINE_END
+2 -9
arch/arm/mach-at91/board-pcontrol-g20.c
··· 53 53 at91_register_uart(AT91SAM9260_ID_US4, 3, 0); 54 54 } 55 55 56 - 57 - static void __init init_irq(void) 58 - { 59 - at91sam9260_init_interrupts(NULL); 60 - } 61 - 62 - 63 56 static struct sam9_smc_config __initdata pcontrol_smc_config[2] = { { 64 57 .ncs_read_setup = 16, 65 58 .nrd_setup = 18, ··· 216 223 MACHINE_START(PCONTROL_G20, "PControl G20") 217 224 /* Maintainer: pgsellmann@portner-elektronik.at */ 218 225 .timer = &at91sam926x_timer, 219 - .map_io = at91sam9260_map_io, 226 + .map_io = at91_map_io, 220 227 .init_early = pcontrol_g20_init_early, 221 - .init_irq = init_irq, 228 + .init_irq = at91_init_irq_default, 222 229 .init_machine = pcontrol_g20_board_init, 223 230 MACHINE_END
+3 -8
arch/arm/mach-at91/board-picotux200.c
··· 46 46 static void __init picotux200_init_early(void) 47 47 { 48 48 /* Initialize processor: 18.432 MHz crystal */ 49 - at91rm9200_initialize(18432000); 49 + at91_initialize(18432000); 50 50 51 51 /* DBGU on ttyS0. (Rx & Tx only) */ 52 52 at91_register_uart(0, 0, 0); ··· 58 58 59 59 /* set serial console to ttyS0 (ie, DBGU) */ 60 60 at91_set_serial_console(0); 61 - } 62 - 63 - static void __init picotux200_init_irq(void) 64 - { 65 - at91rm9200_init_interrupts(NULL); 66 61 } 67 62 68 63 static struct at91_eth_data __initdata picotux200_eth_data = { ··· 119 124 MACHINE_START(PICOTUX2XX, "picotux 200") 120 125 /* Maintainer: Kleinhenz Elektronik GmbH */ 121 126 .timer = &at91rm9200_timer, 122 - .map_io = at91rm9200_map_io, 127 + .map_io = at91_map_io, 123 128 .init_early = picotux200_init_early, 124 - .init_irq = picotux200_init_irq, 129 + .init_irq = at91_init_irq_default, 125 130 .init_machine = picotux200_board_init, 126 131 MACHINE_END
+3 -9
arch/arm/mach-at91/board-qil-a9260.c
··· 51 51 static void __init ek_init_early(void) 52 52 { 53 53 /* Initialize processor: 12.000 MHz crystal */ 54 - at91sam9260_initialize(12000000); 54 + at91_initialize(12000000); 55 55 56 56 /* DBGU on ttyS0. (Rx & Tx only) */ 57 57 at91_register_uart(0, 0, 0); ··· 71 71 at91_set_serial_console(1); 72 72 73 73 } 74 - 75 - static void __init ek_init_irq(void) 76 - { 77 - at91sam9260_init_interrupts(NULL); 78 - } 79 - 80 74 81 75 /* 82 76 * USB Host port ··· 263 269 MACHINE_START(QIL_A9260, "CALAO QIL_A9260") 264 270 /* Maintainer: calao-systems */ 265 271 .timer = &at91sam926x_timer, 266 - .map_io = at91sam9260_map_io, 272 + .map_io = at91_map_io, 267 273 .init_early = ek_init_early, 268 - .init_irq = ek_init_irq, 274 + .init_irq = at91_init_irq_default, 269 275 .init_machine = ek_board_init, 270 276 MACHINE_END
+3 -8
arch/arm/mach-at91/board-rm9200dk.c
··· 48 48 static void __init dk_init_early(void) 49 49 { 50 50 /* Initialize processor: 18.432 MHz crystal */ 51 - at91rm9200_initialize(18432000); 51 + at91_initialize(18432000); 52 52 53 53 /* Setup the LEDs */ 54 54 at91_init_leds(AT91_PIN_PB2, AT91_PIN_PB2); ··· 63 63 64 64 /* set serial console to ttyS0 (ie, DBGU) */ 65 65 at91_set_serial_console(0); 66 - } 67 - 68 - static void __init dk_init_irq(void) 69 - { 70 - at91rm9200_init_interrupts(NULL); 71 66 } 72 67 73 68 static struct at91_eth_data __initdata dk_eth_data = { ··· 223 228 MACHINE_START(AT91RM9200DK, "Atmel AT91RM9200-DK") 224 229 /* Maintainer: SAN People/Atmel */ 225 230 .timer = &at91rm9200_timer, 226 - .map_io = at91rm9200_map_io, 231 + .map_io = at91_map_io, 227 232 .init_early = dk_init_early, 228 - .init_irq = dk_init_irq, 233 + .init_irq = at91_init_irq_default, 229 234 .init_machine = dk_board_init, 230 235 MACHINE_END
+3 -8
arch/arm/mach-at91/board-rm9200ek.c
··· 48 48 static void __init ek_init_early(void) 49 49 { 50 50 /* Initialize processor: 18.432 MHz crystal */ 51 - at91rm9200_initialize(18432000); 51 + at91_initialize(18432000); 52 52 53 53 /* Setup the LEDs */ 54 54 at91_init_leds(AT91_PIN_PB1, AT91_PIN_PB2); ··· 63 63 64 64 /* set serial console to ttyS0 (ie, DBGU) */ 65 65 at91_set_serial_console(0); 66 - } 67 - 68 - static void __init ek_init_irq(void) 69 - { 70 - at91rm9200_init_interrupts(NULL); 71 66 } 72 67 73 68 static struct at91_eth_data __initdata ek_eth_data = { ··· 189 194 MACHINE_START(AT91RM9200EK, "Atmel AT91RM9200-EK") 190 195 /* Maintainer: SAN People/Atmel */ 191 196 .timer = &at91rm9200_timer, 192 - .map_io = at91rm9200_map_io, 197 + .map_io = at91_map_io, 193 198 .init_early = ek_init_early, 194 - .init_irq = ek_init_irq, 199 + .init_irq = at91_init_irq_default, 195 200 .init_machine = ek_board_init, 196 201 MACHINE_END
+3 -9
arch/arm/mach-at91/board-sam9-l9260.c
··· 47 47 static void __init ek_init_early(void) 48 48 { 49 49 /* Initialize processor: 18.432 MHz crystal */ 50 - at91sam9260_initialize(18432000); 50 + at91_initialize(18432000); 51 51 52 52 /* Setup the LEDs */ 53 53 at91_init_leds(AT91_PIN_PA9, AT91_PIN_PA6); ··· 66 66 /* set serial console to ttyS0 (ie, DBGU) */ 67 67 at91_set_serial_console(0); 68 68 } 69 - 70 - static void __init ek_init_irq(void) 71 - { 72 - at91sam9260_init_interrupts(NULL); 73 - } 74 - 75 69 76 70 /* 77 71 * USB Host port ··· 207 213 MACHINE_START(SAM9_L9260, "Olimex SAM9-L9260") 208 214 /* Maintainer: Olimex */ 209 215 .timer = &at91sam926x_timer, 210 - .map_io = at91sam9260_map_io, 216 + .map_io = at91_map_io, 211 217 .init_early = ek_init_early, 212 - .init_irq = ek_init_irq, 218 + .init_irq = at91_init_irq_default, 213 219 .init_machine = ek_board_init, 214 220 MACHINE_END
+3 -9
arch/arm/mach-at91/board-sam9260ek.c
··· 53 53 static void __init ek_init_early(void) 54 54 { 55 55 /* Initialize processor: 18.432 MHz crystal */ 56 - at91sam9260_initialize(18432000); 56 + at91_initialize(18432000); 57 57 58 58 /* DBGU on ttyS0. (Rx & Tx only) */ 59 59 at91_register_uart(0, 0, 0); ··· 69 69 /* set serial console to ttyS0 (ie, DBGU) */ 70 70 at91_set_serial_console(0); 71 71 } 72 - 73 - static void __init ek_init_irq(void) 74 - { 75 - at91sam9260_init_interrupts(NULL); 76 - } 77 - 78 72 79 73 /* 80 74 * USB Host port ··· 348 354 MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK") 349 355 /* Maintainer: Atmel */ 350 356 .timer = &at91sam926x_timer, 351 - .map_io = at91sam9260_map_io, 357 + .map_io = at91_map_io, 352 358 .init_early = ek_init_early, 353 - .init_irq = ek_init_irq, 359 + .init_irq = at91_init_irq_default, 354 360 .init_machine = ek_board_init, 355 361 MACHINE_END
+3 -9
arch/arm/mach-at91/board-sam9261ek.c
··· 57 57 static void __init ek_init_early(void) 58 58 { 59 59 /* Initialize processor: 18.432 MHz crystal */ 60 - at91sam9261_initialize(18432000); 60 + at91_initialize(18432000); 61 61 62 62 /* Setup the LEDs */ 63 63 at91_init_leds(AT91_PIN_PA13, AT91_PIN_PA14); ··· 68 68 /* set serial console to ttyS0 (ie, DBGU) */ 69 69 at91_set_serial_console(0); 70 70 } 71 - 72 - static void __init ek_init_irq(void) 73 - { 74 - at91sam9261_init_interrupts(NULL); 75 - } 76 - 77 71 78 72 /* 79 73 * DM9000 ethernet device ··· 615 621 #endif 616 622 /* Maintainer: Atmel */ 617 623 .timer = &at91sam926x_timer, 618 - .map_io = at91sam9261_map_io, 624 + .map_io = at91_map_io, 619 625 .init_early = ek_init_early, 620 - .init_irq = ek_init_irq, 626 + .init_irq = at91_init_irq_default, 621 627 .init_machine = ek_board_init, 622 628 MACHINE_END
+3 -9
arch/arm/mach-at91/board-sam9263ek.c
··· 56 56 static void __init ek_init_early(void) 57 57 { 58 58 /* Initialize processor: 16.367 MHz crystal */ 59 - at91sam9263_initialize(16367660); 59 + at91_initialize(16367660); 60 60 61 61 /* DBGU on ttyS0. (Rx & Tx only) */ 62 62 at91_register_uart(0, 0, 0); ··· 67 67 /* set serial console to ttyS0 (ie, DBGU) */ 68 68 at91_set_serial_console(0); 69 69 } 70 - 71 - static void __init ek_init_irq(void) 72 - { 73 - at91sam9263_init_interrupts(NULL); 74 - } 75 - 76 70 77 71 /* 78 72 * USB Host port ··· 446 452 MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK") 447 453 /* Maintainer: Atmel */ 448 454 .timer = &at91sam926x_timer, 449 - .map_io = at91sam9263_map_io, 455 + .map_io = at91_map_io, 450 456 .init_early = ek_init_early, 451 - .init_irq = ek_init_irq, 457 + .init_irq = at91_init_irq_default, 452 458 .init_machine = ek_board_init, 453 459 MACHINE_END
+5 -11
arch/arm/mach-at91/board-sam9g20ek.c
··· 64 64 static void __init ek_init_early(void) 65 65 { 66 66 /* Initialize processor: 18.432 MHz crystal */ 67 - at91sam9260_initialize(18432000); 67 + at91_initialize(18432000); 68 68 69 69 /* DBGU on ttyS0. (Rx & Tx only) */ 70 70 at91_register_uart(0, 0, 0); ··· 80 80 /* set serial console to ttyS0 (ie, DBGU) */ 81 81 at91_set_serial_console(0); 82 82 } 83 - 84 - static void __init ek_init_irq(void) 85 - { 86 - at91sam9260_init_interrupts(NULL); 87 - } 88 - 89 83 90 84 /* 91 85 * USB Host port ··· 398 404 MACHINE_START(AT91SAM9G20EK, "Atmel AT91SAM9G20-EK") 399 405 /* Maintainer: Atmel */ 400 406 .timer = &at91sam926x_timer, 401 - .map_io = at91sam9260_map_io, 407 + .map_io = at91_map_io, 402 408 .init_early = ek_init_early, 403 - .init_irq = ek_init_irq, 409 + .init_irq = at91_init_irq_default, 404 410 .init_machine = ek_board_init, 405 411 MACHINE_END 406 412 407 413 MACHINE_START(AT91SAM9G20EK_2MMC, "Atmel AT91SAM9G20-EK 2 MMC Slot Mod") 408 414 /* Maintainer: Atmel */ 409 415 .timer = &at91sam926x_timer, 410 - .map_io = at91sam9260_map_io, 416 + .map_io = at91_map_io, 411 417 .init_early = ek_init_early, 412 - .init_irq = ek_init_irq, 418 + .init_irq = at91_init_irq_default, 413 419 .init_machine = ek_board_init, 414 420 MACHINE_END
+3 -9
arch/arm/mach-at91/board-sam9m10g45ek.c
··· 50 50 static void __init ek_init_early(void) 51 51 { 52 52 /* Initialize processor: 12.000 MHz crystal */ 53 - at91sam9g45_initialize(12000000); 53 + at91_initialize(12000000); 54 54 55 55 /* DGBU on ttyS0. (Rx & Tx only) */ 56 56 at91_register_uart(0, 0, 0); ··· 62 62 /* set serial console to ttyS0 (ie, DBGU) */ 63 63 at91_set_serial_console(0); 64 64 } 65 - 66 - static void __init ek_init_irq(void) 67 - { 68 - at91sam9g45_init_interrupts(NULL); 69 - } 70 - 71 65 72 66 /* 73 67 * USB HS Host port (common to OHCI & EHCI) ··· 416 422 MACHINE_START(AT91SAM9M10G45EK, "Atmel AT91SAM9M10G45-EK") 417 423 /* Maintainer: Atmel */ 418 424 .timer = &at91sam926x_timer, 419 - .map_io = at91sam9g45_map_io, 425 + .map_io = at91_map_io, 420 426 .init_early = ek_init_early, 421 - .init_irq = ek_init_irq, 427 + .init_irq = at91_init_irq_default, 422 428 .init_machine = ek_board_init, 423 429 MACHINE_END
+3 -9
arch/arm/mach-at91/board-sam9rlek.c
··· 41 41 static void __init ek_init_early(void) 42 42 { 43 43 /* Initialize processor: 12.000 MHz crystal */ 44 - at91sam9rl_initialize(12000000); 44 + at91_initialize(12000000); 45 45 46 46 /* DBGU on ttyS0. (Rx & Tx only) */ 47 47 at91_register_uart(0, 0, 0); ··· 52 52 /* set serial console to ttyS0 (ie, DBGU) */ 53 53 at91_set_serial_console(0); 54 54 } 55 - 56 - static void __init ek_init_irq(void) 57 - { 58 - at91sam9rl_init_interrupts(NULL); 59 - } 60 - 61 55 62 56 /* 63 57 * USB HS Device port ··· 324 330 MACHINE_START(AT91SAM9RLEK, "Atmel AT91SAM9RL-EK") 325 331 /* Maintainer: Atmel */ 326 332 .timer = &at91sam926x_timer, 327 - .map_io = at91sam9rl_map_io, 333 + .map_io = at91_map_io, 328 334 .init_early = ek_init_early, 329 - .init_irq = ek_init_irq, 335 + .init_irq = at91_init_irq_default, 330 336 .init_machine = ek_board_init, 331 337 MACHINE_END
+3 -8
arch/arm/mach-at91/board-snapper9260.c
··· 42 42 43 43 static void __init snapper9260_init_early(void) 44 44 { 45 - at91sam9260_initialize(18432000); 45 + at91_initialize(18432000); 46 46 47 47 /* Debug on ttyS0 */ 48 48 at91_register_uart(0, 0, 0); ··· 53 53 at91_register_uart(AT91SAM9260_ID_US1, 2, 54 54 ATMEL_UART_CTS | ATMEL_UART_RTS); 55 55 at91_register_uart(AT91SAM9260_ID_US2, 3, 0); 56 - } 57 - 58 - static void __init snapper9260_init_irq(void) 59 - { 60 - at91sam9260_init_interrupts(NULL); 61 56 } 62 57 63 58 static struct at91_usbh_data __initdata snapper9260_usbh_data = { ··· 174 179 175 180 MACHINE_START(SNAPPER_9260, "Bluewater Systems Snapper 9260/9G20 module") 176 181 .timer = &at91sam926x_timer, 177 - .map_io = at91sam9260_map_io, 182 + .map_io = at91_map_io, 178 183 .init_early = snapper9260_init_early, 179 - .init_irq = snapper9260_init_irq, 184 + .init_irq = at91_init_irq_default, 180 185 .init_machine = snapper9260_board_init, 181 186 MACHINE_END 182 187
+5 -11
arch/arm/mach-at91/board-stamp9g20.c
··· 35 35 void __init stamp9g20_init_early(void) 36 36 { 37 37 /* Initialize processor: 18.432 MHz crystal */ 38 - at91sam9260_initialize(18432000); 38 + at91_initialize(18432000); 39 39 40 40 /* DGBU on ttyS0. (Rx & Tx only) */ 41 41 at91_register_uart(0, 0, 0); ··· 75 75 /* USART5 on ttyS6. (Rx, Tx only) */ 76 76 at91_register_uart(AT91SAM9260_ID_US5, 6, 0); 77 77 } 78 - 79 - static void __init init_irq(void) 80 - { 81 - at91sam9260_init_interrupts(NULL); 82 - } 83 - 84 78 85 79 /* 86 80 * NAND flash ··· 293 299 MACHINE_START(PORTUXG20, "taskit PortuxG20") 294 300 /* Maintainer: taskit GmbH */ 295 301 .timer = &at91sam926x_timer, 296 - .map_io = at91sam9260_map_io, 302 + .map_io = at91_map_io, 297 303 .init_early = portuxg20_init_early, 298 - .init_irq = init_irq, 304 + .init_irq = at91_init_irq_default, 299 305 .init_machine = portuxg20_board_init, 300 306 MACHINE_END 301 307 302 308 MACHINE_START(STAMP9G20, "taskit Stamp9G20") 303 309 /* Maintainer: taskit GmbH */ 304 310 .timer = &at91sam926x_timer, 305 - .map_io = at91sam9260_map_io, 311 + .map_io = at91_map_io, 306 312 .init_early = stamp9g20evb_init_early, 307 - .init_irq = init_irq, 313 + .init_irq = at91_init_irq_default, 308 314 .init_machine = stamp9g20evb_board_init, 309 315 MACHINE_END
+3 -9
arch/arm/mach-at91/board-usb-a9260.c
··· 51 51 static void __init ek_init_early(void) 52 52 { 53 53 /* Initialize processor: 12.000 MHz crystal */ 54 - at91sam9260_initialize(12000000); 54 + at91_initialize(12000000); 55 55 56 56 /* DBGU on ttyS0. (Rx & Tx only) */ 57 57 at91_register_uart(0, 0, 0); ··· 59 59 /* set serial console to ttyS0 (ie, DBGU) */ 60 60 at91_set_serial_console(0); 61 61 } 62 - 63 - static void __init ek_init_irq(void) 64 - { 65 - at91sam9260_init_interrupts(NULL); 66 - } 67 - 68 62 69 63 /* 70 64 * USB Host port ··· 223 229 MACHINE_START(USB_A9260, "CALAO USB_A9260") 224 230 /* Maintainer: calao-systems */ 225 231 .timer = &at91sam926x_timer, 226 - .map_io = at91sam9260_map_io, 232 + .map_io = at91_map_io, 227 233 .init_early = ek_init_early, 228 - .init_irq = ek_init_irq, 234 + .init_irq = at91_init_irq_default, 229 235 .init_machine = ek_board_init, 230 236 MACHINE_END
+3 -9
arch/arm/mach-at91/board-usb-a9263.c
··· 50 50 static void __init ek_init_early(void) 51 51 { 52 52 /* Initialize processor: 12.00 MHz crystal */ 53 - at91sam9263_initialize(12000000); 53 + at91_initialize(12000000); 54 54 55 55 /* DBGU on ttyS0. (Rx & Tx only) */ 56 56 at91_register_uart(0, 0, 0); ··· 58 58 /* set serial console to ttyS0 (ie, DBGU) */ 59 59 at91_set_serial_console(0); 60 60 } 61 - 62 - static void __init ek_init_irq(void) 63 - { 64 - at91sam9263_init_interrupts(NULL); 65 - } 66 - 67 61 68 62 /* 69 63 * USB Host port ··· 239 245 MACHINE_START(USB_A9263, "CALAO USB_A9263") 240 246 /* Maintainer: calao-systems */ 241 247 .timer = &at91sam926x_timer, 242 - .map_io = at91sam9263_map_io, 248 + .map_io = at91_map_io, 243 249 .init_early = ek_init_early, 244 - .init_irq = ek_init_irq, 250 + .init_irq = at91_init_irq_default, 245 251 .init_machine = ek_board_init, 246 252 MACHINE_END
+3 -9
arch/arm/mach-at91/board-yl-9200.c
··· 56 56 at91rm9200_set_type(ARCH_REVISON_9200_PQFP); 57 57 58 58 /* Initialize processor: 18.432 MHz crystal */ 59 - at91rm9200_initialize(18432000); 59 + at91_initialize(18432000); 60 60 61 61 /* Setup the LEDs D2=PB17 (timer), D3=PB16 (cpu) */ 62 62 at91_init_leds(AT91_PIN_PB16, AT91_PIN_PB17); ··· 78 78 /* set serial console to ttyS0 (ie, DBGU) */ 79 79 at91_set_serial_console(0); 80 80 } 81 - 82 - static void __init yl9200_init_irq(void) 83 - { 84 - at91rm9200_init_interrupts(NULL); 85 - } 86 - 87 81 88 82 /* 89 83 * LEDs ··· 593 599 MACHINE_START(YL9200, "uCdragon YL-9200") 594 600 /* Maintainer: S.Birtles */ 595 601 .timer = &at91rm9200_timer, 596 - .map_io = at91rm9200_map_io, 602 + .map_io = at91_map_io, 597 603 .init_early = yl9200_init_early, 598 - .init_irq = yl9200_init_irq, 604 + .init_irq = at91_init_irq_default, 599 605 .init_machine = yl9200_board_init, 600 606 MACHINE_END
+11 -23
arch/arm/mach-at91/generic.h
··· 11 11 #include <linux/clkdev.h> 12 12 13 13 /* Map io */ 14 - extern void __init at91rm9200_map_io(void); 15 - extern void __init at91sam9260_map_io(void); 16 - extern void __init at91sam9261_map_io(void); 17 - extern void __init at91sam9263_map_io(void); 18 - extern void __init at91sam9rl_map_io(void); 19 - extern void __init at91sam9g45_map_io(void); 20 - extern void __init at91x40_map_io(void); 21 - extern void __init at91cap9_map_io(void); 14 + extern void __init at91_map_io(void); 15 + extern void __init at91_init_sram(int bank, unsigned long base, 16 + unsigned int length); 22 17 23 18 /* Processors */ 24 19 extern void __init at91rm9200_set_type(int type); 25 - extern void __init at91rm9200_initialize(unsigned long main_clock); 26 - extern void __init at91sam9260_initialize(unsigned long main_clock); 27 - extern void __init at91sam9261_initialize(unsigned long main_clock); 28 - extern void __init at91sam9263_initialize(unsigned long main_clock); 29 - extern void __init at91sam9rl_initialize(unsigned long main_clock); 30 - extern void __init at91sam9g45_initialize(unsigned long main_clock); 20 + extern void __init at91_initialize(unsigned long main_clock); 31 21 extern void __init at91x40_initialize(unsigned long main_clock); 32 - extern void __init at91cap9_initialize(unsigned long main_clock); 33 22 34 23 /* Interrupts */ 35 - extern void __init at91rm9200_init_interrupts(unsigned int priority[]); 36 - extern void __init at91sam9260_init_interrupts(unsigned int priority[]); 37 - extern void __init at91sam9261_init_interrupts(unsigned int priority[]); 38 - extern void __init at91sam9263_init_interrupts(unsigned int priority[]); 39 - extern void __init at91sam9rl_init_interrupts(unsigned int priority[]); 40 - extern void __init at91sam9g45_init_interrupts(unsigned int priority[]); 24 + extern void __init at91_init_irq_default(void); 25 + extern void __init at91_init_interrupts(unsigned int priority[]); 41 26 extern void __init at91x40_init_interrupts(unsigned int priority[]); 42 - extern void __init at91cap9_init_interrupts(unsigned int priority[]); 43 27 extern void __init at91_aic_init(unsigned int priority[]); 44 28 45 29 /* Timer */ ··· 33 49 extern struct sys_timer at91x40_timer; 34 50 35 51 /* Clocks */ 36 - extern int __init at91_clock_init(unsigned long main_clock); 37 52 /* 38 53 * function to specify the clock of the default console. As we do not 39 54 * use the device/driver bus, the dev_name is not intialize. So we need ··· 45 62 extern void __init at91sam9rl_set_console_clock(int id); 46 63 extern void __init at91sam9g45_set_console_clock(int id); 47 64 extern void __init at91cap9_set_console_clock(int id); 65 + #ifdef CONFIG_AT91_PMC_UNIT 66 + extern int __init at91_clock_init(unsigned long main_clock); 67 + #else 68 + static int inline at91_clock_init(unsigned long main_clock) { return 0; } 69 + #endif 48 70 struct device; 49 71 50 72 /* Power Management */
+15 -12
arch/arm/mach-at91/include/mach/at91_dbgu.h
··· 16 16 #ifndef AT91_DBGU_H 17 17 #define AT91_DBGU_H 18 18 19 + #define dbgu_readl(dbgu, field) \ 20 + __raw_readl(AT91_VA_BASE_SYS + dbgu + AT91_DBGU_ ## field) 21 + 19 22 #ifdef AT91_DBGU 20 - #define AT91_DBGU_CR (AT91_DBGU + 0x00) /* Control Register */ 21 - #define AT91_DBGU_MR (AT91_DBGU + 0x04) /* Mode Register */ 22 - #define AT91_DBGU_IER (AT91_DBGU + 0x08) /* Interrupt Enable Register */ 23 + #define AT91_DBGU_CR (0x00) /* Control Register */ 24 + #define AT91_DBGU_MR (0x04) /* Mode Register */ 25 + #define AT91_DBGU_IER (0x08) /* Interrupt Enable Register */ 23 26 #define AT91_DBGU_TXRDY (1 << 1) /* Transmitter Ready */ 24 27 #define AT91_DBGU_TXEMPTY (1 << 9) /* Transmitter Empty */ 25 - #define AT91_DBGU_IDR (AT91_DBGU + 0x0c) /* Interrupt Disable Register */ 26 - #define AT91_DBGU_IMR (AT91_DBGU + 0x10) /* Interrupt Mask Register */ 27 - #define AT91_DBGU_SR (AT91_DBGU + 0x14) /* Status Register */ 28 - #define AT91_DBGU_RHR (AT91_DBGU + 0x18) /* Receiver Holding Register */ 29 - #define AT91_DBGU_THR (AT91_DBGU + 0x1c) /* Transmitter Holding Register */ 30 - #define AT91_DBGU_BRGR (AT91_DBGU + 0x20) /* Baud Rate Generator Register */ 28 + #define AT91_DBGU_IDR (0x0c) /* Interrupt Disable Register */ 29 + #define AT91_DBGU_IMR (0x10) /* Interrupt Mask Register */ 30 + #define AT91_DBGU_SR (0x14) /* Status Register */ 31 + #define AT91_DBGU_RHR (0x18) /* Receiver Holding Register */ 32 + #define AT91_DBGU_THR (0x1c) /* Transmitter Holding Register */ 33 + #define AT91_DBGU_BRGR (0x20) /* Baud Rate Generator Register */ 31 34 32 - #define AT91_DBGU_CIDR (AT91_DBGU + 0x40) /* Chip ID Register */ 33 - #define AT91_DBGU_EXID (AT91_DBGU + 0x44) /* Chip ID Extension Register */ 34 - #define AT91_DBGU_FNR (AT91_DBGU + 0x48) /* Force NTRST Register [SAM9 only] */ 35 + #define AT91_DBGU_CIDR (0x40) /* Chip ID Register */ 36 + #define AT91_DBGU_EXID (0x44) /* Chip ID Extension Register */ 37 + #define AT91_DBGU_FNR (0x48) /* Force NTRST Register [SAM9 only] */ 35 38 #define AT91_DBGU_FNTRST (1 << 0) /* Force NTRST */ 36 39 37 40 #endif /* AT91_DBGU */
-1
arch/arm/mach-at91/include/mach/at91cap9.h
··· 75 75 #define AT91CAP9_BASE_EMAC 0xfffbc000 76 76 #define AT91CAP9_BASE_ADC 0xfffc0000 77 77 #define AT91CAP9_BASE_ISI 0xfffc4000 78 - #define AT91_BASE_SYS 0xffffe200 79 78 80 79 /* 81 80 * System Peripherals (offset from AT91_BASE_SYS)
-1
arch/arm/mach-at91/include/mach/at91rm9200.h
··· 74 74 #define AT91RM9200_BASE_SSC1 0xfffd4000 75 75 #define AT91RM9200_BASE_SSC2 0xfffd8000 76 76 #define AT91RM9200_BASE_SPI 0xfffe0000 77 - #define AT91_BASE_SYS 0xfffff000 78 77 79 78 80 79 /*
-1
arch/arm/mach-at91/include/mach/at91sam9260.h
··· 76 76 #define AT91SAM9260_BASE_TC4 0xfffdc040 77 77 #define AT91SAM9260_BASE_TC5 0xfffdc080 78 78 #define AT91SAM9260_BASE_ADC 0xfffe0000 79 - #define AT91_BASE_SYS 0xffffe800 80 79 81 80 /* 82 81 * System Peripherals (offset from AT91_BASE_SYS)
-1
arch/arm/mach-at91/include/mach/at91sam9261.h
··· 60 60 #define AT91SAM9261_BASE_SSC2 0xfffc4000 61 61 #define AT91SAM9261_BASE_SPI0 0xfffc8000 62 62 #define AT91SAM9261_BASE_SPI1 0xfffcc000 63 - #define AT91_BASE_SYS 0xffffea00 64 63 65 64 66 65 /*
-1
arch/arm/mach-at91/include/mach/at91sam9263.h
··· 70 70 #define AT91SAM9263_BASE_EMAC 0xfffbc000 71 71 #define AT91SAM9263_BASE_ISI 0xfffc4000 72 72 #define AT91SAM9263_BASE_2DGE 0xfffc8000 73 - #define AT91_BASE_SYS 0xffffe000 74 73 75 74 /* 76 75 * System Peripherals (offset from AT91_BASE_SYS)
-1
arch/arm/mach-at91/include/mach/at91sam9g45.h
··· 82 82 #define AT91SAM9G45_BASE_TC3 0xfffd4000 83 83 #define AT91SAM9G45_BASE_TC4 0xfffd4040 84 84 #define AT91SAM9G45_BASE_TC5 0xfffd4080 85 - #define AT91_BASE_SYS 0xffffe200 86 85 87 86 /* 88 87 * System Peripherals (offset from AT91_BASE_SYS)
-1
arch/arm/mach-at91/include/mach/at91sam9rl.h
··· 64 64 #define AT91SAM9RL_BASE_TSC 0xfffd0000 65 65 #define AT91SAM9RL_BASE_UDPHS 0xfffd4000 66 66 #define AT91SAM9RL_BASE_AC97C 0xfffd8000 67 - #define AT91_BASE_SYS 0xffffc000 68 67 69 68 70 69 /*
+91 -72
arch/arm/mach-at91/include/mach/cpu.h
··· 1 1 /* 2 2 * arch/arm/mach-at91/include/mach/cpu.h 3 3 * 4 - * Copyright (C) 2006 SAN People 4 + * Copyright (C) 2006 SAN People 5 + * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> 5 6 * 6 7 * This program is free software; you can redistribute it and/or modify 7 8 * it under the terms of the GNU General Public License as published by ··· 11 10 * 12 11 */ 13 12 14 - #ifndef __ASM_ARCH_CPU_H 15 - #define __ASM_ARCH_CPU_H 16 - 17 - #include <mach/hardware.h> 18 - #include <mach/at91_dbgu.h> 19 - 13 + #ifndef __MACH_CPU_H__ 14 + #define __MACH_CPU_H__ 20 15 21 16 #define ARCH_ID_AT91RM9200 0x09290780 22 17 #define ARCH_ID_AT91SAM9260 0x019803a0 ··· 36 39 #define ARCH_ID_AT91M40807 0x14080745 37 40 #define ARCH_ID_AT91R40008 0x44000840 38 41 39 - static inline unsigned long at91_cpu_identify(void) 40 - { 41 - return (at91_sys_read(AT91_DBGU_CIDR) & ~AT91_CIDR_VERSION); 42 - } 43 - 44 - static inline unsigned long at91_cpu_fully_identify(void) 45 - { 46 - return at91_sys_read(AT91_DBGU_CIDR); 47 - } 48 - 49 42 #define ARCH_EXID_AT91SAM9M11 0x00000001 50 43 #define ARCH_EXID_AT91SAM9M10 0x00000002 51 44 #define ARCH_EXID_AT91SAM9G46 0x00000003 ··· 47 60 #define ARCH_EXID_AT91SAM9G25 0x00000003 48 61 #define ARCH_EXID_AT91SAM9X25 0x00000004 49 62 50 - static inline unsigned long at91_exid_identify(void) 51 - { 52 - return at91_sys_read(AT91_DBGU_EXID); 53 - } 54 - 55 - 56 63 #define ARCH_FAMILY_AT91X92 0x09200000 57 64 #define ARCH_FAMILY_AT91SAM9 0x01900000 58 65 #define ARCH_FAMILY_AT91SAM9XE 0x02900000 59 66 60 - static inline unsigned long at91_arch_identify(void) 61 - { 62 - return (at91_sys_read(AT91_DBGU_CIDR) & AT91_CIDR_ARCH); 63 - } 64 - 65 - #ifdef CONFIG_ARCH_AT91CAP9 66 - #include <mach/at91_pmc.h> 67 - 67 + /* PMC revision */ 68 68 #define ARCH_REVISION_CAP9_B 0x399 69 69 #define ARCH_REVISION_CAP9_C 0x601 70 70 71 - static inline unsigned long at91cap9_rev_identify(void) 72 - { 73 - return (at91_sys_read(AT91_PMC_VER)); 74 - } 75 - #endif 76 - 77 - #ifdef CONFIG_ARCH_AT91RM9200 78 - extern int rm9200_type; 71 + /* RM9200 type */ 79 72 #define ARCH_REVISON_9200_BGA (0 << 0) 80 73 #define ARCH_REVISON_9200_PQFP (1 << 0) 81 - #define cpu_is_at91rm9200() (at91_cpu_identify() == ARCH_ID_AT91RM9200) 82 - #define cpu_is_at91rm9200_bga() (!cpu_is_at91rm9200_pqfp()) 83 - #define cpu_is_at91rm9200_pqfp() (cpu_is_at91rm9200() && rm9200_type & ARCH_REVISON_9200_PQFP) 74 + 75 + enum at91_soc_type { 76 + /* 920T */ 77 + AT91_SOC_RM9200, 78 + 79 + /* CAP */ 80 + AT91_SOC_CAP9, 81 + 82 + /* SAM92xx */ 83 + AT91_SOC_SAM9260, AT91_SOC_SAM9261, AT91_SOC_SAM9263, 84 + 85 + /* SAM9Gxx */ 86 + AT91_SOC_SAM9G10, AT91_SOC_SAM9G20, AT91_SOC_SAM9G45, 87 + 88 + /* SAM9RL */ 89 + AT91_SOC_SAM9RL, 90 + 91 + /* SAM9X5 */ 92 + AT91_SOC_SAM9X5, 93 + 94 + /* Unknown type */ 95 + AT91_SOC_NONE 96 + }; 97 + 98 + enum at91_soc_subtype { 99 + /* RM9200 */ 100 + AT91_SOC_RM9200_BGA, AT91_SOC_RM9200_PQFP, 101 + 102 + /* CAP9 */ 103 + AT91_SOC_CAP9_REV_B, AT91_SOC_CAP9_REV_C, 104 + 105 + /* SAM9260 */ 106 + AT91_SOC_SAM9XE, 107 + 108 + /* SAM9G45 */ 109 + AT91_SOC_SAM9G45ES, AT91_SOC_SAM9M10, AT91_SOC_SAM9G46, AT91_SOC_SAM9M11, 110 + 111 + /* SAM9X5 */ 112 + AT91_SOC_SAM9G15, AT91_SOC_SAM9G35, AT91_SOC_SAM9X35, 113 + AT91_SOC_SAM9G25, AT91_SOC_SAM9X25, 114 + 115 + /* Unknown subtype */ 116 + AT91_SOC_SUBTYPE_NONE 117 + }; 118 + 119 + struct at91_socinfo { 120 + unsigned int type, subtype; 121 + unsigned int cidr, exid; 122 + }; 123 + 124 + extern struct at91_socinfo at91_soc_initdata; 125 + const char *at91_get_soc_type(struct at91_socinfo *c); 126 + const char *at91_get_soc_subtype(struct at91_socinfo *c); 127 + 128 + static inline int at91_soc_is_detected(void) 129 + { 130 + return at91_soc_initdata.type != AT91_SOC_NONE; 131 + } 132 + 133 + #ifdef CONFIG_ARCH_AT91RM9200 134 + #define cpu_is_at91rm9200() (at91_soc_initdata.type == AT91_SOC_RM9200) 135 + #define cpu_is_at91rm9200_bga() (at91_soc_initdata.subtype == AT91_SOC_RM9200_BGA) 136 + #define cpu_is_at91rm9200_pqfp() (at91_soc_initdata.subtype == AT91_SOC_RM9200_PQFP) 84 137 #else 85 138 #define cpu_is_at91rm9200() (0) 86 139 #define cpu_is_at91rm9200_bga() (0) ··· 128 101 #endif 129 102 130 103 #ifdef CONFIG_ARCH_AT91SAM9260 131 - #define cpu_is_at91sam9xe() (at91_arch_identify() == ARCH_FAMILY_AT91SAM9XE) 132 - #define cpu_is_at91sam9260() ((at91_cpu_identify() == ARCH_ID_AT91SAM9260) || cpu_is_at91sam9xe()) 104 + #define cpu_is_at91sam9xe() (at91_soc_initdata.subtype == AT91_SOC_SAM9XE) 105 + #define cpu_is_at91sam9260() (at91_soc_initdata.type == AT91_SOC_SAM9260) 133 106 #else 134 107 #define cpu_is_at91sam9xe() (0) 135 108 #define cpu_is_at91sam9260() (0) 136 109 #endif 137 110 138 111 #ifdef CONFIG_ARCH_AT91SAM9G20 139 - #define cpu_is_at91sam9g20() (at91_cpu_identify() == ARCH_ID_AT91SAM9G20) 112 + #define cpu_is_at91sam9g20() (at91_soc_initdata.type == AT91_SOC_SAM9G20) 140 113 #else 141 114 #define cpu_is_at91sam9g20() (0) 142 115 #endif 143 116 144 117 #ifdef CONFIG_ARCH_AT91SAM9261 145 - #define cpu_is_at91sam9261() (at91_cpu_identify() == ARCH_ID_AT91SAM9261) 118 + #define cpu_is_at91sam9261() (at91_soc_initdata.type == AT91_SOC_SAM9261) 146 119 #else 147 120 #define cpu_is_at91sam9261() (0) 148 121 #endif 149 122 150 123 #ifdef CONFIG_ARCH_AT91SAM9G10 151 - #define cpu_is_at91sam9g10() ((at91_cpu_identify() & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) 124 + #define cpu_is_at91sam9g10() (at91_soc_initdata.type == AT91_SOC_SAM9G10) 152 125 #else 153 126 #define cpu_is_at91sam9g10() (0) 154 127 #endif 155 128 156 129 #ifdef CONFIG_ARCH_AT91SAM9263 157 - #define cpu_is_at91sam9263() (at91_cpu_identify() == ARCH_ID_AT91SAM9263) 130 + #define cpu_is_at91sam9263() (at91_soc_initdata.type == AT91_SOC_SAM9263) 158 131 #else 159 132 #define cpu_is_at91sam9263() (0) 160 133 #endif 161 134 162 135 #ifdef CONFIG_ARCH_AT91SAM9RL 163 - #define cpu_is_at91sam9rl() (at91_cpu_identify() == ARCH_ID_AT91SAM9RL64) 136 + #define cpu_is_at91sam9rl() (at91_soc_initdata.type == AT91_SOC_SAM9RL) 164 137 #else 165 138 #define cpu_is_at91sam9rl() (0) 166 139 #endif 167 140 168 141 #ifdef CONFIG_ARCH_AT91SAM9G45 169 - #define cpu_is_at91sam9g45() (at91_cpu_identify() == ARCH_ID_AT91SAM9G45) 170 - #define cpu_is_at91sam9g45es() (at91_cpu_fully_identify() == ARCH_ID_AT91SAM9G45ES) 171 - #define cpu_is_at91sam9m10() (cpu_is_at91sam9g45() && \ 172 - (at91_exid_identify() == ARCH_EXID_AT91SAM9M10)) 173 - #define cpu_is_at91sam9m46() (cpu_is_at91sam9g45() && \ 174 - (at91_exid_identify() == ARCH_EXID_AT91SAM9G46)) 175 - #define cpu_is_at91sam9m11() (cpu_is_at91sam9g45() && \ 176 - (at91_exid_identify() == ARCH_EXID_AT91SAM9M11)) 142 + #define cpu_is_at91sam9g45() (at91_soc_initdata.type == AT91_SOC_SAM9G45) 143 + #define cpu_is_at91sam9g45es() (at91_soc_initdata.subtype == AT91_SOC_SAM9G45ES) 144 + #define cpu_is_at91sam9m10() (at91_soc_initdata.subtype == AT91_SOC_SAM9M10) 145 + #define cpu_is_at91sam9g46() (at91_soc_initdata.subtype == AT91_SOC_SAM9G46) 146 + #define cpu_is_at91sam9m11() (at91_soc_initdata.subtype == AT91_SOC_SAM9M11) 177 147 #else 178 148 #define cpu_is_at91sam9g45() (0) 179 149 #define cpu_is_at91sam9g45es() (0) ··· 180 156 #endif 181 157 182 158 #ifdef CONFIG_ARCH_AT91SAM9X5 183 - #define cpu_is_at91sam9x5() (at91_cpu_identify() == ARCH_ID_AT91SAM9X5) 184 - #define cpu_is_at91sam9g15() (cpu_is_at91sam9x5() && \ 185 - (at91_exid_identify() == ARCH_EXID_AT91SAM9G15)) 186 - #define cpu_is_at91sam9g35() (cpu_is_at91sam9x5() && \ 187 - (at91_exid_identify() == ARCH_EXID_AT91SAM9G35)) 188 - #define cpu_is_at91sam9x35() (cpu_is_at91sam9x5() && \ 189 - (at91_exid_identify() == ARCH_EXID_AT91SAM9X35)) 190 - #define cpu_is_at91sam9g25() (cpu_is_at91sam9x5() && \ 191 - (at91_exid_identify() == ARCH_EXID_AT91SAM9G25)) 192 - #define cpu_is_at91sam9x25() (cpu_is_at91sam9x5() && \ 193 - (at91_exid_identify() == ARCH_EXID_AT91SAM9X25)) 159 + #define cpu_is_at91sam9x5() (at91_soc_initdata.type == AT91_SOC_SAM9X5) 160 + #define cpu_is_at91sam9g15() (at91_soc_initdata.subtype == AT91_SOC_SAM9G15) 161 + #define cpu_is_at91sam9g35() (at91_soc_initdata.subtype == AT91_SOC_SAM9G35) 162 + #define cpu_is_at91sam9x35() (at91_soc_initdata.subtype == AT91_SOC_SAM9X35) 163 + #define cpu_is_at91sam9g25() (at91_soc_initdata.subtype == AT91_SOC_SAM9G25) 164 + #define cpu_is_at91sam9x25() (at91_soc_initdata.subtype == AT91_SOC_SAM9X25) 194 165 #else 195 166 #define cpu_is_at91sam9x5() (0) 196 167 #define cpu_is_at91sam9g15() (0) ··· 196 177 #endif 197 178 198 179 #ifdef CONFIG_ARCH_AT91CAP9 199 - #define cpu_is_at91cap9() (at91_cpu_identify() == ARCH_ID_AT91CAP9) 200 - #define cpu_is_at91cap9_revB() (at91cap9_rev_identify() == ARCH_REVISION_CAP9_B) 201 - #define cpu_is_at91cap9_revC() (at91cap9_rev_identify() == ARCH_REVISION_CAP9_C) 180 + #define cpu_is_at91cap9() (at91_soc_initdata.type == AT91_SOC_CAP9) 181 + #define cpu_is_at91cap9_revB() (at91_soc_initdata.subtype == AT91_SOC_CAP9_REV_B) 182 + #define cpu_is_at91cap9_revC() (at91_soc_initdata.subtype == AT91_SOC_CAP9_REV_C) 202 183 #else 203 184 #define cpu_is_at91cap9() (0) 204 185 #define cpu_is_at91cap9_revB() (0) ··· 211 192 */ 212 193 #define cpu_is_at32ap7000() (0) 213 194 214 - #endif 195 + #endif /* __MACH_CPU_H__ */
+7 -7
arch/arm/mach-at91/include/mach/debug-macro.S
··· 15 15 #include <mach/at91_dbgu.h> 16 16 17 17 .macro addruart, rp, rv 18 - ldr \rp, =(AT91_BASE_SYS + AT91_DBGU) @ System peripherals (phys address) 19 - ldr \rv, =(AT91_VA_BASE_SYS + AT91_DBGU) @ System peripherals (virt address) 18 + ldr \rp, =(AT91_BASE_SYS + AT91_DBGU) @ System peripherals (phys address) 19 + ldr \rv, =(AT91_VA_BASE_SYS + AT91_DBGU) @ System peripherals (virt address) 20 20 .endm 21 21 22 22 .macro senduart,rd,rx 23 - strb \rd, [\rx, #(AT91_DBGU_THR - AT91_DBGU)] @ Write to Transmitter Holding Register 23 + strb \rd, [\rx, #(AT91_DBGU_THR)] @ Write to Transmitter Holding Register 24 24 .endm 25 25 26 26 .macro waituart,rd,rx 27 - 1001: ldr \rd, [\rx, #(AT91_DBGU_SR - AT91_DBGU)] @ Read Status Register 28 - tst \rd, #AT91_DBGU_TXRDY @ DBGU_TXRDY = 1 when ready to transmit 27 + 1001: ldr \rd, [\rx, #(AT91_DBGU_SR)] @ Read Status Register 28 + tst \rd, #AT91_DBGU_TXRDY @ DBGU_TXRDY = 1 when ready to transmit 29 29 beq 1001b 30 30 .endm 31 31 32 32 .macro busyuart,rd,rx 33 - 1001: ldr \rd, [\rx, #(AT91_DBGU_SR - AT91_DBGU)] @ Read Status Register 34 - tst \rd, #AT91_DBGU_TXEMPTY @ DBGU_TXEMPTY = 1 when transmission complete 33 + 1001: ldr \rd, [\rx, #(AT91_DBGU_SR)] @ Read Status Register 34 + tst \rd, #AT91_DBGU_TXEMPTY @ DBGU_TXEMPTY = 1 when transmission complete 35 35 beq 1001b 36 36 .endm 37 37
+14
arch/arm/mach-at91/include/mach/hardware.h
··· 36 36 #error "Unsupported AT91 processor" 37 37 #endif 38 38 39 + #if !defined(CONFIG_ARCH_AT91X40) 40 + /* 41 + * On all at91 except rm9200 and x40 have the System Controller starts 42 + * at address 0xffffc000 and has a size of 16KiB. 43 + * 44 + * On rm9200 it's start at 0xfffe4000 of 111KiB with non reserved data starting 45 + * at 0xfffff000 46 + * 47 + * Removes the individual definitions of AT91_BASE_SYS and 48 + * replaces them with a common version at base 0xfffffc000 and size 16KiB 49 + * and map the same memory space 50 + */ 51 + #define AT91_BASE_SYS 0xffffc000 52 + #endif 39 53 40 54 /* 41 55 * Peripheral identifiers/interrupts.
+10 -1
arch/arm/mach-at91/include/mach/io.h
··· 21 21 #ifndef __ASM_ARCH_IO_H 22 22 #define __ASM_ARCH_IO_H 23 23 24 + #include <mach/hardware.h> 25 + 24 26 #define IO_SPACE_LIMIT 0xFFFFFFFF 25 27 26 28 #define __io(a) __typesafe_io(a) 27 29 #define __mem_pci(a) (a) 28 30 29 - 30 31 #ifndef __ASSEMBLY__ 32 + 33 + #ifndef CONFIG_ARCH_AT91X40 34 + #define __arch_ioremap at91_ioremap 35 + #define __arch_iounmap at91_iounmap 36 + #endif 37 + 38 + void __iomem *at91_ioremap(unsigned long phys, size_t size, unsigned int type); 39 + void at91_iounmap(volatile void __iomem *addr); 31 40 32 41 static inline unsigned int at91_sys_read(unsigned int reg_offset) 33 42 {
+297
arch/arm/mach-at91/setup.c
··· 1 + /* 2 + * Copyright (C) 2007 Atmel Corporation. 3 + * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> 4 + * 5 + * Under GPLv2 6 + */ 7 + 8 + #include <linux/module.h> 9 + #include <linux/io.h> 10 + #include <linux/mm.h> 11 + 12 + #include <asm/mach/map.h> 13 + 14 + #include <mach/hardware.h> 15 + #include <mach/cpu.h> 16 + #include <mach/at91_dbgu.h> 17 + #include <mach/at91_pmc.h> 18 + 19 + #include "soc.h" 20 + #include "generic.h" 21 + 22 + struct at91_init_soc __initdata at91_boot_soc; 23 + 24 + struct at91_socinfo at91_soc_initdata; 25 + EXPORT_SYMBOL(at91_soc_initdata); 26 + 27 + void __init at91rm9200_set_type(int type) 28 + { 29 + if (type == ARCH_REVISON_9200_PQFP) 30 + at91_soc_initdata.subtype = AT91_SOC_RM9200_BGA; 31 + else 32 + at91_soc_initdata.subtype = AT91_SOC_RM9200_PQFP; 33 + } 34 + 35 + void __init at91_init_irq_default(void) 36 + { 37 + at91_init_interrupts(at91_boot_soc.default_irq_priority); 38 + } 39 + 40 + void __init at91_init_interrupts(unsigned int *priority) 41 + { 42 + /* Initialize the AIC interrupt controller */ 43 + at91_aic_init(priority); 44 + 45 + /* Enable GPIO interrupts */ 46 + at91_gpio_irq_setup(); 47 + } 48 + 49 + static struct map_desc sram_desc[2] __initdata; 50 + 51 + void __init at91_init_sram(int bank, unsigned long base, unsigned int length) 52 + { 53 + struct map_desc *desc = &sram_desc[bank]; 54 + 55 + desc->virtual = AT91_IO_VIRT_BASE - length; 56 + if (bank > 0) 57 + desc->virtual -= sram_desc[bank - 1].length; 58 + 59 + desc->pfn = __phys_to_pfn(base); 60 + desc->length = length; 61 + desc->type = MT_DEVICE; 62 + 63 + pr_info("AT91: sram at 0x%lx of 0x%x mapped at 0x%lx\n", 64 + base, length, desc->virtual); 65 + 66 + iotable_init(desc, 1); 67 + } 68 + 69 + static struct map_desc at91_io_desc __initdata = { 70 + .virtual = AT91_VA_BASE_SYS, 71 + .pfn = __phys_to_pfn(AT91_BASE_SYS), 72 + .length = SZ_16K, 73 + .type = MT_DEVICE, 74 + }; 75 + 76 + void __iomem *at91_ioremap(unsigned long p, size_t size, unsigned int type) 77 + { 78 + if (p >= AT91_BASE_SYS && p <= (AT91_BASE_SYS + SZ_16K - 1)) 79 + return (void __iomem *)AT91_IO_P2V(p); 80 + 81 + return __arm_ioremap_caller(p, size, type, __builtin_return_address(0)); 82 + } 83 + EXPORT_SYMBOL(at91_ioremap); 84 + 85 + void at91_iounmap(volatile void __iomem *addr) 86 + { 87 + unsigned long virt = (unsigned long)addr; 88 + 89 + if (virt >= VMALLOC_START && virt < VMALLOC_END) 90 + __iounmap(addr); 91 + } 92 + EXPORT_SYMBOL(at91_iounmap); 93 + 94 + #define AT91_DBGU0 0xfffff200 95 + #define AT91_DBGU1 0xffffee00 96 + 97 + static void __init soc_detect(u32 dbgu_base) 98 + { 99 + u32 cidr, socid; 100 + 101 + cidr = __raw_readl(AT91_IO_P2V(dbgu_base) + AT91_DBGU_CIDR); 102 + socid = cidr & ~AT91_CIDR_VERSION; 103 + 104 + switch (socid) { 105 + case ARCH_ID_AT91CAP9: { 106 + #ifdef CONFIG_AT91_PMC_UNIT 107 + u32 pmc_ver = at91_sys_read(AT91_PMC_VER); 108 + 109 + if (pmc_ver == ARCH_REVISION_CAP9_B) 110 + at91_soc_initdata.subtype = AT91_SOC_CAP9_REV_B; 111 + else if (pmc_ver == ARCH_REVISION_CAP9_C) 112 + at91_soc_initdata.subtype = AT91_SOC_CAP9_REV_C; 113 + #endif 114 + at91_soc_initdata.type = AT91_SOC_CAP9; 115 + at91_boot_soc = at91cap9_soc; 116 + break; 117 + } 118 + 119 + case ARCH_ID_AT91RM9200: 120 + at91_soc_initdata.type = AT91_SOC_RM9200; 121 + at91_boot_soc = at91rm9200_soc; 122 + break; 123 + 124 + case ARCH_ID_AT91SAM9260: 125 + at91_soc_initdata.type = AT91_SOC_SAM9260; 126 + at91_boot_soc = at91sam9260_soc; 127 + break; 128 + 129 + case ARCH_ID_AT91SAM9261: 130 + at91_soc_initdata.type = AT91_SOC_SAM9261; 131 + at91_boot_soc = at91sam9261_soc; 132 + break; 133 + 134 + case ARCH_ID_AT91SAM9263: 135 + at91_soc_initdata.type = AT91_SOC_SAM9263; 136 + at91_boot_soc = at91sam9263_soc; 137 + break; 138 + 139 + case ARCH_ID_AT91SAM9G20: 140 + at91_soc_initdata.type = AT91_SOC_SAM9G20; 141 + at91_boot_soc = at91sam9260_soc; 142 + break; 143 + 144 + case ARCH_ID_AT91SAM9G45: 145 + at91_soc_initdata.type = AT91_SOC_SAM9G45; 146 + if (cidr == ARCH_ID_AT91SAM9G45ES) 147 + at91_soc_initdata.subtype = AT91_SOC_SAM9G45ES; 148 + at91_boot_soc = at91sam9g45_soc; 149 + break; 150 + 151 + case ARCH_ID_AT91SAM9RL64: 152 + at91_soc_initdata.type = AT91_SOC_SAM9RL; 153 + at91_boot_soc = at91sam9rl_soc; 154 + break; 155 + 156 + case ARCH_ID_AT91SAM9X5: 157 + at91_soc_initdata.type = AT91_SOC_SAM9X5; 158 + at91_boot_soc = at91sam9x5_soc; 159 + break; 160 + } 161 + 162 + /* at91sam9g10 */ 163 + if ((cidr & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) { 164 + at91_soc_initdata.type = AT91_SOC_SAM9G10; 165 + at91_boot_soc = at91sam9261_soc; 166 + } 167 + /* at91sam9xe */ 168 + else if ((cidr & AT91_CIDR_ARCH) == ARCH_FAMILY_AT91SAM9XE) { 169 + at91_soc_initdata.type = AT91_SOC_SAM9260; 170 + at91_soc_initdata.subtype = AT91_SOC_SAM9XE; 171 + at91_boot_soc = at91sam9260_soc; 172 + } 173 + 174 + if (!at91_soc_is_detected()) 175 + return; 176 + 177 + at91_soc_initdata.cidr = cidr; 178 + 179 + /* sub version of soc */ 180 + at91_soc_initdata.exid = __raw_readl(AT91_IO_P2V(dbgu_base) + AT91_DBGU_EXID); 181 + 182 + if (at91_soc_initdata.type == AT91_SOC_SAM9G45) { 183 + switch (at91_soc_initdata.exid) { 184 + case ARCH_EXID_AT91SAM9M10: 185 + at91_soc_initdata.subtype = AT91_SOC_SAM9M10; 186 + break; 187 + case ARCH_EXID_AT91SAM9G46: 188 + at91_soc_initdata.subtype = AT91_SOC_SAM9G46; 189 + break; 190 + case ARCH_EXID_AT91SAM9M11: 191 + at91_soc_initdata.subtype = AT91_SOC_SAM9M11; 192 + break; 193 + } 194 + } 195 + 196 + if (at91_soc_initdata.type == AT91_SOC_SAM9X5) { 197 + switch (at91_soc_initdata.exid) { 198 + case ARCH_EXID_AT91SAM9G15: 199 + at91_soc_initdata.subtype = AT91_SOC_SAM9G15; 200 + break; 201 + case ARCH_EXID_AT91SAM9G35: 202 + at91_soc_initdata.subtype = AT91_SOC_SAM9G35; 203 + break; 204 + case ARCH_EXID_AT91SAM9X35: 205 + at91_soc_initdata.subtype = AT91_SOC_SAM9X35; 206 + break; 207 + case ARCH_EXID_AT91SAM9G25: 208 + at91_soc_initdata.subtype = AT91_SOC_SAM9G25; 209 + break; 210 + case ARCH_EXID_AT91SAM9X25: 211 + at91_soc_initdata.subtype = AT91_SOC_SAM9X25; 212 + break; 213 + } 214 + } 215 + } 216 + 217 + static const char *soc_name[] = { 218 + [AT91_SOC_RM9200] = "at91rm9200", 219 + [AT91_SOC_CAP9] = "at91cap9", 220 + [AT91_SOC_SAM9260] = "at91sam9260", 221 + [AT91_SOC_SAM9261] = "at91sam9261", 222 + [AT91_SOC_SAM9263] = "at91sam9263", 223 + [AT91_SOC_SAM9G10] = "at91sam9g10", 224 + [AT91_SOC_SAM9G20] = "at91sam9g20", 225 + [AT91_SOC_SAM9G45] = "at91sam9g45", 226 + [AT91_SOC_SAM9RL] = "at91sam9rl", 227 + [AT91_SOC_SAM9X5] = "at91sam9x5", 228 + [AT91_SOC_NONE] = "Unknown" 229 + }; 230 + 231 + const char *at91_get_soc_type(struct at91_socinfo *c) 232 + { 233 + return soc_name[c->type]; 234 + } 235 + EXPORT_SYMBOL(at91_get_soc_type); 236 + 237 + static const char *soc_subtype_name[] = { 238 + [AT91_SOC_RM9200_BGA] = "at91rm9200 BGA", 239 + [AT91_SOC_RM9200_PQFP] = "at91rm9200 PQFP", 240 + [AT91_SOC_CAP9_REV_B] = "at91cap9 revB", 241 + [AT91_SOC_CAP9_REV_C] = "at91cap9 revC", 242 + [AT91_SOC_SAM9XE] = "at91sam9xe", 243 + [AT91_SOC_SAM9G45ES] = "at91sam9g45es", 244 + [AT91_SOC_SAM9M10] = "at91sam9m10", 245 + [AT91_SOC_SAM9G46] = "at91sam9g46", 246 + [AT91_SOC_SAM9M11] = "at91sam9m11", 247 + [AT91_SOC_SAM9G15] = "at91sam9g15", 248 + [AT91_SOC_SAM9G35] = "at91sam9g35", 249 + [AT91_SOC_SAM9X35] = "at91sam9x35", 250 + [AT91_SOC_SAM9G25] = "at91sam9g25", 251 + [AT91_SOC_SAM9X25] = "at91sam9x25", 252 + [AT91_SOC_SUBTYPE_NONE] = "Unknown" 253 + }; 254 + 255 + const char *at91_get_soc_subtype(struct at91_socinfo *c) 256 + { 257 + return soc_subtype_name[c->subtype]; 258 + } 259 + EXPORT_SYMBOL(at91_get_soc_subtype); 260 + 261 + void __init at91_map_io(void) 262 + { 263 + /* Map peripherals */ 264 + iotable_init(&at91_io_desc, 1); 265 + 266 + at91_soc_initdata.type = AT91_SOC_NONE; 267 + at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE; 268 + 269 + soc_detect(AT91_DBGU0); 270 + if (!at91_soc_is_detected()) 271 + soc_detect(AT91_DBGU1); 272 + 273 + if (!at91_soc_is_detected()) 274 + panic("AT91: Impossible to detect the SOC type"); 275 + 276 + pr_info("AT91: Detected soc type: %s\n", 277 + at91_get_soc_type(&at91_soc_initdata)); 278 + pr_info("AT91: Detected soc subtype: %s\n", 279 + at91_get_soc_subtype(&at91_soc_initdata)); 280 + 281 + if (!at91_soc_is_enabled()) 282 + panic("AT91: Soc not enabled"); 283 + 284 + if (at91_boot_soc.map_io) 285 + at91_boot_soc.map_io(); 286 + } 287 + 288 + void __init at91_initialize(unsigned long main_clock) 289 + { 290 + /* Init clock subsystem */ 291 + at91_clock_init(main_clock); 292 + 293 + /* Register the processor-specific clocks */ 294 + at91_boot_soc.register_clocks(); 295 + 296 + at91_boot_soc.init(); 297 + }
+59
arch/arm/mach-at91/soc.h
··· 1 + /* 2 + * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> 3 + * 4 + * Under GPLv2 5 + */ 6 + 7 + struct at91_init_soc { 8 + unsigned int *default_irq_priority; 9 + void (*map_io)(void); 10 + void (*register_clocks)(void); 11 + void (*init)(void); 12 + }; 13 + 14 + extern struct at91_init_soc at91_boot_soc; 15 + extern struct at91_init_soc at91cap9_soc; 16 + extern struct at91_init_soc at91rm9200_soc; 17 + extern struct at91_init_soc at91sam9260_soc; 18 + extern struct at91_init_soc at91sam9261_soc; 19 + extern struct at91_init_soc at91sam9263_soc; 20 + extern struct at91_init_soc at91sam9g45_soc; 21 + extern struct at91_init_soc at91sam9rl_soc; 22 + extern struct at91_init_soc at91sam9x5_soc; 23 + 24 + static inline int at91_soc_is_enabled(void) 25 + { 26 + return at91_boot_soc.init != NULL; 27 + } 28 + 29 + #if !defined(CONFIG_ARCH_AT91CAP9) 30 + #define at91cap9_soc at91_boot_soc 31 + #endif 32 + 33 + #if !defined(CONFIG_ARCH_AT91RM9200) 34 + #define at91rm9200_soc at91_boot_soc 35 + #endif 36 + 37 + #if !(defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9G20)) 38 + #define at91sam9260_soc at91_boot_soc 39 + #endif 40 + 41 + #if !(defined(CONFIG_ARCH_AT91SAM9261) || defined(CONFIG_ARCH_AT91SAM9G10)) 42 + #define at91sam9261_soc at91_boot_soc 43 + #endif 44 + 45 + #if !defined(CONFIG_ARCH_AT91SAM9263) 46 + #define at91sam9263_soc at91_boot_soc 47 + #endif 48 + 49 + #if !defined(CONFIG_ARCH_AT91SAM9G45) 50 + #define at91sam9g45_soc at91_boot_soc 51 + #endif 52 + 53 + #if !defined(CONFIG_ARCH_AT91SAM9RL) 54 + #define at91sam9rl_soc at91_boot_soc 55 + #endif 56 + 57 + #if !defined(CONFIG_ARCH_AT91SAM9X5) 58 + #define at91sam9x5_soc at91_boot_soc 59 + #endif