diff options
Diffstat (limited to 'arch')
40 files changed, 424 insertions, 120 deletions
diff --git a/arch/arm/common/uengine.c b/arch/arm/common/uengine.c index 95c8508c29b7..117cab30bd36 100644 --- a/arch/arm/common/uengine.c +++ b/arch/arm/common/uengine.c | |||
@@ -374,8 +374,8 @@ static int set_initial_registers(int uengine, struct ixp2000_uengine_code *c) | |||
374 | u8 *ucode; | 374 | u8 *ucode; |
375 | int i; | 375 | int i; |
376 | 376 | ||
377 | gpr_a = kmalloc(128 * sizeof(u32), GFP_KERNEL); | 377 | gpr_a = kzalloc(128 * sizeof(u32), GFP_KERNEL); |
378 | gpr_b = kmalloc(128 * sizeof(u32), GFP_KERNEL); | 378 | gpr_b = kzalloc(128 * sizeof(u32), GFP_KERNEL); |
379 | ucode = kmalloc(513 * 5, GFP_KERNEL); | 379 | ucode = kmalloc(513 * 5, GFP_KERNEL); |
380 | if (gpr_a == NULL || gpr_b == NULL || ucode == NULL) { | 380 | if (gpr_a == NULL || gpr_b == NULL || ucode == NULL) { |
381 | kfree(ucode); | 381 | kfree(ucode); |
@@ -388,8 +388,6 @@ static int set_initial_registers(int uengine, struct ixp2000_uengine_code *c) | |||
388 | if (c->uengine_parameters & IXP2000_UENGINE_4_CONTEXTS) | 388 | if (c->uengine_parameters & IXP2000_UENGINE_4_CONTEXTS) |
389 | per_ctx_regs = 32; | 389 | per_ctx_regs = 32; |
390 | 390 | ||
391 | memset(gpr_a, 0, sizeof(gpr_a)); | ||
392 | memset(gpr_b, 0, sizeof(gpr_b)); | ||
393 | for (i = 0; i < 256; i++) { | 391 | for (i = 0; i < 256; i++) { |
394 | struct ixp2000_reg_value *r = c->initial_reg_values + i; | 392 | struct ixp2000_reg_value *r = c->initial_reg_values + i; |
395 | u32 *bank; | 393 | u32 *bank; |
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index d645897652c2..29dec080a604 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S | |||
@@ -339,16 +339,6 @@ __pabt_svc: | |||
339 | str r1, [sp] @ save the "real" r0 copied | 339 | str r1, [sp] @ save the "real" r0 copied |
340 | @ from the exception stack | 340 | @ from the exception stack |
341 | 341 | ||
342 | #if __LINUX_ARM_ARCH__ < 6 && !defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG) | ||
343 | #ifndef CONFIG_MMU | ||
344 | #warning "NPTL on non MMU needs fixing" | ||
345 | #else | ||
346 | @ make sure our user space atomic helper is aborted | ||
347 | cmp r2, #TASK_SIZE | ||
348 | bichs r3, r3, #PSR_Z_BIT | ||
349 | #endif | ||
350 | #endif | ||
351 | |||
352 | @ | 342 | @ |
353 | @ We are now ready to fill in the remaining blanks on the stack: | 343 | @ We are now ready to fill in the remaining blanks on the stack: |
354 | @ | 344 | @ |
@@ -372,9 +362,25 @@ __pabt_svc: | |||
372 | zero_fp | 362 | zero_fp |
373 | .endm | 363 | .endm |
374 | 364 | ||
365 | .macro kuser_cmpxchg_check | ||
366 | #if __LINUX_ARM_ARCH__ < 6 && !defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG) | ||
367 | #ifndef CONFIG_MMU | ||
368 | #warning "NPTL on non MMU needs fixing" | ||
369 | #else | ||
370 | @ Make sure our user space atomic helper is restarted | ||
371 | @ if it was interrupted in a critical region. Here we | ||
372 | @ perform a quick test inline since it should be false | ||
373 | @ 99.9999% of the time. The rest is done out of line. | ||
374 | cmp r2, #TASK_SIZE | ||
375 | blhs kuser_cmpxchg_fixup | ||
376 | #endif | ||
377 | #endif | ||
378 | .endm | ||
379 | |||
375 | .align 5 | 380 | .align 5 |
376 | __dabt_usr: | 381 | __dabt_usr: |
377 | usr_entry | 382 | usr_entry |
383 | kuser_cmpxchg_check | ||
378 | 384 | ||
379 | @ | 385 | @ |
380 | @ Call the processor-specific abort handler: | 386 | @ Call the processor-specific abort handler: |
@@ -404,6 +410,7 @@ __dabt_usr: | |||
404 | .align 5 | 410 | .align 5 |
405 | __irq_usr: | 411 | __irq_usr: |
406 | usr_entry | 412 | usr_entry |
413 | kuser_cmpxchg_check | ||
407 | 414 | ||
408 | #ifdef CONFIG_TRACE_IRQFLAGS | 415 | #ifdef CONFIG_TRACE_IRQFLAGS |
409 | bl trace_hardirqs_off | 416 | bl trace_hardirqs_off |
@@ -446,9 +453,9 @@ __und_usr: | |||
446 | @ | 453 | @ |
447 | @ r0 - instruction | 454 | @ r0 - instruction |
448 | @ | 455 | @ |
449 | 1: ldrt r0, [r4] | ||
450 | adr r9, ret_from_exception | 456 | adr r9, ret_from_exception |
451 | adr lr, __und_usr_unknown | 457 | adr lr, __und_usr_unknown |
458 | 1: ldrt r0, [r4] | ||
452 | @ | 459 | @ |
453 | @ fallthrough to call_fpe | 460 | @ fallthrough to call_fpe |
454 | @ | 461 | @ |
@@ -669,7 +676,7 @@ __kuser_helper_start: | |||
669 | * | 676 | * |
670 | * Clobbered: | 677 | * Clobbered: |
671 | * | 678 | * |
672 | * the Z flag might be lost | 679 | * none |
673 | * | 680 | * |
674 | * Definition and user space usage example: | 681 | * Definition and user space usage example: |
675 | * | 682 | * |
@@ -730,9 +737,6 @@ __kuser_memory_barrier: @ 0xffff0fa0 | |||
730 | * | 737 | * |
731 | * - This routine already includes memory barriers as needed. | 738 | * - This routine already includes memory barriers as needed. |
732 | * | 739 | * |
733 | * - A failure might be transient, i.e. it is possible, although unlikely, | ||
734 | * that "failure" be returned even if *ptr == oldval. | ||
735 | * | ||
736 | * For example, a user space atomic_add implementation could look like this: | 740 | * For example, a user space atomic_add implementation could look like this: |
737 | * | 741 | * |
738 | * #define atomic_add(ptr, val) \ | 742 | * #define atomic_add(ptr, val) \ |
@@ -769,46 +773,62 @@ __kuser_cmpxchg: @ 0xffff0fc0 | |||
769 | 773 | ||
770 | #elif __LINUX_ARM_ARCH__ < 6 | 774 | #elif __LINUX_ARM_ARCH__ < 6 |
771 | 775 | ||
776 | #ifdef CONFIG_MMU | ||
777 | |||
772 | /* | 778 | /* |
773 | * Theory of operation: | 779 | * The only thing that can break atomicity in this cmpxchg |
774 | * | 780 | * implementation is either an IRQ or a data abort exception |
775 | * We set the Z flag before loading oldval. If ever an exception | 781 | * causing another process/thread to be scheduled in the middle |
776 | * occurs we can not be sure the loaded value will still be the same | 782 | * of the critical sequence. To prevent this, code is added to |
777 | * when the exception returns, therefore the user exception handler | 783 | * the IRQ and data abort exception handlers to set the pc back |
778 | * will clear the Z flag whenever the interrupted user code was | 784 | * to the beginning of the critical section if it is found to be |
779 | * actually from the kernel address space (see the usr_entry macro). | 785 | * within that critical section (see kuser_cmpxchg_fixup). |
780 | * | ||
781 | * The post-increment on the str is used to prevent a race with an | ||
782 | * exception happening just after the str instruction which would | ||
783 | * clear the Z flag although the exchange was done. | ||
784 | */ | 786 | */ |
785 | #ifdef CONFIG_MMU | 787 | 1: ldr r3, [r2] @ load current val |
786 | teq ip, ip @ set Z flag | 788 | subs r3, r3, r0 @ compare with oldval |
787 | ldr ip, [r2] @ load current val | 789 | 2: streq r1, [r2] @ store newval if eq |
788 | add r3, r2, #1 @ prepare store ptr | 790 | rsbs r0, r3, #0 @ set return val and C flag |
789 | teqeq ip, r0 @ compare with oldval if still allowed | 791 | usr_ret lr |
790 | streq r1, [r3, #-1]! @ store newval if still allowed | 792 | |
791 | subs r0, r2, r3 @ if r2 == r3 the str occured | 793 | .text |
794 | kuser_cmpxchg_fixup: | ||
795 | @ Called from kuser_cmpxchg_check macro. | ||
796 | @ r2 = address of interrupted insn (must be preserved). | ||
797 | @ sp = saved regs. r7 and r8 are clobbered. | ||
798 | @ 1b = first critical insn, 2b = last critical insn. | ||
799 | @ If r2 >= 1b and r2 <= 2b then saved pc_usr is set to 1b. | ||
800 | mov r7, #0xffff0fff | ||
801 | sub r7, r7, #(0xffff0fff - (0xffff0fc0 + (1b - __kuser_cmpxchg))) | ||
802 | subs r8, r2, r7 | ||
803 | rsbcss r8, r8, #(2b - 1b) | ||
804 | strcs r7, [sp, #S_PC] | ||
805 | mov pc, lr | ||
806 | .previous | ||
807 | |||
792 | #else | 808 | #else |
793 | #warning "NPTL on non MMU needs fixing" | 809 | #warning "NPTL on non MMU needs fixing" |
794 | mov r0, #-1 | 810 | mov r0, #-1 |
795 | adds r0, r0, #0 | 811 | adds r0, r0, #0 |
796 | #endif | ||
797 | usr_ret lr | 812 | usr_ret lr |
813 | #endif | ||
798 | 814 | ||
799 | #else | 815 | #else |
800 | 816 | ||
801 | #ifdef CONFIG_SMP | 817 | #ifdef CONFIG_SMP |
802 | mcr p15, 0, r0, c7, c10, 5 @ dmb | 818 | mcr p15, 0, r0, c7, c10, 5 @ dmb |
803 | #endif | 819 | #endif |
804 | ldrex r3, [r2] | 820 | 1: ldrex r3, [r2] |
805 | subs r3, r3, r0 | 821 | subs r3, r3, r0 |
806 | strexeq r3, r1, [r2] | 822 | strexeq r3, r1, [r2] |
823 | teqeq r3, #1 | ||
824 | beq 1b | ||
807 | rsbs r0, r3, #0 | 825 | rsbs r0, r3, #0 |
826 | /* beware -- each __kuser slot must be 8 instructions max */ | ||
808 | #ifdef CONFIG_SMP | 827 | #ifdef CONFIG_SMP |
809 | mcr p15, 0, r0, c7, c10, 5 @ dmb | 828 | b __kuser_memory_barrier |
810 | #endif | 829 | #else |
811 | usr_ret lr | 830 | usr_ret lr |
831 | #endif | ||
812 | 832 | ||
813 | #endif | 833 | #endif |
814 | 834 | ||
@@ -829,7 +849,7 @@ __kuser_cmpxchg: @ 0xffff0fc0 | |||
829 | * | 849 | * |
830 | * Clobbered: | 850 | * Clobbered: |
831 | * | 851 | * |
832 | * the Z flag might be lost | 852 | * none |
833 | * | 853 | * |
834 | * Definition and user space usage example: | 854 | * Definition and user space usage example: |
835 | * | 855 | * |
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index 4764bd9ccee8..c34db4e868fa 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c | |||
@@ -327,7 +327,7 @@ asmlinkage void __exception do_undefinstr(struct pt_regs *regs) | |||
327 | if ((instr & hook->instr_mask) == hook->instr_val && | 327 | if ((instr & hook->instr_mask) == hook->instr_val && |
328 | (regs->ARM_cpsr & hook->cpsr_mask) == hook->cpsr_val) { | 328 | (regs->ARM_cpsr & hook->cpsr_mask) == hook->cpsr_val) { |
329 | if (hook->fn(regs, instr) == 0) { | 329 | if (hook->fn(regs, instr) == 0) { |
330 | spin_unlock_irq(&undef_lock); | 330 | spin_unlock_irqrestore(&undef_lock, flags); |
331 | return; | 331 | return; |
332 | } | 332 | } |
333 | } | 333 | } |
@@ -509,7 +509,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs) | |||
509 | * existence. Don't ever use this from user code. | 509 | * existence. Don't ever use this from user code. |
510 | */ | 510 | */ |
511 | case 0xfff0: | 511 | case 0xfff0: |
512 | { | 512 | for (;;) { |
513 | extern void do_DataAbort(unsigned long addr, unsigned int fsr, | 513 | extern void do_DataAbort(unsigned long addr, unsigned int fsr, |
514 | struct pt_regs *regs); | 514 | struct pt_regs *regs); |
515 | unsigned long val; | 515 | unsigned long val; |
@@ -545,7 +545,6 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs) | |||
545 | up_read(&mm->mmap_sem); | 545 | up_read(&mm->mmap_sem); |
546 | /* simulate a write access fault */ | 546 | /* simulate a write access fault */ |
547 | do_DataAbort(addr, 15 + (1 << 11), regs); | 547 | do_DataAbort(addr, 15 + (1 << 11), regs); |
548 | return -1; | ||
549 | } | 548 | } |
550 | #endif | 549 | #endif |
551 | 550 | ||
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c index 0417c165d50d..9296833f91cc 100644 --- a/arch/arm/mach-at91/at91rm9200_devices.c +++ b/arch/arm/mach-at91/at91rm9200_devices.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <asm/mach/map.h> | 14 | #include <asm/mach/map.h> |
15 | 15 | ||
16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
17 | #include <linux/i2c-gpio.h> | ||
17 | 18 | ||
18 | #include <asm/arch/board.h> | 19 | #include <asm/arch/board.h> |
19 | #include <asm/arch/gpio.h> | 20 | #include <asm/arch/gpio.h> |
@@ -435,7 +436,40 @@ void __init at91_add_device_nand(struct at91_nand_data *data) {} | |||
435 | * TWI (i2c) | 436 | * TWI (i2c) |
436 | * -------------------------------------------------------------------- */ | 437 | * -------------------------------------------------------------------- */ |
437 | 438 | ||
438 | #if defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE) | 439 | /* |
440 | * Prefer the GPIO code since the TWI controller isn't robust | ||
441 | * (gets overruns and underruns under load) and can only issue | ||
442 | * repeated STARTs in one scenario (the driver doesn't yet handle them). | ||
443 | */ | ||
444 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) | ||
445 | |||
446 | static struct i2c_gpio_platform_data pdata = { | ||
447 | .sda_pin = AT91_PIN_PA25, | ||
448 | .sda_is_open_drain = 1, | ||
449 | .scl_pin = AT91_PIN_PA26, | ||
450 | .scl_is_open_drain = 1, | ||
451 | .udelay = 2, /* ~100 kHz */ | ||
452 | }; | ||
453 | |||
454 | static struct platform_device at91rm9200_twi_device = { | ||
455 | .name = "i2c-gpio", | ||
456 | .id = -1, | ||
457 | .dev.platform_data = &pdata, | ||
458 | }; | ||
459 | |||
460 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) | ||
461 | { | ||
462 | at91_set_GPIO_periph(AT91_PIN_PA25, 1); /* TWD (SDA) */ | ||
463 | at91_set_multi_drive(AT91_PIN_PA25, 1); | ||
464 | |||
465 | at91_set_GPIO_periph(AT91_PIN_PA26, 1); /* TWCK (SCL) */ | ||
466 | at91_set_multi_drive(AT91_PIN_PA26, 1); | ||
467 | |||
468 | i2c_register_board_info(0, devices, nr_devices); | ||
469 | platform_device_register(&at91rm9200_twi_device); | ||
470 | } | ||
471 | |||
472 | #elif defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE) | ||
439 | 473 | ||
440 | static struct resource twi_resources[] = { | 474 | static struct resource twi_resources[] = { |
441 | [0] = { | 475 | [0] = { |
@@ -457,7 +491,7 @@ static struct platform_device at91rm9200_twi_device = { | |||
457 | .num_resources = ARRAY_SIZE(twi_resources), | 491 | .num_resources = ARRAY_SIZE(twi_resources), |
458 | }; | 492 | }; |
459 | 493 | ||
460 | void __init at91_add_device_i2c(void) | 494 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) |
461 | { | 495 | { |
462 | /* pins used for TWI interface */ | 496 | /* pins used for TWI interface */ |
463 | at91_set_A_periph(AT91_PIN_PA25, 0); /* TWD */ | 497 | at91_set_A_periph(AT91_PIN_PA25, 0); /* TWD */ |
@@ -466,10 +500,11 @@ void __init at91_add_device_i2c(void) | |||
466 | at91_set_A_periph(AT91_PIN_PA26, 0); /* TWCK */ | 500 | at91_set_A_periph(AT91_PIN_PA26, 0); /* TWCK */ |
467 | at91_set_multi_drive(AT91_PIN_PA26, 1); | 501 | at91_set_multi_drive(AT91_PIN_PA26, 1); |
468 | 502 | ||
503 | i2c_register_board_info(0, devices, nr_devices); | ||
469 | platform_device_register(&at91rm9200_twi_device); | 504 | platform_device_register(&at91rm9200_twi_device); |
470 | } | 505 | } |
471 | #else | 506 | #else |
472 | void __init at91_add_device_i2c(void) {} | 507 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) {} |
473 | #endif | 508 | #endif |
474 | 509 | ||
475 | 510 | ||
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c index ffd3154c1e54..3091bf47d8c9 100644 --- a/arch/arm/mach-at91/at91sam9260_devices.c +++ b/arch/arm/mach-at91/at91sam9260_devices.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <asm/mach/map.h> | 13 | #include <asm/mach/map.h> |
14 | 14 | ||
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
16 | #include <linux/i2c-gpio.h> | ||
16 | 17 | ||
17 | #include <asm/arch/board.h> | 18 | #include <asm/arch/board.h> |
18 | #include <asm/arch/gpio.h> | 19 | #include <asm/arch/gpio.h> |
@@ -352,7 +353,41 @@ void __init at91_add_device_nand(struct at91_nand_data *data) {} | |||
352 | * TWI (i2c) | 353 | * TWI (i2c) |
353 | * -------------------------------------------------------------------- */ | 354 | * -------------------------------------------------------------------- */ |
354 | 355 | ||
355 | #if defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE) | 356 | /* |
357 | * Prefer the GPIO code since the TWI controller isn't robust | ||
358 | * (gets overruns and underruns under load) and can only issue | ||
359 | * repeated STARTs in one scenario (the driver doesn't yet handle them). | ||
360 | */ | ||
361 | |||
362 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) | ||
363 | |||
364 | static struct i2c_gpio_platform_data pdata = { | ||
365 | .sda_pin = AT91_PIN_PA23, | ||
366 | .sda_is_open_drain = 1, | ||
367 | .scl_pin = AT91_PIN_PA24, | ||
368 | .scl_is_open_drain = 1, | ||
369 | .udelay = 2, /* ~100 kHz */ | ||
370 | }; | ||
371 | |||
372 | static struct platform_device at91sam9260_twi_device = { | ||
373 | .name = "i2c-gpio", | ||
374 | .id = -1, | ||
375 | .dev.platform_data = &pdata, | ||
376 | }; | ||
377 | |||
378 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) | ||
379 | { | ||
380 | at91_set_GPIO_periph(AT91_PIN_PA23, 1); /* TWD (SDA) */ | ||
381 | at91_set_multi_drive(AT91_PIN_PA23, 1); | ||
382 | |||
383 | at91_set_GPIO_periph(AT91_PIN_PA24, 1); /* TWCK (SCL) */ | ||
384 | at91_set_multi_drive(AT91_PIN_PA24, 1); | ||
385 | |||
386 | i2c_register_board_info(0, devices, nr_devices); | ||
387 | platform_device_register(&at91sam9260_twi_device); | ||
388 | } | ||
389 | |||
390 | #elif defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE) | ||
356 | 391 | ||
357 | static struct resource twi_resources[] = { | 392 | static struct resource twi_resources[] = { |
358 | [0] = { | 393 | [0] = { |
@@ -374,7 +409,7 @@ static struct platform_device at91sam9260_twi_device = { | |||
374 | .num_resources = ARRAY_SIZE(twi_resources), | 409 | .num_resources = ARRAY_SIZE(twi_resources), |
375 | }; | 410 | }; |
376 | 411 | ||
377 | void __init at91_add_device_i2c(void) | 412 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) |
378 | { | 413 | { |
379 | /* pins used for TWI interface */ | 414 | /* pins used for TWI interface */ |
380 | at91_set_A_periph(AT91_PIN_PA23, 0); /* TWD */ | 415 | at91_set_A_periph(AT91_PIN_PA23, 0); /* TWD */ |
@@ -383,10 +418,11 @@ void __init at91_add_device_i2c(void) | |||
383 | at91_set_A_periph(AT91_PIN_PA24, 0); /* TWCK */ | 418 | at91_set_A_periph(AT91_PIN_PA24, 0); /* TWCK */ |
384 | at91_set_multi_drive(AT91_PIN_PA24, 1); | 419 | at91_set_multi_drive(AT91_PIN_PA24, 1); |
385 | 420 | ||
421 | i2c_register_board_info(0, devices, nr_devices); | ||
386 | platform_device_register(&at91sam9260_twi_device); | 422 | platform_device_register(&at91sam9260_twi_device); |
387 | } | 423 | } |
388 | #else | 424 | #else |
389 | void __init at91_add_device_i2c(void) {} | 425 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) {} |
390 | #endif | 426 | #endif |
391 | 427 | ||
392 | 428 | ||
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c index 3576595b4941..64979a9023c2 100644 --- a/arch/arm/mach-at91/at91sam9261_devices.c +++ b/arch/arm/mach-at91/at91sam9261_devices.c | |||
@@ -14,7 +14,9 @@ | |||
14 | #include <asm/mach/map.h> | 14 | #include <asm/mach/map.h> |
15 | 15 | ||
16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
17 | #include <linux/i2c-gpio.h> | ||
17 | 18 | ||
19 | #include <linux/fb.h> | ||
18 | #include <video/atmel_lcdc.h> | 20 | #include <video/atmel_lcdc.h> |
19 | 21 | ||
20 | #include <asm/arch/board.h> | 22 | #include <asm/arch/board.h> |
@@ -275,7 +277,40 @@ void __init at91_add_device_nand(struct at91_nand_data *data) {} | |||
275 | * TWI (i2c) | 277 | * TWI (i2c) |
276 | * -------------------------------------------------------------------- */ | 278 | * -------------------------------------------------------------------- */ |
277 | 279 | ||
278 | #if defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE) | 280 | /* |
281 | * Prefer the GPIO code since the TWI controller isn't robust | ||
282 | * (gets overruns and underruns under load) and can only issue | ||
283 | * repeated STARTs in one scenario (the driver doesn't yet handle them). | ||
284 | */ | ||
285 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) | ||
286 | |||
287 | static struct i2c_gpio_platform_data pdata = { | ||
288 | .sda_pin = AT91_PIN_PA7, | ||
289 | .sda_is_open_drain = 1, | ||
290 | .scl_pin = AT91_PIN_PA8, | ||
291 | .scl_is_open_drain = 1, | ||
292 | .udelay = 2, /* ~100 kHz */ | ||
293 | }; | ||
294 | |||
295 | static struct platform_device at91sam9261_twi_device = { | ||
296 | .name = "i2c-gpio", | ||
297 | .id = -1, | ||
298 | .dev.platform_data = &pdata, | ||
299 | }; | ||
300 | |||
301 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) | ||
302 | { | ||
303 | at91_set_GPIO_periph(AT91_PIN_PA7, 1); /* TWD (SDA) */ | ||
304 | at91_set_multi_drive(AT91_PIN_PA7, 1); | ||
305 | |||
306 | at91_set_GPIO_periph(AT91_PIN_PA8, 1); /* TWCK (SCL) */ | ||
307 | at91_set_multi_drive(AT91_PIN_PA8, 1); | ||
308 | |||
309 | i2c_register_board_info(0, devices, nr_devices); | ||
310 | platform_device_register(&at91sam9261_twi_device); | ||
311 | } | ||
312 | |||
313 | #elif defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE) | ||
279 | 314 | ||
280 | static struct resource twi_resources[] = { | 315 | static struct resource twi_resources[] = { |
281 | [0] = { | 316 | [0] = { |
@@ -297,7 +332,7 @@ static struct platform_device at91sam9261_twi_device = { | |||
297 | .num_resources = ARRAY_SIZE(twi_resources), | 332 | .num_resources = ARRAY_SIZE(twi_resources), |
298 | }; | 333 | }; |
299 | 334 | ||
300 | void __init at91_add_device_i2c(void) | 335 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) |
301 | { | 336 | { |
302 | /* pins used for TWI interface */ | 337 | /* pins used for TWI interface */ |
303 | at91_set_A_periph(AT91_PIN_PA7, 0); /* TWD */ | 338 | at91_set_A_periph(AT91_PIN_PA7, 0); /* TWD */ |
@@ -306,10 +341,11 @@ void __init at91_add_device_i2c(void) | |||
306 | at91_set_A_periph(AT91_PIN_PA8, 0); /* TWCK */ | 341 | at91_set_A_periph(AT91_PIN_PA8, 0); /* TWCK */ |
307 | at91_set_multi_drive(AT91_PIN_PA8, 1); | 342 | at91_set_multi_drive(AT91_PIN_PA8, 1); |
308 | 343 | ||
344 | i2c_register_board_info(0, devices, nr_devices); | ||
309 | platform_device_register(&at91sam9261_twi_device); | 345 | platform_device_register(&at91sam9261_twi_device); |
310 | } | 346 | } |
311 | #else | 347 | #else |
312 | void __init at91_add_device_i2c(void) {} | 348 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) {} |
313 | #endif | 349 | #endif |
314 | 350 | ||
315 | 351 | ||
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c index f924bd5017de..ac329a98e959 100644 --- a/arch/arm/mach-at91/at91sam9263_devices.c +++ b/arch/arm/mach-at91/at91sam9263_devices.c | |||
@@ -13,7 +13,9 @@ | |||
13 | #include <asm/mach/map.h> | 13 | #include <asm/mach/map.h> |
14 | 14 | ||
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
16 | #include <linux/i2c-gpio.h> | ||
16 | 17 | ||
18 | #include <linux/fb.h> | ||
17 | #include <video/atmel_lcdc.h> | 19 | #include <video/atmel_lcdc.h> |
18 | 20 | ||
19 | #include <asm/arch/board.h> | 21 | #include <asm/arch/board.h> |
@@ -421,7 +423,40 @@ void __init at91_add_device_nand(struct at91_nand_data *data) {} | |||
421 | * TWI (i2c) | 423 | * TWI (i2c) |
422 | * -------------------------------------------------------------------- */ | 424 | * -------------------------------------------------------------------- */ |
423 | 425 | ||
424 | #if defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE) | 426 | /* |
427 | * Prefer the GPIO code since the TWI controller isn't robust | ||
428 | * (gets overruns and underruns under load) and can only issue | ||
429 | * repeated STARTs in one scenario (the driver doesn't yet handle them). | ||
430 | */ | ||
431 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) | ||
432 | |||
433 | static struct i2c_gpio_platform_data pdata = { | ||
434 | .sda_pin = AT91_PIN_PB4, | ||
435 | .sda_is_open_drain = 1, | ||
436 | .scl_pin = AT91_PIN_PB5, | ||
437 | .scl_is_open_drain = 1, | ||
438 | .udelay = 2, /* ~100 kHz */ | ||
439 | }; | ||
440 | |||
441 | static struct platform_device at91sam9263_twi_device = { | ||
442 | .name = "i2c-gpio", | ||
443 | .id = -1, | ||
444 | .dev.platform_data = &pdata, | ||
445 | }; | ||
446 | |||
447 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) | ||
448 | { | ||
449 | at91_set_GPIO_periph(AT91_PIN_PB4, 1); /* TWD (SDA) */ | ||
450 | at91_set_multi_drive(AT91_PIN_PB4, 1); | ||
451 | |||
452 | at91_set_GPIO_periph(AT91_PIN_PB5, 1); /* TWCK (SCL) */ | ||
453 | at91_set_multi_drive(AT91_PIN_PB5, 1); | ||
454 | |||
455 | i2c_register_board_info(0, devices, nr_devices); | ||
456 | platform_device_register(&at91sam9263_twi_device); | ||
457 | } | ||
458 | |||
459 | #elif defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE) | ||
425 | 460 | ||
426 | static struct resource twi_resources[] = { | 461 | static struct resource twi_resources[] = { |
427 | [0] = { | 462 | [0] = { |
@@ -443,7 +478,7 @@ static struct platform_device at91sam9263_twi_device = { | |||
443 | .num_resources = ARRAY_SIZE(twi_resources), | 478 | .num_resources = ARRAY_SIZE(twi_resources), |
444 | }; | 479 | }; |
445 | 480 | ||
446 | void __init at91_add_device_i2c(void) | 481 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) |
447 | { | 482 | { |
448 | /* pins used for TWI interface */ | 483 | /* pins used for TWI interface */ |
449 | at91_set_A_periph(AT91_PIN_PB4, 0); /* TWD */ | 484 | at91_set_A_periph(AT91_PIN_PB4, 0); /* TWD */ |
@@ -452,10 +487,11 @@ void __init at91_add_device_i2c(void) | |||
452 | at91_set_A_periph(AT91_PIN_PB5, 0); /* TWCK */ | 487 | at91_set_A_periph(AT91_PIN_PB5, 0); /* TWCK */ |
453 | at91_set_multi_drive(AT91_PIN_PB5, 1); | 488 | at91_set_multi_drive(AT91_PIN_PB5, 1); |
454 | 489 | ||
490 | i2c_register_board_info(0, devices, nr_devices); | ||
455 | platform_device_register(&at91sam9263_twi_device); | 491 | platform_device_register(&at91sam9263_twi_device); |
456 | } | 492 | } |
457 | #else | 493 | #else |
458 | void __init at91_add_device_i2c(void) {} | 494 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) {} |
459 | #endif | 495 | #endif |
460 | 496 | ||
461 | 497 | ||
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c index cd7532bcd4e5..2bd60a3dc623 100644 --- a/arch/arm/mach-at91/at91sam9rl_devices.c +++ b/arch/arm/mach-at91/at91sam9rl_devices.c | |||
@@ -10,8 +10,9 @@ | |||
10 | #include <asm/mach/map.h> | 10 | #include <asm/mach/map.h> |
11 | 11 | ||
12 | #include <linux/platform_device.h> | 12 | #include <linux/platform_device.h> |
13 | #include <linux/fb.h> | 13 | #include <linux/i2c-gpio.h> |
14 | 14 | ||
15 | #include <linux/fb.h> | ||
15 | #include <video/atmel_lcdc.h> | 16 | #include <video/atmel_lcdc.h> |
16 | 17 | ||
17 | #include <asm/arch/board.h> | 18 | #include <asm/arch/board.h> |
@@ -169,7 +170,40 @@ void __init at91_add_device_nand(struct at91_nand_data *data) {} | |||
169 | * TWI (i2c) | 170 | * TWI (i2c) |
170 | * -------------------------------------------------------------------- */ | 171 | * -------------------------------------------------------------------- */ |
171 | 172 | ||
172 | #if defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE) | 173 | /* |
174 | * Prefer the GPIO code since the TWI controller isn't robust | ||
175 | * (gets overruns and underruns under load) and can only issue | ||
176 | * repeated STARTs in one scenario (the driver doesn't yet handle them). | ||
177 | */ | ||
178 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) | ||
179 | |||
180 | static struct i2c_gpio_platform_data pdata = { | ||
181 | .sda_pin = AT91_PIN_PA23, | ||
182 | .sda_is_open_drain = 1, | ||
183 | .scl_pin = AT91_PIN_PA24, | ||
184 | .scl_is_open_drain = 1, | ||
185 | .udelay = 2, /* ~100 kHz */ | ||
186 | }; | ||
187 | |||
188 | static struct platform_device at91sam9rl_twi_device = { | ||
189 | .name = "i2c-gpio", | ||
190 | .id = -1, | ||
191 | .dev.platform_data = &pdata, | ||
192 | }; | ||
193 | |||
194 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) | ||
195 | { | ||
196 | at91_set_GPIO_periph(AT91_PIN_PA23, 1); /* TWD (SDA) */ | ||
197 | at91_set_multi_drive(AT91_PIN_PA23, 1); | ||
198 | |||
199 | at91_set_GPIO_periph(AT91_PIN_PA24, 1); /* TWCK (SCL) */ | ||
200 | at91_set_multi_drive(AT91_PIN_PA24, 1); | ||
201 | |||
202 | i2c_register_board_info(0, devices, nr_devices); | ||
203 | platform_device_register(&at91sam9rl_twi_device); | ||
204 | } | ||
205 | |||
206 | #elif defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE) | ||
173 | 207 | ||
174 | static struct resource twi_resources[] = { | 208 | static struct resource twi_resources[] = { |
175 | [0] = { | 209 | [0] = { |
@@ -191,7 +225,7 @@ static struct platform_device at91sam9rl_twi_device = { | |||
191 | .num_resources = ARRAY_SIZE(twi_resources), | 225 | .num_resources = ARRAY_SIZE(twi_resources), |
192 | }; | 226 | }; |
193 | 227 | ||
194 | void __init at91_add_device_i2c(void) | 228 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) |
195 | { | 229 | { |
196 | /* pins used for TWI interface */ | 230 | /* pins used for TWI interface */ |
197 | at91_set_A_periph(AT91_PIN_PA23, 0); /* TWD */ | 231 | at91_set_A_periph(AT91_PIN_PA23, 0); /* TWD */ |
@@ -200,10 +234,11 @@ void __init at91_add_device_i2c(void) | |||
200 | at91_set_A_periph(AT91_PIN_PA24, 0); /* TWCK */ | 234 | at91_set_A_periph(AT91_PIN_PA24, 0); /* TWCK */ |
201 | at91_set_multi_drive(AT91_PIN_PA24, 1); | 235 | at91_set_multi_drive(AT91_PIN_PA24, 1); |
202 | 236 | ||
237 | i2c_register_board_info(0, devices, nr_devices); | ||
203 | platform_device_register(&at91sam9rl_twi_device); | 238 | platform_device_register(&at91sam9rl_twi_device); |
204 | } | 239 | } |
205 | #else | 240 | #else |
206 | void __init at91_add_device_i2c(void) {} | 241 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) {} |
207 | #endif | 242 | #endif |
208 | 243 | ||
209 | 244 | ||
diff --git a/arch/arm/mach-at91/board-carmeva.c b/arch/arm/mach-at91/board-carmeva.c index 76ec856cd4f9..0f0878294a67 100644 --- a/arch/arm/mach-at91/board-carmeva.c +++ b/arch/arm/mach-at91/board-carmeva.c | |||
@@ -128,7 +128,7 @@ static void __init carmeva_board_init(void) | |||
128 | /* USB Device */ | 128 | /* USB Device */ |
129 | at91_add_device_udc(&carmeva_udc_data); | 129 | at91_add_device_udc(&carmeva_udc_data); |
130 | /* I2C */ | 130 | /* I2C */ |
131 | at91_add_device_i2c(); | 131 | at91_add_device_i2c(NULL, 0); |
132 | /* SPI */ | 132 | /* SPI */ |
133 | at91_add_device_spi(carmeva_spi_devices, ARRAY_SIZE(carmeva_spi_devices)); | 133 | at91_add_device_spi(carmeva_spi_devices, ARRAY_SIZE(carmeva_spi_devices)); |
134 | /* Compact Flash */ | 134 | /* Compact Flash */ |
diff --git a/arch/arm/mach-at91/board-csb337.c b/arch/arm/mach-at91/board-csb337.c index dde089922e3b..d0aa20c9383e 100644 --- a/arch/arm/mach-at91/board-csb337.c +++ b/arch/arm/mach-at91/board-csb337.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <linux/mm.h> | 23 | #include <linux/mm.h> |
24 | #include <linux/module.h> | 24 | #include <linux/module.h> |
25 | #include <linux/platform_device.h> | 25 | #include <linux/platform_device.h> |
26 | #include <linux/i2c.h> | ||
27 | #include <linux/spi/spi.h> | 26 | #include <linux/spi/spi.h> |
28 | #include <linux/mtd/physmap.h> | 27 | #include <linux/mtd/physmap.h> |
29 | 28 | ||
@@ -85,12 +84,12 @@ static struct at91_udc_data __initdata csb337_udc_data = { | |||
85 | }; | 84 | }; |
86 | 85 | ||
87 | static struct i2c_board_info __initdata csb337_i2c_devices[] = { | 86 | static struct i2c_board_info __initdata csb337_i2c_devices[] = { |
88 | { I2C_BOARD_INFO("rtc-ds1307", 0x68), | 87 | { |
89 | .type = "ds1307", | 88 | I2C_BOARD_INFO("rtc-ds1307", 0x68), |
89 | .type = "ds1307", | ||
90 | }, | 90 | }, |
91 | }; | 91 | }; |
92 | 92 | ||
93 | |||
94 | static struct at91_cf_data __initdata csb337_cf_data = { | 93 | static struct at91_cf_data __initdata csb337_cf_data = { |
95 | /* | 94 | /* |
96 | * connector P4 on the CSB 337 mates to | 95 | * connector P4 on the CSB 337 mates to |
@@ -168,9 +167,7 @@ static void __init csb337_board_init(void) | |||
168 | /* USB Device */ | 167 | /* USB Device */ |
169 | at91_add_device_udc(&csb337_udc_data); | 168 | at91_add_device_udc(&csb337_udc_data); |
170 | /* I2C */ | 169 | /* I2C */ |
171 | at91_add_device_i2c(); | 170 | at91_add_device_i2c(csb337_i2c_devices, ARRAY_SIZE(csb337_i2c_devices)); |
172 | i2c_register_board_info(0, csb337_i2c_devices, | ||
173 | ARRAY_SIZE(csb337_i2c_devices)); | ||
174 | /* Compact Flash */ | 171 | /* Compact Flash */ |
175 | at91_set_gpio_input(AT91_PIN_PB22, 1); /* IOIS16 */ | 172 | at91_set_gpio_input(AT91_PIN_PB22, 1); /* IOIS16 */ |
176 | at91_add_device_cf(&csb337_cf_data); | 173 | at91_add_device_cf(&csb337_cf_data); |
diff --git a/arch/arm/mach-at91/board-csb637.c b/arch/arm/mach-at91/board-csb637.c index 77f04b935b3a..c5c721d27f42 100644 --- a/arch/arm/mach-at91/board-csb637.c +++ b/arch/arm/mach-at91/board-csb637.c | |||
@@ -129,7 +129,7 @@ static void __init csb637_board_init(void) | |||
129 | /* USB Device */ | 129 | /* USB Device */ |
130 | at91_add_device_udc(&csb637_udc_data); | 130 | at91_add_device_udc(&csb637_udc_data); |
131 | /* I2C */ | 131 | /* I2C */ |
132 | at91_add_device_i2c(); | 132 | at91_add_device_i2c(NULL, 0); |
133 | /* SPI */ | 133 | /* SPI */ |
134 | at91_add_device_spi(NULL, 0); | 134 | at91_add_device_spi(NULL, 0); |
135 | /* NOR flash */ | 135 | /* NOR flash */ |
diff --git a/arch/arm/mach-at91/board-dk.c b/arch/arm/mach-at91/board-dk.c index af497896a96c..40c9e4331706 100644 --- a/arch/arm/mach-at91/board-dk.c +++ b/arch/arm/mach-at91/board-dk.c | |||
@@ -124,6 +124,19 @@ static struct spi_board_info dk_spi_devices[] = { | |||
124 | #endif | 124 | #endif |
125 | }; | 125 | }; |
126 | 126 | ||
127 | static struct i2c_board_info __initdata dk_i2c_devices[] = { | ||
128 | { | ||
129 | I2C_BOARD_INFO("ics1523", 0x26), | ||
130 | }, | ||
131 | { | ||
132 | I2C_BOARD_INFO("x9429", 0x28), | ||
133 | }, | ||
134 | { | ||
135 | I2C_BOARD_INFO("at24c", 0x50), | ||
136 | .type = "24c1024", | ||
137 | } | ||
138 | }; | ||
139 | |||
127 | static struct mtd_partition __initdata dk_nand_partition[] = { | 140 | static struct mtd_partition __initdata dk_nand_partition[] = { |
128 | { | 141 | { |
129 | .name = "NAND Partition 1", | 142 | .name = "NAND Partition 1", |
@@ -185,7 +198,7 @@ static void __init dk_board_init(void) | |||
185 | /* Compact Flash */ | 198 | /* Compact Flash */ |
186 | at91_add_device_cf(&dk_cf_data); | 199 | at91_add_device_cf(&dk_cf_data); |
187 | /* I2C */ | 200 | /* I2C */ |
188 | at91_add_device_i2c(); | 201 | at91_add_device_i2c(dk_i2c_devices, ARRAY_SIZE(dk_i2c_devices)); |
189 | /* SPI */ | 202 | /* SPI */ |
190 | at91_add_device_spi(dk_spi_devices, ARRAY_SIZE(dk_spi_devices)); | 203 | at91_add_device_spi(dk_spi_devices, ARRAY_SIZE(dk_spi_devices)); |
191 | #ifdef CONFIG_MTD_AT91_DATAFLASH_CARD | 204 | #ifdef CONFIG_MTD_AT91_DATAFLASH_CARD |
diff --git a/arch/arm/mach-at91/board-eb9200.c b/arch/arm/mach-at91/board-eb9200.c index 20458b5548f0..b7b79bb9d6c4 100644 --- a/arch/arm/mach-at91/board-eb9200.c +++ b/arch/arm/mach-at91/board-eb9200.c | |||
@@ -91,6 +91,14 @@ static struct at91_mmc_data __initdata eb9200_mmc_data = { | |||
91 | .wire4 = 1, | 91 | .wire4 = 1, |
92 | }; | 92 | }; |
93 | 93 | ||
94 | static struct i2c_board_info __initdata eb9200_i2c_devices[] = { | ||
95 | { | ||
96 | I2C_BOARD_INFO("at24c", 0x50), | ||
97 | .type = "24c512", | ||
98 | }, | ||
99 | }; | ||
100 | |||
101 | |||
94 | static void __init eb9200_board_init(void) | 102 | static void __init eb9200_board_init(void) |
95 | { | 103 | { |
96 | /* Serial */ | 104 | /* Serial */ |
@@ -102,7 +110,7 @@ static void __init eb9200_board_init(void) | |||
102 | /* USB Device */ | 110 | /* USB Device */ |
103 | at91_add_device_udc(&eb9200_udc_data); | 111 | at91_add_device_udc(&eb9200_udc_data); |
104 | /* I2C */ | 112 | /* I2C */ |
105 | at91_add_device_i2c(); | 113 | at91_add_device_i2c(eb9200_i2c_devices, ARRAY_SIZE(eb9200_i2c_devices)); |
106 | /* Compact Flash */ | 114 | /* Compact Flash */ |
107 | at91_add_device_cf(&eb9200_cf_data); | 115 | at91_add_device_cf(&eb9200_cf_data); |
108 | /* SPI */ | 116 | /* SPI */ |
diff --git a/arch/arm/mach-at91/board-ek.c b/arch/arm/mach-at91/board-ek.c index 322fdd75a1e4..d05b1b2be9fb 100644 --- a/arch/arm/mach-at91/board-ek.c +++ b/arch/arm/mach-at91/board-ek.c | |||
@@ -145,7 +145,7 @@ static void __init ek_board_init(void) | |||
145 | at91_add_device_udc(&ek_udc_data); | 145 | at91_add_device_udc(&ek_udc_data); |
146 | at91_set_multi_drive(ek_udc_data.pullup_pin, 1); /* pullup_pin is connected to reset */ | 146 | at91_set_multi_drive(ek_udc_data.pullup_pin, 1); /* pullup_pin is connected to reset */ |
147 | /* I2C */ | 147 | /* I2C */ |
148 | at91_add_device_i2c(); | 148 | at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices)); |
149 | /* SPI */ | 149 | /* SPI */ |
150 | at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices)); | 150 | at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices)); |
151 | #ifdef CONFIG_MTD_AT91_DATAFLASH_CARD | 151 | #ifdef CONFIG_MTD_AT91_DATAFLASH_CARD |
diff --git a/arch/arm/mach-at91/board-kafa.c b/arch/arm/mach-at91/board-kafa.c index c77d84ce9cae..cf1b7b2f76fb 100644 --- a/arch/arm/mach-at91/board-kafa.c +++ b/arch/arm/mach-at91/board-kafa.c | |||
@@ -92,7 +92,7 @@ static void __init kafa_board_init(void) | |||
92 | /* USB Device */ | 92 | /* USB Device */ |
93 | at91_add_device_udc(&kafa_udc_data); | 93 | at91_add_device_udc(&kafa_udc_data); |
94 | /* I2C */ | 94 | /* I2C */ |
95 | at91_add_device_i2c(); | 95 | at91_add_device_i2c(NULL, 0); |
96 | /* SPI */ | 96 | /* SPI */ |
97 | at91_add_device_spi(NULL, 0); | 97 | at91_add_device_spi(NULL, 0); |
98 | } | 98 | } |
diff --git a/arch/arm/mach-at91/board-kb9202.c b/arch/arm/mach-at91/board-kb9202.c index 7d9b1a278fd6..4b39b9cda75b 100644 --- a/arch/arm/mach-at91/board-kb9202.c +++ b/arch/arm/mach-at91/board-kb9202.c | |||
@@ -124,7 +124,7 @@ static void __init kb9202_board_init(void) | |||
124 | /* MMC */ | 124 | /* MMC */ |
125 | at91_add_device_mmc(0, &kb9202_mmc_data); | 125 | at91_add_device_mmc(0, &kb9202_mmc_data); |
126 | /* I2C */ | 126 | /* I2C */ |
127 | at91_add_device_i2c(); | 127 | at91_add_device_i2c(NULL, 0); |
128 | /* SPI */ | 128 | /* SPI */ |
129 | at91_add_device_spi(NULL, 0); | 129 | at91_add_device_spi(NULL, 0); |
130 | /* NAND */ | 130 | /* NAND */ |
diff --git a/arch/arm/mach-at91/board-picotux200.c b/arch/arm/mach-at91/board-picotux200.c index 49cfe7ab4a85..6acb55c09ae5 100644 --- a/arch/arm/mach-at91/board-picotux200.c +++ b/arch/arm/mach-at91/board-picotux200.c | |||
@@ -139,7 +139,7 @@ static void __init picotux200_board_init(void) | |||
139 | // at91_add_device_udc(&picotux200_udc_data); | 139 | // at91_add_device_udc(&picotux200_udc_data); |
140 | // at91_set_multi_drive(picotux200_udc_data.pullup_pin, 1); /* pullup_pin is connected to reset */ | 140 | // at91_set_multi_drive(picotux200_udc_data.pullup_pin, 1); /* pullup_pin is connected to reset */ |
141 | /* I2C */ | 141 | /* I2C */ |
142 | at91_add_device_i2c(); | 142 | at91_add_device_i2c(NULL, 0); |
143 | /* SPI */ | 143 | /* SPI */ |
144 | // at91_add_device_spi(picotux200_spi_devices, ARRAY_SIZE(picotux200_spi_devices)); | 144 | // at91_add_device_spi(picotux200_spi_devices, ARRAY_SIZE(picotux200_spi_devices)); |
145 | #ifdef CONFIG_MTD_AT91_DATAFLASH_CARD | 145 | #ifdef CONFIG_MTD_AT91_DATAFLASH_CARD |
diff --git a/arch/arm/mach-at91/board-sam9260ek.c b/arch/arm/mach-at91/board-sam9260ek.c index 65fa532bb4ac..b343a6c28120 100644 --- a/arch/arm/mach-at91/board-sam9260ek.c +++ b/arch/arm/mach-at91/board-sam9260ek.c | |||
@@ -189,7 +189,7 @@ static void __init ek_board_init(void) | |||
189 | /* MMC */ | 189 | /* MMC */ |
190 | at91_add_device_mmc(0, &ek_mmc_data); | 190 | at91_add_device_mmc(0, &ek_mmc_data); |
191 | /* I2C */ | 191 | /* I2C */ |
192 | at91_add_device_i2c(); | 192 | at91_add_device_i2c(NULL, 0); |
193 | } | 193 | } |
194 | 194 | ||
195 | MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK") | 195 | MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK") |
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c index 42e172cb0f49..550ae59a3aca 100644 --- a/arch/arm/mach-at91/board-sam9261ek.c +++ b/arch/arm/mach-at91/board-sam9261ek.c | |||
@@ -382,14 +382,14 @@ static struct platform_device ek_button_device = { | |||
382 | 382 | ||
383 | static void __init ek_add_device_buttons(void) | 383 | static void __init ek_add_device_buttons(void) |
384 | { | 384 | { |
385 | at91_set_gpio_input(AT91_PIN_PB27, 0); /* btn0 */ | 385 | at91_set_gpio_input(AT91_PIN_PA27, 0); /* btn0 */ |
386 | at91_set_deglitch(AT91_PIN_PB27, 1); | 386 | at91_set_deglitch(AT91_PIN_PA27, 1); |
387 | at91_set_gpio_input(AT91_PIN_PB26, 0); /* btn1 */ | 387 | at91_set_gpio_input(AT91_PIN_PA26, 0); /* btn1 */ |
388 | at91_set_deglitch(AT91_PIN_PB26, 1); | 388 | at91_set_deglitch(AT91_PIN_PA26, 1); |
389 | at91_set_gpio_input(AT91_PIN_PB25, 0); /* btn2 */ | 389 | at91_set_gpio_input(AT91_PIN_PA25, 0); /* btn2 */ |
390 | at91_set_deglitch(AT91_PIN_PB25, 1); | 390 | at91_set_deglitch(AT91_PIN_PA25, 1); |
391 | at91_set_gpio_input(AT91_PIN_PB24, 0); /* btn3 */ | 391 | at91_set_gpio_input(AT91_PIN_PA24, 0); /* btn3 */ |
392 | at91_set_deglitch(AT91_PIN_PB24, 1); | 392 | at91_set_deglitch(AT91_PIN_PA24, 1); |
393 | 393 | ||
394 | platform_device_register(&ek_button_device); | 394 | platform_device_register(&ek_button_device); |
395 | } | 395 | } |
@@ -406,7 +406,7 @@ static void __init ek_board_init(void) | |||
406 | /* USB Device */ | 406 | /* USB Device */ |
407 | at91_add_device_udc(&ek_udc_data); | 407 | at91_add_device_udc(&ek_udc_data); |
408 | /* I2C */ | 408 | /* I2C */ |
409 | at91_add_device_i2c(); | 409 | at91_add_device_i2c(NULL, 0); |
410 | /* NAND */ | 410 | /* NAND */ |
411 | at91_add_device_nand(&ek_nand_data); | 411 | at91_add_device_nand(&ek_nand_data); |
412 | /* DM9000 ethernet */ | 412 | /* DM9000 ethernet */ |
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c index 2a1cc73390b7..ab9dcc075454 100644 --- a/arch/arm/mach-at91/board-sam9263ek.c +++ b/arch/arm/mach-at91/board-sam9263ek.c | |||
@@ -291,7 +291,7 @@ static void __init ek_board_init(void) | |||
291 | /* NAND */ | 291 | /* NAND */ |
292 | at91_add_device_nand(&ek_nand_data); | 292 | at91_add_device_nand(&ek_nand_data); |
293 | /* I2C */ | 293 | /* I2C */ |
294 | at91_add_device_i2c(); | 294 | at91_add_device_i2c(NULL, 0); |
295 | /* LCD Controller */ | 295 | /* LCD Controller */ |
296 | at91_add_device_lcdc(&ek_lcdc_data); | 296 | at91_add_device_lcdc(&ek_lcdc_data); |
297 | /* AC97 */ | 297 | /* AC97 */ |
diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c index 9b61320f295a..bc0546d7245f 100644 --- a/arch/arm/mach-at91/board-sam9rlek.c +++ b/arch/arm/mach-at91/board-sam9rlek.c | |||
@@ -181,7 +181,7 @@ static void __init ek_board_init(void) | |||
181 | /* Serial */ | 181 | /* Serial */ |
182 | at91_add_device_serial(); | 182 | at91_add_device_serial(); |
183 | /* I2C */ | 183 | /* I2C */ |
184 | at91_add_device_i2c(); | 184 | at91_add_device_i2c(NULL, 0); |
185 | /* NAND */ | 185 | /* NAND */ |
186 | at91_add_device_nand(&ek_nand_data); | 186 | at91_add_device_nand(&ek_nand_data); |
187 | /* SPI */ | 187 | /* SPI */ |
diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c index 848efb2a4ebf..57c3b647ce83 100644 --- a/arch/arm/mach-at91/clock.c +++ b/arch/arm/mach-at91/clock.c | |||
@@ -351,7 +351,7 @@ static void init_programmable_clock(struct clk *clk) | |||
351 | pckr = at91_sys_read(AT91_PMC_PCKR(clk->id)); | 351 | pckr = at91_sys_read(AT91_PMC_PCKR(clk->id)); |
352 | parent = at91_css_to_clk(pckr & AT91_PMC_CSS); | 352 | parent = at91_css_to_clk(pckr & AT91_PMC_CSS); |
353 | clk->parent = parent; | 353 | clk->parent = parent; |
354 | clk->rate_hz = parent->rate_hz / (1 << ((pckr >> 2) & 3)); | 354 | clk->rate_hz = parent->rate_hz / (1 << ((pckr & AT91_PMC_PRES) >> 2)); |
355 | } | 355 | } |
356 | 356 | ||
357 | #endif /* CONFIG_AT91_PROGRAMMABLE_CLOCKS */ | 357 | #endif /* CONFIG_AT91_PROGRAMMABLE_CLOCKS */ |
@@ -587,8 +587,11 @@ int __init at91_clock_init(unsigned long main_clock) | |||
587 | mckr = at91_sys_read(AT91_PMC_MCKR); | 587 | mckr = at91_sys_read(AT91_PMC_MCKR); |
588 | mck.parent = at91_css_to_clk(mckr & AT91_PMC_CSS); | 588 | mck.parent = at91_css_to_clk(mckr & AT91_PMC_CSS); |
589 | freq = mck.parent->rate_hz; | 589 | freq = mck.parent->rate_hz; |
590 | freq /= (1 << ((mckr >> 2) & 3)); /* prescale */ | 590 | freq /= (1 << ((mckr & AT91_PMC_PRES) >> 2)); /* prescale */ |
591 | mck.rate_hz = freq / (1 + ((mckr >> 8) & 3)); /* mdiv */ | 591 | if (cpu_is_at91rm9200()) |
592 | mck.rate_hz = freq / (1 + ((mckr & AT91_PMC_MDIV) >> 8)); /* mdiv */ | ||
593 | else | ||
594 | mck.rate_hz = freq / (1 << ((mckr & AT91_PMC_MDIV) >> 8)); /* mdiv */ | ||
592 | 595 | ||
593 | /* Register the PMC's standard clocks */ | 596 | /* Register the PMC's standard clocks */ |
594 | for (i = 0; i < ARRAY_SIZE(standard_pmc_clocks); i++) | 597 | for (i = 0; i < ARRAY_SIZE(standard_pmc_clocks); i++) |
diff --git a/arch/arm/mach-imx/irq.c b/arch/arm/mach-imx/irq.c index 0791b56caecc..a7465db84893 100644 --- a/arch/arm/mach-imx/irq.c +++ b/arch/arm/mach-imx/irq.c | |||
@@ -43,12 +43,46 @@ | |||
43 | * | 43 | * |
44 | */ | 44 | */ |
45 | 45 | ||
46 | #define INTENNUM_OFF 0x8 | 46 | #define INTCNTL_OFF 0x00 |
47 | #define INTDISNUM_OFF 0xC | 47 | #define NIMASK_OFF 0x04 |
48 | #define INTENNUM_OFF 0x08 | ||
49 | #define INTDISNUM_OFF 0x0C | ||
50 | #define INTENABLEH_OFF 0x10 | ||
51 | #define INTENABLEL_OFF 0x14 | ||
52 | #define INTTYPEH_OFF 0x18 | ||
53 | #define INTTYPEL_OFF 0x1C | ||
54 | #define NIPRIORITY_OFF(x) (0x20+4*(7-(x))) | ||
55 | #define NIVECSR_OFF 0x40 | ||
56 | #define FIVECSR_OFF 0x44 | ||
57 | #define INTSRCH_OFF 0x48 | ||
58 | #define INTSRCL_OFF 0x4C | ||
59 | #define INTFRCH_OFF 0x50 | ||
60 | #define INTFRCL_OFF 0x54 | ||
61 | #define NIPNDH_OFF 0x58 | ||
62 | #define NIPNDL_OFF 0x5C | ||
63 | #define FIPNDH_OFF 0x60 | ||
64 | #define FIPNDL_OFF 0x64 | ||
48 | 65 | ||
49 | #define VA_AITC_BASE IO_ADDRESS(IMX_AITC_BASE) | 66 | #define VA_AITC_BASE IO_ADDRESS(IMX_AITC_BASE) |
50 | #define IMX_AITC_INTDISNUM (VA_AITC_BASE + INTDISNUM_OFF) | 67 | #define IMX_AITC_INTCNTL (VA_AITC_BASE + INTCNTL_OFF) |
68 | #define IMX_AITC_NIMASK (VA_AITC_BASE + NIMASK_OFF) | ||
51 | #define IMX_AITC_INTENNUM (VA_AITC_BASE + INTENNUM_OFF) | 69 | #define IMX_AITC_INTENNUM (VA_AITC_BASE + INTENNUM_OFF) |
70 | #define IMX_AITC_INTDISNUM (VA_AITC_BASE + INTDISNUM_OFF) | ||
71 | #define IMX_AITC_INTENABLEH (VA_AITC_BASE + INTENABLEH_OFF) | ||
72 | #define IMX_AITC_INTENABLEL (VA_AITC_BASE + INTENABLEL_OFF) | ||
73 | #define IMX_AITC_INTTYPEH (VA_AITC_BASE + INTTYPEH_OFF) | ||
74 | #define IMX_AITC_INTTYPEL (VA_AITC_BASE + INTTYPEL_OFF) | ||
75 | #define IMX_AITC_NIPRIORITY(x) (VA_AITC_BASE + NIPRIORITY_OFF(x)) | ||
76 | #define IMX_AITC_NIVECSR (VA_AITC_BASE + NIVECSR_OFF) | ||
77 | #define IMX_AITC_FIVECSR (VA_AITC_BASE + FIVECSR_OFF) | ||
78 | #define IMX_AITC_INTSRCH (VA_AITC_BASE + INTSRCH_OFF) | ||
79 | #define IMX_AITC_INTSRCL (VA_AITC_BASE + INTSRCL_OFF) | ||
80 | #define IMX_AITC_INTFRCH (VA_AITC_BASE + INTFRCH_OFF) | ||
81 | #define IMX_AITC_INTFRCL (VA_AITC_BASE + INTFRCL_OFF) | ||
82 | #define IMX_AITC_NIPNDH (VA_AITC_BASE + NIPNDH_OFF) | ||
83 | #define IMX_AITC_NIPNDL (VA_AITC_BASE + NIPNDL_OFF) | ||
84 | #define IMX_AITC_FIPNDH (VA_AITC_BASE + FIPNDH_OFF) | ||
85 | #define IMX_AITC_FIPNDL (VA_AITC_BASE + FIPNDL_OFF) | ||
52 | 86 | ||
53 | #if 0 | 87 | #if 0 |
54 | #define DEBUG_IRQ(fmt...) printk(fmt) | 88 | #define DEBUG_IRQ(fmt...) printk(fmt) |
@@ -222,7 +256,12 @@ imx_init_irq(void) | |||
222 | 256 | ||
223 | DEBUG_IRQ("Initializing imx interrupts\n"); | 257 | DEBUG_IRQ("Initializing imx interrupts\n"); |
224 | 258 | ||
225 | /* Mask all interrupts initially */ | 259 | /* Disable all interrupts initially. */ |
260 | /* Do not rely on the bootloader. */ | ||
261 | __raw_writel(0, IMX_AITC_INTENABLEH); | ||
262 | __raw_writel(0, IMX_AITC_INTENABLEL); | ||
263 | |||
264 | /* Mask all GPIO interrupts as well */ | ||
226 | IMR(0) = 0; | 265 | IMR(0) = 0; |
227 | IMR(1) = 0; | 266 | IMR(1) = 0; |
228 | IMR(2) = 0; | 267 | IMR(2) = 0; |
@@ -245,6 +284,6 @@ imx_init_irq(void) | |||
245 | set_irq_chained_handler(GPIO_INT_PORTC, imx_gpioc_demux_handler); | 284 | set_irq_chained_handler(GPIO_INT_PORTC, imx_gpioc_demux_handler); |
246 | set_irq_chained_handler(GPIO_INT_PORTD, imx_gpiod_demux_handler); | 285 | set_irq_chained_handler(GPIO_INT_PORTD, imx_gpiod_demux_handler); |
247 | 286 | ||
248 | /* Disable all interrupts initially. */ | 287 | /* Release masking of interrupts according to priority */ |
249 | /* In IMX this is done in the bootloader. */ | 288 | __raw_writel(-1, IMX_AITC_NIMASK); |
250 | } | 289 | } |
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index d0f2b597db12..8e126e6b74c3 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c | |||
@@ -146,7 +146,7 @@ static struct clk pxa27x_clks[] = { | |||
146 | INIT_CKEN("MMCCLK", MMC, 19500000, 0, &pxa_device_mci.dev), | 146 | INIT_CKEN("MMCCLK", MMC, 19500000, 0, &pxa_device_mci.dev), |
147 | INIT_CKEN("FICPCLK", FICP, 48000000, 0, &pxa_device_ficp.dev), | 147 | INIT_CKEN("FICPCLK", FICP, 48000000, 0, &pxa_device_ficp.dev), |
148 | 148 | ||
149 | INIT_CKEN("USBCLK", USB, 48000000, 0, &pxa27x_device_ohci.dev), | 149 | INIT_CKEN("USBCLK", USBHOST, 48000000, 0, &pxa27x_device_ohci.dev), |
150 | INIT_CKEN("I2CCLK", PWRI2C, 13000000, 0, &pxa27x_device_i2c_power.dev), | 150 | INIT_CKEN("I2CCLK", PWRI2C, 13000000, 0, &pxa27x_device_i2c_power.dev), |
151 | INIT_CKEN("KBDCLK", KEYPAD, 32768, 0, NULL), | 151 | INIT_CKEN("KBDCLK", KEYPAD, 32768, 0, NULL), |
152 | 152 | ||
diff --git a/arch/arm/mach-pxa/pxa320.c b/arch/arm/mach-pxa/pxa320.c index 1010f77d977a..74128eb8f8d0 100644 --- a/arch/arm/mach-pxa/pxa320.c +++ b/arch/arm/mach-pxa/pxa320.c | |||
@@ -23,8 +23,11 @@ | |||
23 | static struct pxa3xx_mfp_addr_map pxa320_mfp_addr_map[] __initdata = { | 23 | static struct pxa3xx_mfp_addr_map pxa320_mfp_addr_map[] __initdata = { |
24 | 24 | ||
25 | MFP_ADDR_X(GPIO0, GPIO4, 0x0124), | 25 | MFP_ADDR_X(GPIO0, GPIO4, 0x0124), |
26 | MFP_ADDR_X(GPIO5, GPIO26, 0x028C), | 26 | MFP_ADDR_X(GPIO5, GPIO9, 0x028C), |
27 | MFP_ADDR_X(GPIO27, GPIO62, 0x0400), | 27 | MFP_ADDR(GPIO10, 0x0458), |
28 | MFP_ADDR_X(GPIO11, GPIO26, 0x02A0), | ||
29 | MFP_ADDR_X(GPIO27, GPIO48, 0x0400), | ||
30 | MFP_ADDR_X(GPIO49, GPIO62, 0x045C), | ||
28 | MFP_ADDR_X(GPIO63, GPIO73, 0x04B4), | 31 | MFP_ADDR_X(GPIO63, GPIO73, 0x04B4), |
29 | MFP_ADDR_X(GPIO74, GPIO98, 0x04F0), | 32 | MFP_ADDR_X(GPIO74, GPIO98, 0x04F0), |
30 | MFP_ADDR_X(GPIO99, GPIO127, 0x0600), | 33 | MFP_ADDR_X(GPIO99, GPIO127, 0x0600), |
diff --git a/arch/arm/mach-pxa/ssp.c b/arch/arm/mach-pxa/ssp.c index 71766ac0328b..422afee88169 100644 --- a/arch/arm/mach-pxa/ssp.c +++ b/arch/arm/mach-pxa/ssp.c | |||
@@ -309,6 +309,7 @@ void ssp_exit(struct ssp_dev *dev) | |||
309 | 309 | ||
310 | if (dev->port > PXA_SSP_PORTS || dev->port == 0) { | 310 | if (dev->port > PXA_SSP_PORTS || dev->port == 0) { |
311 | printk(KERN_WARNING "SSP: tried to close invalid port\n"); | 311 | printk(KERN_WARNING "SSP: tried to close invalid port\n"); |
312 | mutex_unlock(&mutex); | ||
312 | return; | 313 | return; |
313 | } | 314 | } |
314 | 315 | ||
diff --git a/arch/mips/kernel/csrc-r4k.c b/arch/mips/kernel/csrc-r4k.c index 74c5c62365a8..0e2b5cd81f67 100644 --- a/arch/mips/kernel/csrc-r4k.c +++ b/arch/mips/kernel/csrc-r4k.c | |||
@@ -5,6 +5,10 @@ | |||
5 | * | 5 | * |
6 | * Copyright (C) 2007 by Ralf Baechle | 6 | * Copyright (C) 2007 by Ralf Baechle |
7 | */ | 7 | */ |
8 | #include <linux/clocksource.h> | ||
9 | #include <linux/init.h> | ||
10 | |||
11 | #include <asm/time.h> | ||
8 | 12 | ||
9 | static cycle_t c0_hpt_read(void) | 13 | static cycle_t c0_hpt_read(void) |
10 | { | 14 | { |
@@ -18,7 +22,7 @@ static struct clocksource clocksource_mips = { | |||
18 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 22 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
19 | }; | 23 | }; |
20 | 24 | ||
21 | static void __init init_mips_clocksource(void) | 25 | void __init init_mips_clocksource(void) |
22 | { | 26 | { |
23 | /* Calclate a somewhat reasonable rating value */ | 27 | /* Calclate a somewhat reasonable rating value */ |
24 | clocksource_mips.rating = 200 + mips_hpt_frequency / 10000000; | 28 | clocksource_mips.rating = 200 + mips_hpt_frequency / 10000000; |
diff --git a/arch/mips/pci/pci-bcm1480.c b/arch/mips/pci/pci-bcm1480.c index 5443ea3596f8..bc647cb77298 100644 --- a/arch/mips/pci/pci-bcm1480.c +++ b/arch/mips/pci/pci-bcm1480.c | |||
@@ -76,8 +76,7 @@ static inline void WRITECFG32(u32 addr, u32 data) | |||
76 | 76 | ||
77 | int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | 77 | int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) |
78 | { | 78 | { |
79 | This is b0rked. | 79 | return K_BCM1480_INT_PCI_INTA + pin; |
80 | return dev->irq; | ||
81 | } | 80 | } |
82 | 81 | ||
83 | /* Do platform specific device initialization at pci_enable_device() time */ | 82 | /* Do platform specific device initialization at pci_enable_device() time */ |
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c index 053cac19f714..52e95c2158c0 100644 --- a/arch/powerpc/kernel/rtas.c +++ b/arch/powerpc/kernel/rtas.c | |||
@@ -638,18 +638,18 @@ void rtas_halt(void) | |||
638 | /* Must be in the RMO region, so we place it here */ | 638 | /* Must be in the RMO region, so we place it here */ |
639 | static char rtas_os_term_buf[2048]; | 639 | static char rtas_os_term_buf[2048]; |
640 | 640 | ||
641 | void rtas_panic_msg(char *str) | 641 | void rtas_os_term(char *str) |
642 | { | ||
643 | snprintf(rtas_os_term_buf, 2048, "OS panic: %s", str); | ||
644 | } | ||
645 | |||
646 | void rtas_os_term(void) | ||
647 | { | 642 | { |
648 | int status; | 643 | int status; |
649 | 644 | ||
645 | if (panic_timeout) | ||
646 | return; | ||
647 | |||
650 | if (RTAS_UNKNOWN_SERVICE == rtas_token("ibm,os-term")) | 648 | if (RTAS_UNKNOWN_SERVICE == rtas_token("ibm,os-term")) |
651 | return; | 649 | return; |
652 | 650 | ||
651 | snprintf(rtas_os_term_buf, 2048, "OS panic: %s", str); | ||
652 | |||
653 | do { | 653 | do { |
654 | status = rtas_call(rtas_token("ibm,os-term"), 1, 1, NULL, | 654 | status = rtas_call(rtas_token("ibm,os-term"), 1, 1, NULL, |
655 | __pa(rtas_os_term_buf)); | 655 | __pa(rtas_os_term_buf)); |
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index fdeefe54ea91..fdb9b1c8f977 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -507,8 +507,7 @@ define_machine(pseries) { | |||
507 | .restart = rtas_restart, | 507 | .restart = rtas_restart, |
508 | .power_off = pSeries_power_off, | 508 | .power_off = pSeries_power_off, |
509 | .halt = rtas_halt, | 509 | .halt = rtas_halt, |
510 | .panic = rtas_panic_msg, | 510 | .panic = rtas_os_term, |
511 | .machine_shutdown = rtas_os_term, | ||
512 | .get_boot_time = rtas_get_boot_time, | 511 | .get_boot_time = rtas_get_boot_time, |
513 | .get_rtc_time = rtas_get_rtc_time, | 512 | .get_rtc_time = rtas_get_rtc_time, |
514 | .set_rtc_time = rtas_set_rtc_time, | 513 | .set_rtc_time = rtas_set_rtc_time, |
diff --git a/arch/ppc/configs/ml300_defconfig b/arch/ppc/configs/ml300_defconfig index 69bad91a6b65..d66cacdb95be 100644 --- a/arch/ppc/configs/ml300_defconfig +++ b/arch/ppc/configs/ml300_defconfig | |||
@@ -719,7 +719,7 @@ CONFIG_DEBUG_INFO=y | |||
719 | CONFIG_FORCED_INLINING=y | 719 | CONFIG_FORCED_INLINING=y |
720 | # CONFIG_RCU_TORTURE_TEST is not set | 720 | # CONFIG_RCU_TORTURE_TEST is not set |
721 | # CONFIG_KGDB is not set | 721 | # CONFIG_KGDB is not set |
722 | CONFIG_XMON=y | 722 | # CONFIG_XMON is not set |
723 | # CONFIG_BDI_SWITCH is not set | 723 | # CONFIG_BDI_SWITCH is not set |
724 | # CONFIG_SERIAL_TEXT_DEBUG is not set | 724 | # CONFIG_SERIAL_TEXT_DEBUG is not set |
725 | 725 | ||
diff --git a/arch/ppc/configs/ml403_defconfig b/arch/ppc/configs/ml403_defconfig index a78896ea4560..71bcfa7ab7f7 100644 --- a/arch/ppc/configs/ml403_defconfig +++ b/arch/ppc/configs/ml403_defconfig | |||
@@ -720,7 +720,7 @@ CONFIG_DEBUG_INFO=y | |||
720 | CONFIG_FORCED_INLINING=y | 720 | CONFIG_FORCED_INLINING=y |
721 | # CONFIG_RCU_TORTURE_TEST is not set | 721 | # CONFIG_RCU_TORTURE_TEST is not set |
722 | # CONFIG_KGDB is not set | 722 | # CONFIG_KGDB is not set |
723 | CONFIG_XMON=y | 723 | # CONFIG_XMON is not set |
724 | # CONFIG_BDI_SWITCH is not set | 724 | # CONFIG_BDI_SWITCH is not set |
725 | # CONFIG_SERIAL_TEXT_DEBUG is not set | 725 | # CONFIG_SERIAL_TEXT_DEBUG is not set |
726 | 726 | ||
diff --git a/arch/um/Kconfig.i386 b/arch/um/Kconfig.i386 index e0ac74e5d4c4..717f5d3440e3 100644 --- a/arch/um/Kconfig.i386 +++ b/arch/um/Kconfig.i386 | |||
@@ -8,6 +8,13 @@ config UML_X86 | |||
8 | bool | 8 | bool |
9 | default y | 9 | default y |
10 | 10 | ||
11 | config X86_32 | ||
12 | bool | ||
13 | default y | ||
14 | |||
15 | config RWSEM_XCHGADD_ALGORITHM | ||
16 | def_bool y | ||
17 | |||
11 | config 64BIT | 18 | config 64BIT |
12 | bool | 19 | bool |
13 | default n | 20 | default n |
diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c index b88e93b3a39f..025764089ac8 100644 --- a/arch/um/drivers/chan_user.c +++ b/arch/um/drivers/chan_user.c | |||
@@ -74,10 +74,16 @@ void generic_free(void *data) | |||
74 | 74 | ||
75 | int generic_console_write(int fd, const char *buf, int n) | 75 | int generic_console_write(int fd, const char *buf, int n) |
76 | { | 76 | { |
77 | sigset_t old, no_sigio; | ||
77 | struct termios save, new; | 78 | struct termios save, new; |
78 | int err; | 79 | int err; |
79 | 80 | ||
80 | if (isatty(fd)) { | 81 | if (isatty(fd)) { |
82 | sigemptyset(&no_sigio); | ||
83 | sigaddset(&no_sigio, SIGIO); | ||
84 | if (sigprocmask(SIG_BLOCK, &no_sigio, &old)) | ||
85 | goto error; | ||
86 | |||
81 | CATCH_EINTR(err = tcgetattr(fd, &save)); | 87 | CATCH_EINTR(err = tcgetattr(fd, &save)); |
82 | if (err) | 88 | if (err) |
83 | goto error; | 89 | goto error; |
@@ -97,8 +103,11 @@ int generic_console_write(int fd, const char *buf, int n) | |||
97 | * Restore raw mode, in any case; we *must* ignore any error apart | 103 | * Restore raw mode, in any case; we *must* ignore any error apart |
98 | * EINTR, except for debug. | 104 | * EINTR, except for debug. |
99 | */ | 105 | */ |
100 | if (isatty(fd)) | 106 | if (isatty(fd)) { |
101 | CATCH_EINTR(tcsetattr(fd, TCSAFLUSH, &save)); | 107 | CATCH_EINTR(tcsetattr(fd, TCSAFLUSH, &save)); |
108 | sigprocmask(SIG_SETMASK, &old, NULL); | ||
109 | } | ||
110 | |||
102 | return err; | 111 | return err; |
103 | error: | 112 | error: |
104 | return -errno; | 113 | return -errno; |
diff --git a/arch/um/os-Linux/time.c b/arch/um/os-Linux/time.c index ef02d941c2ad..e49280599465 100644 --- a/arch/um/os-Linux/time.c +++ b/arch/um/os-Linux/time.c | |||
@@ -77,6 +77,7 @@ long long os_nsecs(void) | |||
77 | #ifdef UML_CONFIG_NO_HZ | 77 | #ifdef UML_CONFIG_NO_HZ |
78 | static int after_sleep_interval(struct timespec *ts) | 78 | static int after_sleep_interval(struct timespec *ts) |
79 | { | 79 | { |
80 | return 0; | ||
80 | } | 81 | } |
81 | #else | 82 | #else |
82 | static inline long long timespec_to_us(const struct timespec *ts) | 83 | static inline long long timespec_to_us(const struct timespec *ts) |
diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c index 8bb482ff091b..9a5fa0abfcc7 100644 --- a/arch/x86/kernel/crash.c +++ b/arch/x86/kernel/crash.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <asm/nmi.h> | 22 | #include <asm/nmi.h> |
23 | #include <asm/hw_irq.h> | 23 | #include <asm/hw_irq.h> |
24 | #include <asm/apic.h> | 24 | #include <asm/apic.h> |
25 | #include <asm/hpet.h> | ||
25 | #include <linux/kdebug.h> | 26 | #include <linux/kdebug.h> |
26 | #include <asm/smp.h> | 27 | #include <asm/smp.h> |
27 | 28 | ||
@@ -140,5 +141,8 @@ void machine_crash_shutdown(struct pt_regs *regs) | |||
140 | #if defined(CONFIG_X86_IO_APIC) | 141 | #if defined(CONFIG_X86_IO_APIC) |
141 | disable_IO_APIC(); | 142 | disable_IO_APIC(); |
142 | #endif | 143 | #endif |
144 | #ifdef CONFIG_HPET_TIMER | ||
145 | hpet_disable(); | ||
146 | #endif | ||
143 | crash_save_cpu(regs, safe_smp_processor_id()); | 147 | crash_save_cpu(regs, safe_smp_processor_id()); |
144 | } | 148 | } |
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S index 374b7ece8961..ac0637a6d71c 100644 --- a/arch/x86/kernel/head_32.S +++ b/arch/x86/kernel/head_32.S | |||
@@ -193,6 +193,12 @@ default_entry: | |||
193 | jb 10b | 193 | jb 10b |
194 | movl %edi,(init_pg_tables_end - __PAGE_OFFSET) | 194 | movl %edi,(init_pg_tables_end - __PAGE_OFFSET) |
195 | 195 | ||
196 | /* Do an early initialization of the fixmap area */ | ||
197 | movl $(swapper_pg_dir - __PAGE_OFFSET), %edx | ||
198 | movl $(swapper_pg_pmd - __PAGE_OFFSET), %eax | ||
199 | addl $0x007, %eax /* 0x007 = PRESENT+RW+USER */ | ||
200 | movl %eax, 4092(%edx) | ||
201 | |||
196 | xorl %ebx,%ebx /* This is the boot CPU (BSP) */ | 202 | xorl %ebx,%ebx /* This is the boot CPU (BSP) */ |
197 | jmp 3f | 203 | jmp 3f |
198 | /* | 204 | /* |
@@ -208,12 +214,6 @@ default_entry: | |||
208 | .section .init.text,"ax",@progbits | 214 | .section .init.text,"ax",@progbits |
209 | #endif | 215 | #endif |
210 | 216 | ||
211 | /* Do an early initialization of the fixmap area */ | ||
212 | movl $(swapper_pg_dir - __PAGE_OFFSET), %edx | ||
213 | movl $(swapper_pg_pmd - __PAGE_OFFSET), %eax | ||
214 | addl $0x007, %eax /* 0x007 = PRESENT+RW+USER */ | ||
215 | movl %eax, 4092(%edx) | ||
216 | |||
217 | #ifdef CONFIG_SMP | 217 | #ifdef CONFIG_SMP |
218 | ENTRY(startup_32_smp) | 218 | ENTRY(startup_32_smp) |
219 | cld | 219 | cld |
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index 53303f2e5475..4a86ffd67ec5 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c | |||
@@ -446,6 +446,20 @@ static __init int hpet_late_init(void) | |||
446 | } | 446 | } |
447 | fs_initcall(hpet_late_init); | 447 | fs_initcall(hpet_late_init); |
448 | 448 | ||
449 | void hpet_disable(void) | ||
450 | { | ||
451 | if (is_hpet_capable()) { | ||
452 | unsigned long cfg = hpet_readl(HPET_CFG); | ||
453 | |||
454 | if (hpet_legacy_int_enabled) { | ||
455 | cfg &= ~HPET_CFG_LEGACY; | ||
456 | hpet_legacy_int_enabled = 0; | ||
457 | } | ||
458 | cfg &= ~HPET_CFG_ENABLE; | ||
459 | hpet_writel(cfg, HPET_CFG); | ||
460 | } | ||
461 | } | ||
462 | |||
449 | #ifdef CONFIG_HPET_EMULATE_RTC | 463 | #ifdef CONFIG_HPET_EMULATE_RTC |
450 | 464 | ||
451 | /* HPET in LegacyReplacement Mode eats up RTC interrupt line. When, HPET | 465 | /* HPET in LegacyReplacement Mode eats up RTC interrupt line. When, HPET |
diff --git a/arch/x86/kernel/reboot_32.c b/arch/x86/kernel/reboot_32.c index 9e2269d00918..bb1a0f889c5e 100644 --- a/arch/x86/kernel/reboot_32.c +++ b/arch/x86/kernel/reboot_32.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/reboot.h> | 11 | #include <linux/reboot.h> |
12 | #include <asm/uaccess.h> | 12 | #include <asm/uaccess.h> |
13 | #include <asm/apic.h> | 13 | #include <asm/apic.h> |
14 | #include <asm/hpet.h> | ||
14 | #include <asm/desc.h> | 15 | #include <asm/desc.h> |
15 | #include "mach_reboot.h" | 16 | #include "mach_reboot.h" |
16 | #include <asm/reboot_fixups.h> | 17 | #include <asm/reboot_fixups.h> |
@@ -326,6 +327,9 @@ static void native_machine_shutdown(void) | |||
326 | #ifdef CONFIG_X86_IO_APIC | 327 | #ifdef CONFIG_X86_IO_APIC |
327 | disable_IO_APIC(); | 328 | disable_IO_APIC(); |
328 | #endif | 329 | #endif |
330 | #ifdef CONFIG_HPET_TIMER | ||
331 | hpet_disable(); | ||
332 | #endif | ||
329 | } | 333 | } |
330 | 334 | ||
331 | void __attribute__((weak)) mach_reboot_fixups(void) | 335 | void __attribute__((weak)) mach_reboot_fixups(void) |
diff --git a/arch/x86/kernel/reboot_64.c b/arch/x86/kernel/reboot_64.c index 71b13c5f5817..53620a92a8fd 100644 --- a/arch/x86/kernel/reboot_64.c +++ b/arch/x86/kernel/reboot_64.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <asm/pgtable.h> | 17 | #include <asm/pgtable.h> |
18 | #include <asm/tlbflush.h> | 18 | #include <asm/tlbflush.h> |
19 | #include <asm/apic.h> | 19 | #include <asm/apic.h> |
20 | #include <asm/hpet.h> | ||
20 | #include <asm/gart.h> | 21 | #include <asm/gart.h> |
21 | 22 | ||
22 | /* | 23 | /* |
@@ -113,6 +114,9 @@ void machine_shutdown(void) | |||
113 | 114 | ||
114 | disable_IO_APIC(); | 115 | disable_IO_APIC(); |
115 | 116 | ||
117 | #ifdef CONFIG_HPET_TIMER | ||
118 | hpet_disable(); | ||
119 | #endif | ||
116 | local_irq_restore(flags); | 120 | local_irq_restore(flags); |
117 | 121 | ||
118 | pci_iommu_shutdown(); | 122 | pci_iommu_shutdown(); |