]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Sat, 1 Dec 2007 01:07:38 +0000 (17:07 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sat, 1 Dec 2007 01:07:38 +0000 (17:07 -0800)
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
  [MIPS] Fix build.
  [MIPS] Fix use of smp_processor_id() in preemptible code.

37 files changed:
MAINTAINERS
arch/arm/common/uengine.c
arch/arm/kernel/entry-armv.S
arch/arm/kernel/traps.c
arch/arm/mach-at91/at91rm9200_devices.c
arch/arm/mach-at91/at91sam9260_devices.c
arch/arm/mach-at91/at91sam9261_devices.c
arch/arm/mach-at91/at91sam9263_devices.c
arch/arm/mach-at91/at91sam9rl_devices.c
arch/arm/mach-at91/board-carmeva.c
arch/arm/mach-at91/board-csb337.c
arch/arm/mach-at91/board-csb637.c
arch/arm/mach-at91/board-dk.c
arch/arm/mach-at91/board-eb9200.c
arch/arm/mach-at91/board-ek.c
arch/arm/mach-at91/board-kafa.c
arch/arm/mach-at91/board-kb9202.c
arch/arm/mach-at91/board-picotux200.c
arch/arm/mach-at91/board-sam9260ek.c
arch/arm/mach-at91/board-sam9261ek.c
arch/arm/mach-at91/board-sam9263ek.c
arch/arm/mach-at91/board-sam9rlek.c
arch/arm/mach-at91/clock.c
arch/arm/mach-imx/irq.c
arch/arm/mach-pxa/pxa27x.c
arch/arm/mach-pxa/pxa320.c
arch/arm/mach-pxa/ssp.c
drivers/serial/pxa.c
include/asm-arm/arch-at91/board.h
include/asm-arm/arch-ixp23xx/irqs.h
include/asm-arm/arch-omap/board-innovator.h
include/asm-arm/arch-pxa/irqs.h
include/asm-arm/arch-pxa/mfp-pxa300.h
include/asm-arm/arch-pxa/mfp-pxa320.h
include/asm-arm/arch-pxa/mfp.h
include/asm-arm/arch-pxa/pxa-regs.h
mm/slab.c

index ac425b5b4a409bd4a67f5a708d5f9c363240d10e..7c8392e1797d9f33301705a8fd89adf5c5c05553 100644 (file)
@@ -439,7 +439,7 @@ S:  Maintained
 
 ARM/ATMEL AT91RM9200 ARM ARCHITECTURE
 P:      Andrew Victor
-M:      andrew@sanpeople.com
+M:      linux@maxim.org.za
 L:      linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
 W:      http://maxim.org.za/at91_26.html
 S:      Maintained
index 95c8508c29b7125a1ac93bc0a6fd4e4f00d39f9e..117cab30bd36ca4e232fab5243b43ee81bc4b22c 100644 (file)
@@ -374,8 +374,8 @@ static int set_initial_registers(int uengine, struct ixp2000_uengine_code *c)
        u8 *ucode;
        int i;
 
-       gpr_a = kmalloc(128 * sizeof(u32), GFP_KERNEL);
-       gpr_b = kmalloc(128 * sizeof(u32), GFP_KERNEL);
+       gpr_a = kzalloc(128 * sizeof(u32), GFP_KERNEL);
+       gpr_b = kzalloc(128 * sizeof(u32), GFP_KERNEL);
        ucode = kmalloc(513 * 5, GFP_KERNEL);
        if (gpr_a == NULL || gpr_b == NULL || ucode == NULL) {
                kfree(ucode);
@@ -388,8 +388,6 @@ static int set_initial_registers(int uengine, struct ixp2000_uengine_code *c)
        if (c->uengine_parameters & IXP2000_UENGINE_4_CONTEXTS)
                per_ctx_regs = 32;
 
-       memset(gpr_a, 0, sizeof(gpr_a));
-       memset(gpr_b, 0, sizeof(gpr_b));
        for (i = 0; i < 256; i++) {
                struct ixp2000_reg_value *r = c->initial_reg_values + i;
                u32 *bank;
index d645897652c2d50a073bc529533127beff369c8d..29dec080a60431dd88bfa7b732940449054374ad 100644 (file)
@@ -339,16 +339,6 @@ __pabt_svc:
        str     r1, [sp]                @ save the "real" r0 copied
                                        @ from the exception stack
 
-#if __LINUX_ARM_ARCH__ < 6 && !defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG)
-#ifndef CONFIG_MMU
-#warning "NPTL on non MMU needs fixing"
-#else
-       @ make sure our user space atomic helper is aborted
-       cmp     r2, #TASK_SIZE
-       bichs   r3, r3, #PSR_Z_BIT
-#endif
-#endif
-
        @
        @ We are now ready to fill in the remaining blanks on the stack:
        @
@@ -372,9 +362,25 @@ __pabt_svc:
        zero_fp
        .endm
 
+       .macro  kuser_cmpxchg_check
+#if __LINUX_ARM_ARCH__ < 6 && !defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG)
+#ifndef CONFIG_MMU
+#warning "NPTL on non MMU needs fixing"
+#else
+       @ Make sure our user space atomic helper is restarted
+       @ if it was interrupted in a critical region.  Here we
+       @ perform a quick test inline since it should be false
+       @ 99.9999% of the time.  The rest is done out of line.
+       cmp     r2, #TASK_SIZE
+       blhs    kuser_cmpxchg_fixup
+#endif
+#endif
+       .endm
+
        .align  5
 __dabt_usr:
        usr_entry
+       kuser_cmpxchg_check
 
        @
        @ Call the processor-specific abort handler:
@@ -404,6 +410,7 @@ __dabt_usr:
        .align  5
 __irq_usr:
        usr_entry
+       kuser_cmpxchg_check
 
 #ifdef CONFIG_TRACE_IRQFLAGS
        bl      trace_hardirqs_off
@@ -446,9 +453,9 @@ __und_usr:
        @
        @  r0 - instruction
        @
-1:     ldrt    r0, [r4]
        adr     r9, ret_from_exception
        adr     lr, __und_usr_unknown
+1:     ldrt    r0, [r4]
        @
        @ fallthrough to call_fpe
        @
@@ -669,7 +676,7 @@ __kuser_helper_start:
  *
  * Clobbered:
  *
- *     the Z flag might be lost
+ *     none
  *
  * Definition and user space usage example:
  *
@@ -730,9 +737,6 @@ __kuser_memory_barrier:                             @ 0xffff0fa0
  *
  *    - This routine already includes memory barriers as needed.
  *
- *    - A failure might be transient, i.e. it is possible, although unlikely,
- *      that "failure" be returned even if *ptr == oldval.
- *
  * For example, a user space atomic_add implementation could look like this:
  *
  * #define atomic_add(ptr, val) \
@@ -769,46 +773,62 @@ __kuser_cmpxchg:                          @ 0xffff0fc0
 
 #elif __LINUX_ARM_ARCH__ < 6
 
+#ifdef CONFIG_MMU
+
        /*
-        * Theory of operation:
-        *
-        * We set the Z flag before loading oldval. If ever an exception
-        * occurs we can not be sure the loaded value will still be the same
-        * when the exception returns, therefore the user exception handler
-        * will clear the Z flag whenever the interrupted user code was
-        * actually from the kernel address space (see the usr_entry macro).
-        *
-        * The post-increment on the str is used to prevent a race with an
-        * exception happening just after the str instruction which would
-        * clear the Z flag although the exchange was done.
+        * The only thing that can break atomicity in this cmpxchg
+        * implementation is either an IRQ or a data abort exception
+        * causing another process/thread to be scheduled in the middle
+        * of the critical sequence.  To prevent this, code is added to
+        * the IRQ and data abort exception handlers to set the pc back
+        * to the beginning of the critical section if it is found to be
+        * within that critical section (see kuser_cmpxchg_fixup).
         */
-#ifdef CONFIG_MMU
-       teq     ip, ip                  @ set Z flag
-       ldr     ip, [r2]                @ load current val
-       add     r3, r2, #1              @ prepare store ptr
-       teqeq   ip, r0                  @ compare with oldval if still allowed
-       streq   r1, [r3, #-1]!          @ store newval if still allowed
-       subs    r0, r2, r3              @ if r2 == r3 the str occured
+1:     ldr     r3, [r2]                        @ load current val
+       subs    r3, r3, r0                      @ compare with oldval
+2:     streq   r1, [r2]                        @ store newval if eq
+       rsbs    r0, r3, #0                      @ set return val and C flag
+       usr_ret lr
+
+       .text
+kuser_cmpxchg_fixup:
+       @ Called from kuser_cmpxchg_check macro.
+       @ r2 = address of interrupted insn (must be preserved).
+       @ sp = saved regs. r7 and r8 are clobbered.
+       @ 1b = first critical insn, 2b = last critical insn.
+       @ If r2 >= 1b and r2 <= 2b then saved pc_usr is set to 1b.
+       mov     r7, #0xffff0fff
+       sub     r7, r7, #(0xffff0fff - (0xffff0fc0 + (1b - __kuser_cmpxchg)))
+       subs    r8, r2, r7
+       rsbcss  r8, r8, #(2b - 1b)
+       strcs   r7, [sp, #S_PC]
+       mov     pc, lr
+       .previous
+
 #else
 #warning "NPTL on non MMU needs fixing"
        mov     r0, #-1
        adds    r0, r0, #0
-#endif
        usr_ret lr
+#endif
 
 #else
 
 #ifdef CONFIG_SMP
        mcr     p15, 0, r0, c7, c10, 5  @ dmb
 #endif
-       ldrex   r3, [r2]
+1:     ldrex   r3, [r2]
        subs    r3, r3, r0
        strexeq r3, r1, [r2]
+       teqeq   r3, #1
+       beq     1b
        rsbs    r0, r3, #0
+       /* beware -- each __kuser slot must be 8 instructions max */
 #ifdef CONFIG_SMP
-       mcr     p15, 0, r0, c7, c10, 5  @ dmb
-#endif
+       b       __kuser_memory_barrier
+#else
        usr_ret lr
+#endif
 
 #endif
 
@@ -829,7 +849,7 @@ __kuser_cmpxchg:                            @ 0xffff0fc0
  *
  * Clobbered:
  *
- *     the Z flag might be lost
+ *     none
  *
  * Definition and user space usage example:
  *
index 4764bd9ccee801ced5838d9043a5923c9e931cb8..c34db4e868fa530c50b0e6baa7123c88eab76ec8 100644 (file)
@@ -327,7 +327,7 @@ asmlinkage void __exception do_undefinstr(struct pt_regs *regs)
                if ((instr & hook->instr_mask) == hook->instr_val &&
                    (regs->ARM_cpsr & hook->cpsr_mask) == hook->cpsr_val) {
                        if (hook->fn(regs, instr) == 0) {
-                               spin_unlock_irq(&undef_lock);
+                               spin_unlock_irqrestore(&undef_lock, flags);
                                return;
                        }
                }
@@ -509,7 +509,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
         * existence.  Don't ever use this from user code.
         */
        case 0xfff0:
-       {
+       for (;;) {
                extern void do_DataAbort(unsigned long addr, unsigned int fsr,
                                         struct pt_regs *regs);
                unsigned long val;
@@ -545,7 +545,6 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
                up_read(&mm->mmap_sem);
                /* simulate a write access fault */
                do_DataAbort(addr, 15 + (1 << 11), regs);
-               return -1;
        }
 #endif
 
index 0417c165d50d0a8e732b60b5ad767cddbe757851..9296833f91ccd576c7c5dbbacffbf94cb7a28518 100644 (file)
@@ -14,6 +14,7 @@
 #include <asm/mach/map.h>
 
 #include <linux/platform_device.h>
+#include <linux/i2c-gpio.h>
 
 #include <asm/arch/board.h>
 #include <asm/arch/gpio.h>
@@ -435,7 +436,40 @@ void __init at91_add_device_nand(struct at91_nand_data *data) {}
  *  TWI (i2c)
  * -------------------------------------------------------------------- */
 
-#if defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE)
+/*
+ * Prefer the GPIO code since the TWI controller isn't robust
+ * (gets overruns and underruns under load) and can only issue
+ * repeated STARTs in one scenario (the driver doesn't yet handle them).
+ */
+#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
+
+static struct i2c_gpio_platform_data pdata = {
+       .sda_pin                = AT91_PIN_PA25,
+       .sda_is_open_drain      = 1,
+       .scl_pin                = AT91_PIN_PA26,
+       .scl_is_open_drain      = 1,
+       .udelay                 = 2,            /* ~100 kHz */
+};
+
+static struct platform_device at91rm9200_twi_device = {
+       .name                   = "i2c-gpio",
+       .id                     = -1,
+       .dev.platform_data      = &pdata,
+};
+
+void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices)
+{
+       at91_set_GPIO_periph(AT91_PIN_PA25, 1);         /* TWD (SDA) */
+       at91_set_multi_drive(AT91_PIN_PA25, 1);
+
+       at91_set_GPIO_periph(AT91_PIN_PA26, 1);         /* TWCK (SCL) */
+       at91_set_multi_drive(AT91_PIN_PA26, 1);
+
+       i2c_register_board_info(0, devices, nr_devices);
+       platform_device_register(&at91rm9200_twi_device);
+}
+
+#elif defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE)
 
 static struct resource twi_resources[] = {
        [0] = {
@@ -457,7 +491,7 @@ static struct platform_device at91rm9200_twi_device = {
        .num_resources  = ARRAY_SIZE(twi_resources),
 };
 
-void __init at91_add_device_i2c(void)
+void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices)
 {
        /* pins used for TWI interface */
        at91_set_A_periph(AT91_PIN_PA25, 0);            /* TWD */
@@ -466,10 +500,11 @@ void __init at91_add_device_i2c(void)
        at91_set_A_periph(AT91_PIN_PA26, 0);            /* TWCK */
        at91_set_multi_drive(AT91_PIN_PA26, 1);
 
+       i2c_register_board_info(0, devices, nr_devices);
        platform_device_register(&at91rm9200_twi_device);
 }
 #else
-void __init at91_add_device_i2c(void) {}
+void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) {}
 #endif
 
 
index ffd3154c1e5404f2a305b4b4e8ece8b739ad8b02..3091bf47d8c96dafb90e694005c3d2f99df7e1df 100644 (file)
@@ -13,6 +13,7 @@
 #include <asm/mach/map.h>
 
 #include <linux/platform_device.h>
+#include <linux/i2c-gpio.h>
 
 #include <asm/arch/board.h>
 #include <asm/arch/gpio.h>
@@ -352,7 +353,41 @@ void __init at91_add_device_nand(struct at91_nand_data *data) {}
  *  TWI (i2c)
  * -------------------------------------------------------------------- */
 
-#if defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE)
+/*
+ * Prefer the GPIO code since the TWI controller isn't robust
+ * (gets overruns and underruns under load) and can only issue
+ * repeated STARTs in one scenario (the driver doesn't yet handle them).
+ */
+
+#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
+
+static struct i2c_gpio_platform_data pdata = {
+       .sda_pin                = AT91_PIN_PA23,
+       .sda_is_open_drain      = 1,
+       .scl_pin                = AT91_PIN_PA24,
+       .scl_is_open_drain      = 1,
+       .udelay                 = 2,            /* ~100 kHz */
+};
+
+static struct platform_device at91sam9260_twi_device = {
+       .name                   = "i2c-gpio",
+       .id                     = -1,
+       .dev.platform_data      = &pdata,
+};
+
+void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices)
+{
+       at91_set_GPIO_periph(AT91_PIN_PA23, 1);         /* TWD (SDA) */
+       at91_set_multi_drive(AT91_PIN_PA23, 1);
+
+       at91_set_GPIO_periph(AT91_PIN_PA24, 1);         /* TWCK (SCL) */
+       at91_set_multi_drive(AT91_PIN_PA24, 1);
+
+       i2c_register_board_info(0, devices, nr_devices);
+       platform_device_register(&at91sam9260_twi_device);
+}
+
+#elif defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE)
 
 static struct resource twi_resources[] = {
        [0] = {
@@ -374,7 +409,7 @@ static struct platform_device at91sam9260_twi_device = {
        .num_resources  = ARRAY_SIZE(twi_resources),
 };
 
-void __init at91_add_device_i2c(void)
+void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices)
 {
        /* pins used for TWI interface */
        at91_set_A_periph(AT91_PIN_PA23, 0);            /* TWD */
@@ -383,10 +418,11 @@ void __init at91_add_device_i2c(void)
        at91_set_A_periph(AT91_PIN_PA24, 0);            /* TWCK */
        at91_set_multi_drive(AT91_PIN_PA24, 1);
 
+       i2c_register_board_info(0, devices, nr_devices);
        platform_device_register(&at91sam9260_twi_device);
 }
 #else
-void __init at91_add_device_i2c(void) {}
+void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) {}
 #endif
 
 
index 3576595b4941b7ecefcf75b0ab1ec0128f1bc261..64979a9023c2cb4e0a674cbb8cc9303ae0066074 100644 (file)
@@ -14,7 +14,9 @@
 #include <asm/mach/map.h>
 
 #include <linux/platform_device.h>
+#include <linux/i2c-gpio.h>
 
+#include <linux/fb.h>
 #include <video/atmel_lcdc.h>
 
 #include <asm/arch/board.h>
@@ -275,7 +277,40 @@ void __init at91_add_device_nand(struct at91_nand_data *data) {}
  *  TWI (i2c)
  * -------------------------------------------------------------------- */
 
-#if defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE)
+/*
+ * Prefer the GPIO code since the TWI controller isn't robust
+ * (gets overruns and underruns under load) and can only issue
+ * repeated STARTs in one scenario (the driver doesn't yet handle them).
+ */
+#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
+
+static struct i2c_gpio_platform_data pdata = {
+       .sda_pin                = AT91_PIN_PA7,
+       .sda_is_open_drain      = 1,
+       .scl_pin                = AT91_PIN_PA8,
+       .scl_is_open_drain      = 1,
+       .udelay                 = 2,            /* ~100 kHz */
+};
+
+static struct platform_device at91sam9261_twi_device = {
+       .name                   = "i2c-gpio",
+       .id                     = -1,
+       .dev.platform_data      = &pdata,
+};
+
+void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices)
+{
+       at91_set_GPIO_periph(AT91_PIN_PA7, 1);          /* TWD (SDA) */
+       at91_set_multi_drive(AT91_PIN_PA7, 1);
+
+       at91_set_GPIO_periph(AT91_PIN_PA8, 1);          /* TWCK (SCL) */
+       at91_set_multi_drive(AT91_PIN_PA8, 1);
+
+       i2c_register_board_info(0, devices, nr_devices);
+       platform_device_register(&at91sam9261_twi_device);
+}
+
+#elif defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE)
 
 static struct resource twi_resources[] = {
        [0] = {
@@ -297,7 +332,7 @@ static struct platform_device at91sam9261_twi_device = {
        .num_resources  = ARRAY_SIZE(twi_resources),
 };
 
-void __init at91_add_device_i2c(void)
+void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices)
 {
        /* pins used for TWI interface */
        at91_set_A_periph(AT91_PIN_PA7, 0);             /* TWD */
@@ -306,10 +341,11 @@ void __init at91_add_device_i2c(void)
        at91_set_A_periph(AT91_PIN_PA8, 0);             /* TWCK */
        at91_set_multi_drive(AT91_PIN_PA8, 1);
 
+       i2c_register_board_info(0, devices, nr_devices);
        platform_device_register(&at91sam9261_twi_device);
 }
 #else
-void __init at91_add_device_i2c(void) {}
+void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) {}
 #endif
 
 
index f924bd5017de19ef1efac43b5dc125fdcc65ee13..ac329a98e9596ce1e56e784cab86b0c4f1fdab62 100644 (file)
@@ -13,7 +13,9 @@
 #include <asm/mach/map.h>
 
 #include <linux/platform_device.h>
+#include <linux/i2c-gpio.h>
 
+#include <linux/fb.h>
 #include <video/atmel_lcdc.h>
 
 #include <asm/arch/board.h>
@@ -421,7 +423,40 @@ void __init at91_add_device_nand(struct at91_nand_data *data) {}
  *  TWI (i2c)
  * -------------------------------------------------------------------- */
 
-#if defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE)
+/*
+ * Prefer the GPIO code since the TWI controller isn't robust
+ * (gets overruns and underruns under load) and can only issue
+ * repeated STARTs in one scenario (the driver doesn't yet handle them).
+ */
+#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
+
+static struct i2c_gpio_platform_data pdata = {
+       .sda_pin                = AT91_PIN_PB4,
+       .sda_is_open_drain      = 1,
+       .scl_pin                = AT91_PIN_PB5,
+       .scl_is_open_drain      = 1,
+       .udelay                 = 2,            /* ~100 kHz */
+};
+
+static struct platform_device at91sam9263_twi_device = {
+       .name                   = "i2c-gpio",
+       .id                     = -1,
+       .dev.platform_data      = &pdata,
+};
+
+void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices)
+{
+       at91_set_GPIO_periph(AT91_PIN_PB4, 1);          /* TWD (SDA) */
+       at91_set_multi_drive(AT91_PIN_PB4, 1);
+
+       at91_set_GPIO_periph(AT91_PIN_PB5, 1);          /* TWCK (SCL) */
+       at91_set_multi_drive(AT91_PIN_PB5, 1);
+
+       i2c_register_board_info(0, devices, nr_devices);
+       platform_device_register(&at91sam9263_twi_device);
+}
+
+#elif defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE)
 
 static struct resource twi_resources[] = {
        [0] = {
@@ -443,7 +478,7 @@ static struct platform_device at91sam9263_twi_device = {
        .num_resources  = ARRAY_SIZE(twi_resources),
 };
 
-void __init at91_add_device_i2c(void)
+void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices)
 {
        /* pins used for TWI interface */
        at91_set_A_periph(AT91_PIN_PB4, 0);             /* TWD */
@@ -452,10 +487,11 @@ void __init at91_add_device_i2c(void)
        at91_set_A_periph(AT91_PIN_PB5, 0);             /* TWCK */
        at91_set_multi_drive(AT91_PIN_PB5, 1);
 
+       i2c_register_board_info(0, devices, nr_devices);
        platform_device_register(&at91sam9263_twi_device);
 }
 #else
-void __init at91_add_device_i2c(void) {}
+void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) {}
 #endif
 
 
index cd7532bcd4e5ea92a74aa2e4c5caec83fe519c04..2bd60a3dc6233cac740694121785f8edac22f81a 100644 (file)
@@ -10,8 +10,9 @@
 #include <asm/mach/map.h>
 
 #include <linux/platform_device.h>
-#include <linux/fb.h>
+#include <linux/i2c-gpio.h>
 
+#include <linux/fb.h>
 #include <video/atmel_lcdc.h>
 
 #include <asm/arch/board.h>
@@ -169,7 +170,40 @@ void __init at91_add_device_nand(struct at91_nand_data *data) {}
  *  TWI (i2c)
  * -------------------------------------------------------------------- */
 
-#if defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE)
+/*
+ * Prefer the GPIO code since the TWI controller isn't robust
+ * (gets overruns and underruns under load) and can only issue
+ * repeated STARTs in one scenario (the driver doesn't yet handle them).
+ */
+#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
+
+static struct i2c_gpio_platform_data pdata = {
+       .sda_pin                = AT91_PIN_PA23,
+       .sda_is_open_drain      = 1,
+       .scl_pin                = AT91_PIN_PA24,
+       .scl_is_open_drain      = 1,
+       .udelay                 = 2,            /* ~100 kHz */
+};
+
+static struct platform_device at91sam9rl_twi_device = {
+       .name                   = "i2c-gpio",
+       .id                     = -1,
+       .dev.platform_data      = &pdata,
+};
+
+void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices)
+{
+       at91_set_GPIO_periph(AT91_PIN_PA23, 1);         /* TWD (SDA) */
+       at91_set_multi_drive(AT91_PIN_PA23, 1);
+
+       at91_set_GPIO_periph(AT91_PIN_PA24, 1);         /* TWCK (SCL) */
+       at91_set_multi_drive(AT91_PIN_PA24, 1);
+
+       i2c_register_board_info(0, devices, nr_devices);
+       platform_device_register(&at91sam9rl_twi_device);
+}
+
+#elif defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE)
 
 static struct resource twi_resources[] = {
        [0] = {
@@ -191,7 +225,7 @@ static struct platform_device at91sam9rl_twi_device = {
        .num_resources  = ARRAY_SIZE(twi_resources),
 };
 
-void __init at91_add_device_i2c(void)
+void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices)
 {
        /* pins used for TWI interface */
        at91_set_A_periph(AT91_PIN_PA23, 0);            /* TWD */
@@ -200,10 +234,11 @@ void __init at91_add_device_i2c(void)
        at91_set_A_periph(AT91_PIN_PA24, 0);            /* TWCK */
        at91_set_multi_drive(AT91_PIN_PA24, 1);
 
+       i2c_register_board_info(0, devices, nr_devices);
        platform_device_register(&at91sam9rl_twi_device);
 }
 #else
-void __init at91_add_device_i2c(void) {}
+void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) {}
 #endif
 
 
index 76ec856cd4f9fb0ee8ad54f1a54eba769172804d..0f0878294a67c660a8bb2e3b291f5c85212cd3f6 100644 (file)
@@ -128,7 +128,7 @@ static void __init carmeva_board_init(void)
        /* USB Device */
        at91_add_device_udc(&carmeva_udc_data);
        /* I2C */
-       at91_add_device_i2c();
+       at91_add_device_i2c(NULL, 0);
        /* SPI */
        at91_add_device_spi(carmeva_spi_devices, ARRAY_SIZE(carmeva_spi_devices));
        /* Compact Flash */
index dde089922e3bda6afaad9efed6335d38efe7c172..d0aa20c9383e355da4e313e35fd533cb49269263 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
-#include <linux/i2c.h>
 #include <linux/spi/spi.h>
 #include <linux/mtd/physmap.h>
 
@@ -85,12 +84,12 @@ static struct at91_udc_data __initdata csb337_udc_data = {
 };
 
 static struct i2c_board_info __initdata csb337_i2c_devices[] = {
-       { I2C_BOARD_INFO("rtc-ds1307", 0x68),
-         .type = "ds1307",
+       {
+               I2C_BOARD_INFO("rtc-ds1307", 0x68),
+               .type   = "ds1307",
        },
 };
 
-
 static struct at91_cf_data __initdata csb337_cf_data = {
        /*
         * connector P4 on the CSB 337 mates to
@@ -168,9 +167,7 @@ static void __init csb337_board_init(void)
        /* USB Device */
        at91_add_device_udc(&csb337_udc_data);
        /* I2C */
-       at91_add_device_i2c();
-       i2c_register_board_info(0, csb337_i2c_devices,
-                       ARRAY_SIZE(csb337_i2c_devices));
+       at91_add_device_i2c(csb337_i2c_devices, ARRAY_SIZE(csb337_i2c_devices));
        /* Compact Flash */
        at91_set_gpio_input(AT91_PIN_PB22, 1);          /* IOIS16 */
        at91_add_device_cf(&csb337_cf_data);
index 77f04b935b3ab9753110ab15678acdca7a402718..c5c721d27f429291d2f86efb925f2fa1e1dd07be 100644 (file)
@@ -129,7 +129,7 @@ static void __init csb637_board_init(void)
        /* USB Device */
        at91_add_device_udc(&csb637_udc_data);
        /* I2C */
-       at91_add_device_i2c();
+       at91_add_device_i2c(NULL, 0);
        /* SPI */
        at91_add_device_spi(NULL, 0);
        /* NOR flash */
index af497896a96ce761dcb6a45281a7148e1c7e3bd6..40c9e4331706b0a32cac592603bfba036ccefa88 100644 (file)
@@ -124,6 +124,19 @@ static struct spi_board_info dk_spi_devices[] = {
 #endif
 };
 
+static struct i2c_board_info __initdata dk_i2c_devices[] = {
+       {
+               I2C_BOARD_INFO("ics1523", 0x26),
+       },
+       {
+               I2C_BOARD_INFO("x9429", 0x28),
+       },
+       {
+               I2C_BOARD_INFO("at24c", 0x50),
+               .type   = "24c1024",
+       }
+};
+
 static struct mtd_partition __initdata dk_nand_partition[] = {
        {
                .name   = "NAND Partition 1",
@@ -185,7 +198,7 @@ static void __init dk_board_init(void)
        /* Compact Flash */
        at91_add_device_cf(&dk_cf_data);
        /* I2C */
-       at91_add_device_i2c();
+       at91_add_device_i2c(dk_i2c_devices, ARRAY_SIZE(dk_i2c_devices));
        /* SPI */
        at91_add_device_spi(dk_spi_devices, ARRAY_SIZE(dk_spi_devices));
 #ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
index 20458b5548f0669708eeab4f64baf2ceec1301d7..b7b79bb9d6c4b09bd464225adb1e15a415ff16d8 100644 (file)
@@ -91,6 +91,14 @@ static struct at91_mmc_data __initdata eb9200_mmc_data = {
        .wire4          = 1,
 };
 
+static struct i2c_board_info __initdata eb9200_i2c_devices[] = {
+       {
+               I2C_BOARD_INFO("at24c", 0x50),
+               .type   = "24c512",
+       },
+};
+
+
 static void __init eb9200_board_init(void)
 {
        /* Serial */
@@ -102,7 +110,7 @@ static void __init eb9200_board_init(void)
        /* USB Device */
        at91_add_device_udc(&eb9200_udc_data);
        /* I2C */
-       at91_add_device_i2c();
+       at91_add_device_i2c(eb9200_i2c_devices, ARRAY_SIZE(eb9200_i2c_devices));
        /* Compact Flash */
        at91_add_device_cf(&eb9200_cf_data);
        /* SPI */
index 322fdd75a1e431863729b478988cef8d7d8e708d..d05b1b2be9fbe34fd70a0c2912a8372f999f13bc 100644 (file)
@@ -145,7 +145,7 @@ static void __init ek_board_init(void)
        at91_add_device_udc(&ek_udc_data);
        at91_set_multi_drive(ek_udc_data.pullup_pin, 1);        /* pullup_pin is connected to reset */
        /* I2C */
-       at91_add_device_i2c();
+       at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices));
        /* SPI */
        at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
 #ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
index c77d84ce9cae89878b81f68648f49619fab768d6..cf1b7b2f76fbe180a3f8a9537ac4c58c728c798c 100644 (file)
@@ -92,7 +92,7 @@ static void __init kafa_board_init(void)
        /* USB Device */
        at91_add_device_udc(&kafa_udc_data);
        /* I2C */
-       at91_add_device_i2c();
+       at91_add_device_i2c(NULL, 0);
        /* SPI */
        at91_add_device_spi(NULL, 0);
 }
index 7d9b1a278fd63feb961e3ff21466952bae530dd2..4b39b9cda75b48e84b9f49bae5c4f302efa27480 100644 (file)
@@ -124,7 +124,7 @@ static void __init kb9202_board_init(void)
        /* MMC */
        at91_add_device_mmc(0, &kb9202_mmc_data);
        /* I2C */
-       at91_add_device_i2c();
+       at91_add_device_i2c(NULL, 0);
        /* SPI */
        at91_add_device_spi(NULL, 0);
        /* NAND */
index 49cfe7ab4a85652206bf8b4ac6f21b88f16166fb..6acb55c09ae5d384c5e28b9483d0193bbdabe7a1 100644 (file)
@@ -139,7 +139,7 @@ static void __init picotux200_board_init(void)
        // at91_add_device_udc(&picotux200_udc_data);
        // at91_set_multi_drive(picotux200_udc_data.pullup_pin, 1);     /* pullup_pin is connected to reset */
        /* I2C */
-       at91_add_device_i2c();
+       at91_add_device_i2c(NULL, 0);
        /* SPI */
        // at91_add_device_spi(picotux200_spi_devices, ARRAY_SIZE(picotux200_spi_devices));
 #ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
index 65fa532bb4acd134e0945affbe336d33187f7a40..b343a6c28120b2824597d11ab8754a2a699107da 100644 (file)
@@ -189,7 +189,7 @@ static void __init ek_board_init(void)
        /* MMC */
        at91_add_device_mmc(0, &ek_mmc_data);
        /* I2C */
-       at91_add_device_i2c();
+       at91_add_device_i2c(NULL, 0);
 }
 
 MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK")
index 42e172cb0f49bfe2d0e40d9382d574234f712f3e..550ae59a3aca89524def4fdf310d9ce015c848a7 100644 (file)
@@ -382,14 +382,14 @@ static struct platform_device ek_button_device = {
 
 static void __init ek_add_device_buttons(void)
 {
-       at91_set_gpio_input(AT91_PIN_PB27, 0);  /* btn0 */
-       at91_set_deglitch(AT91_PIN_PB27, 1);
-       at91_set_gpio_input(AT91_PIN_PB26, 0);  /* btn1 */
-       at91_set_deglitch(AT91_PIN_PB26, 1);
-       at91_set_gpio_input(AT91_PIN_PB25, 0);  /* btn2 */
-       at91_set_deglitch(AT91_PIN_PB25, 1);
-       at91_set_gpio_input(AT91_PIN_PB24, 0);  /* btn3 */
-       at91_set_deglitch(AT91_PIN_PB24, 1);
+       at91_set_gpio_input(AT91_PIN_PA27, 0);  /* btn0 */
+       at91_set_deglitch(AT91_PIN_PA27, 1);
+       at91_set_gpio_input(AT91_PIN_PA26, 0);  /* btn1 */
+       at91_set_deglitch(AT91_PIN_PA26, 1);
+       at91_set_gpio_input(AT91_PIN_PA25, 0);  /* btn2 */
+       at91_set_deglitch(AT91_PIN_PA25, 1);
+       at91_set_gpio_input(AT91_PIN_PA24, 0);  /* btn3 */
+       at91_set_deglitch(AT91_PIN_PA24, 1);
 
        platform_device_register(&ek_button_device);
 }
@@ -406,7 +406,7 @@ static void __init ek_board_init(void)
        /* USB Device */
        at91_add_device_udc(&ek_udc_data);
        /* I2C */
-       at91_add_device_i2c();
+       at91_add_device_i2c(NULL, 0);
        /* NAND */
        at91_add_device_nand(&ek_nand_data);
        /* DM9000 ethernet */
index 2a1cc73390b79cd88943d7718c3fd3454d3c65fa..ab9dcc0754541f5f952e934c439e525beebf6b7a 100644 (file)
@@ -291,7 +291,7 @@ static void __init ek_board_init(void)
        /* NAND */
        at91_add_device_nand(&ek_nand_data);
        /* I2C */
-       at91_add_device_i2c();
+       at91_add_device_i2c(NULL, 0);
        /* LCD Controller */
        at91_add_device_lcdc(&ek_lcdc_data);
        /* AC97 */
index 9b61320f295aca158355be2ad7ead7596a2cb385..bc0546d7245f7b7df7f125ee4545335cbc1a0586 100644 (file)
@@ -181,7 +181,7 @@ static void __init ek_board_init(void)
        /* Serial */
        at91_add_device_serial();
        /* I2C */
-       at91_add_device_i2c();
+       at91_add_device_i2c(NULL, 0);
        /* NAND */
        at91_add_device_nand(&ek_nand_data);
        /* SPI */
index 848efb2a4ebfbc14cc7bf9426dadc04ca5c194e1..57c3b647ce834f06a790f04f48d18b11e7fd5d65 100644 (file)
@@ -351,7 +351,7 @@ static void init_programmable_clock(struct clk *clk)
        pckr = at91_sys_read(AT91_PMC_PCKR(clk->id));
        parent = at91_css_to_clk(pckr & AT91_PMC_CSS);
        clk->parent = parent;
-       clk->rate_hz = parent->rate_hz / (1 << ((pckr >> 2) & 3));
+       clk->rate_hz = parent->rate_hz / (1 << ((pckr & AT91_PMC_PRES) >> 2));
 }
 
 #endif /* CONFIG_AT91_PROGRAMMABLE_CLOCKS */
@@ -587,8 +587,11 @@ int __init at91_clock_init(unsigned long main_clock)
        mckr = at91_sys_read(AT91_PMC_MCKR);
        mck.parent = at91_css_to_clk(mckr & AT91_PMC_CSS);
        freq = mck.parent->rate_hz;
-       freq /= (1 << ((mckr >> 2) & 3));               /* prescale */
-       mck.rate_hz = freq / (1 + ((mckr >> 8) & 3));   /* mdiv */
+       freq /= (1 << ((mckr & AT91_PMC_PRES) >> 2));                           /* prescale */
+       if (cpu_is_at91rm9200())
+               mck.rate_hz = freq / (1 + ((mckr & AT91_PMC_MDIV) >> 8));       /* mdiv */
+       else
+               mck.rate_hz = freq / (1 << ((mckr & AT91_PMC_MDIV) >> 8));      /* mdiv */
 
        /* Register the PMC's standard clocks */
        for (i = 0; i < ARRAY_SIZE(standard_pmc_clocks); i++)
index 0791b56caeccf827b8405426f23506b9327fce25..a7465db8489373a54bc785a4d0a72a809698c327 100644 (file)
  *
  */
 
-#define INTENNUM_OFF              0x8
-#define INTDISNUM_OFF             0xC
+#define INTCNTL_OFF               0x00
+#define NIMASK_OFF                0x04
+#define INTENNUM_OFF              0x08
+#define INTDISNUM_OFF             0x0C
+#define INTENABLEH_OFF            0x10
+#define INTENABLEL_OFF            0x14
+#define INTTYPEH_OFF              0x18
+#define INTTYPEL_OFF              0x1C
+#define NIPRIORITY_OFF(x)         (0x20+4*(7-(x)))
+#define NIVECSR_OFF               0x40
+#define FIVECSR_OFF               0x44
+#define INTSRCH_OFF               0x48
+#define INTSRCL_OFF               0x4C
+#define INTFRCH_OFF               0x50
+#define INTFRCL_OFF               0x54
+#define NIPNDH_OFF                0x58
+#define NIPNDL_OFF                0x5C
+#define FIPNDH_OFF                0x60
+#define FIPNDL_OFF                0x64
 
 #define VA_AITC_BASE              IO_ADDRESS(IMX_AITC_BASE)
-#define IMX_AITC_INTDISNUM       (VA_AITC_BASE + INTDISNUM_OFF)
+#define IMX_AITC_INTCNTL         (VA_AITC_BASE + INTCNTL_OFF)
+#define IMX_AITC_NIMASK          (VA_AITC_BASE + NIMASK_OFF)
 #define IMX_AITC_INTENNUM        (VA_AITC_BASE + INTENNUM_OFF)
+#define IMX_AITC_INTDISNUM       (VA_AITC_BASE + INTDISNUM_OFF)
+#define IMX_AITC_INTENABLEH      (VA_AITC_BASE + INTENABLEH_OFF)
+#define IMX_AITC_INTENABLEL      (VA_AITC_BASE + INTENABLEL_OFF)
+#define IMX_AITC_INTTYPEH        (VA_AITC_BASE + INTTYPEH_OFF)
+#define IMX_AITC_INTTYPEL        (VA_AITC_BASE + INTTYPEL_OFF)
+#define IMX_AITC_NIPRIORITY(x)   (VA_AITC_BASE + NIPRIORITY_OFF(x))
+#define IMX_AITC_NIVECSR         (VA_AITC_BASE + NIVECSR_OFF)
+#define IMX_AITC_FIVECSR         (VA_AITC_BASE + FIVECSR_OFF)
+#define IMX_AITC_INTSRCH         (VA_AITC_BASE + INTSRCH_OFF)
+#define IMX_AITC_INTSRCL         (VA_AITC_BASE + INTSRCL_OFF)
+#define IMX_AITC_INTFRCH         (VA_AITC_BASE + INTFRCH_OFF)
+#define IMX_AITC_INTFRCL         (VA_AITC_BASE + INTFRCL_OFF)
+#define IMX_AITC_NIPNDH          (VA_AITC_BASE + NIPNDH_OFF)
+#define IMX_AITC_NIPNDL          (VA_AITC_BASE + NIPNDL_OFF)
+#define IMX_AITC_FIPNDH          (VA_AITC_BASE + FIPNDH_OFF)
+#define IMX_AITC_FIPNDL          (VA_AITC_BASE + FIPNDL_OFF)
 
 #if 0
 #define DEBUG_IRQ(fmt...)      printk(fmt)
@@ -222,7 +256,12 @@ imx_init_irq(void)
 
        DEBUG_IRQ("Initializing imx interrupts\n");
 
-       /* Mask all interrupts initially */
+       /* Disable all interrupts initially. */
+       /* Do not rely on the bootloader. */
+       __raw_writel(0, IMX_AITC_INTENABLEH);
+       __raw_writel(0, IMX_AITC_INTENABLEL);
+
+       /* Mask all GPIO interrupts as well */
        IMR(0) = 0;
        IMR(1) = 0;
        IMR(2) = 0;
@@ -245,6 +284,6 @@ imx_init_irq(void)
        set_irq_chained_handler(GPIO_INT_PORTC, imx_gpioc_demux_handler);
        set_irq_chained_handler(GPIO_INT_PORTD, imx_gpiod_demux_handler);
 
-       /* Disable all interrupts initially. */
-       /* In IMX this is done in the bootloader. */
+       /* Release masking of interrupts according to priority */
+       __raw_writel(-1, IMX_AITC_NIMASK);
 }
index d0f2b597db12541ae15514dcf86d8e8d479e8490..8e126e6b74c31be9e7f34cad14334ae70363dd7b 100644 (file)
@@ -146,7 +146,7 @@ static struct clk pxa27x_clks[] = {
        INIT_CKEN("MMCCLK",  MMC,  19500000, 0, &pxa_device_mci.dev),
        INIT_CKEN("FICPCLK", FICP, 48000000, 0, &pxa_device_ficp.dev),
 
-       INIT_CKEN("USBCLK", USB,    48000000, 0, &pxa27x_device_ohci.dev),
+       INIT_CKEN("USBCLK", USBHOST, 48000000, 0, &pxa27x_device_ohci.dev),
        INIT_CKEN("I2CCLK", PWRI2C, 13000000, 0, &pxa27x_device_i2c_power.dev),
        INIT_CKEN("KBDCLK", KEYPAD, 32768, 0, NULL),
 
index 1010f77d977a480ea8295aa359277ae9e44f0a4d..74128eb8f8d0dd5983585c89203e45410e53cfbc 100644 (file)
 static struct pxa3xx_mfp_addr_map pxa320_mfp_addr_map[] __initdata = {
 
        MFP_ADDR_X(GPIO0,  GPIO4,   0x0124),
-       MFP_ADDR_X(GPIO5,  GPIO26,  0x028C),
-       MFP_ADDR_X(GPIO27, GPIO62,  0x0400),
+       MFP_ADDR_X(GPIO5,  GPIO9,   0x028C),
+       MFP_ADDR(GPIO10, 0x0458),
+       MFP_ADDR_X(GPIO11, GPIO26,  0x02A0),
+       MFP_ADDR_X(GPIO27, GPIO48,  0x0400),
+       MFP_ADDR_X(GPIO49, GPIO62,  0x045C),
        MFP_ADDR_X(GPIO63, GPIO73,  0x04B4),
        MFP_ADDR_X(GPIO74, GPIO98,  0x04F0),
        MFP_ADDR_X(GPIO99, GPIO127, 0x0600),
index 71766ac0328b1378f23afde4a656143fd4ba4d2e..422afee88169414dbd5cb74f57f481b7cbc240e5 100644 (file)
@@ -309,6 +309,7 @@ void ssp_exit(struct ssp_dev *dev)
 
        if (dev->port > PXA_SSP_PORTS || dev->port == 0) {
                printk(KERN_WARNING "SSP: tried to close invalid port\n");
+               mutex_unlock(&mutex);
                return;
        }
 
index af3a011b2b244719d95a32a500b4eb72e47c4f45..352fcb8926a62ca506cb0f7f33d8df4a8f22e778 100644 (file)
@@ -585,11 +585,11 @@ serial_pxa_type(struct uart_port *port)
        return up->name;
 }
 
-#ifdef CONFIG_SERIAL_PXA_CONSOLE
-
 static struct uart_pxa_port *serial_pxa_ports[4];
 static struct uart_driver serial_pxa_reg;
 
+#ifdef CONFIG_SERIAL_PXA_CONSOLE
+
 #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)
 
 /*
index c0d7075982c16d9dee7884c8b0c29080de97b559..79054965baa636c41582d928a29def0c63286477 100644 (file)
@@ -33,6 +33,7 @@
 
 #include <linux/mtd/partitions.h>
 #include <linux/device.h>
+#include <linux/i2c.h>
 #include <linux/spi/spi.h>
 
  /* USB Device */
@@ -94,7 +95,7 @@ struct at91_nand_data {
 extern void __init at91_add_device_nand(struct at91_nand_data *data);
 
  /* I2C*/
-extern void __init at91_add_device_i2c(void);
+extern void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices);
 
  /* SPI */
 extern void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices);
index e6963958572167bbc515d07302fa1c8253f47004..27c580898958f2ab96551b1417df33ce86f9179a 100644 (file)
  */
 #define NR_IXP23XX_MACH_IRQS           32
 
-#define NR_IRQS                                NR_IXP23XX_IRQS + NR_IXP23XX_MACH_IRQS
+#define NR_IRQS                                (NR_IXP23XX_IRQS + NR_IXP23XX_MACH_IRQS)
 
 #define IXP23XX_MACH_IRQ(irq)          (NR_IXP23XX_IRQ + (irq))
 
index b3cf33441f6e6915e991d6fa9e1cad314343d8b2..56d2c98e143c6abfcdbdd8c48314654cba16ee4e 100644 (file)
@@ -37,7 +37,7 @@
 #define OMAP1510P1_EMIFF_PRI_VALUE             0x00
 
 #define NR_FPGA_IRQS           24
-#define NR_IRQS                 IH_BOARD_BASE + NR_FPGA_IRQS
+#define NR_IRQS                 (IH_BOARD_BASE + NR_FPGA_IRQS)
 
 #ifndef __ASSEMBLY__
 void fpga_write(unsigned char val, int reg);
index 6238dbf7a2361ce0a628ee3a2e16b8c4093f2fbb..b76ee6d1f5b44b7949a29504561086aa41ef6c92 100644 (file)
@@ -13,7 +13,7 @@
 
 #define PXA_IRQ(x)     (x)
 
-#ifdef CONFIG_PXA27x
+#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
 #define IRQ_SSP3       PXA_IRQ(0)      /* SSP3 service request */
 #define IRQ_MSL                PXA_IRQ(1)      /* MSL Interface interrupt */
 #define IRQ_USBH2      PXA_IRQ(2)      /* USB Host interrupt 1 (OHCI) */
 #define        IRQ_RTC1Hz      PXA_IRQ(30)     /* RTC HZ Clock Tick */
 #define        IRQ_RTCAlrm     PXA_IRQ(31)     /* RTC Alarm */
 
-#ifdef CONFIG_PXA27x
+#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
 #define IRQ_TPM                PXA_IRQ(32)     /* TPM interrupt */
 #define IRQ_CAMERA     PXA_IRQ(33)     /* Camera Interface */
 #endif
 
+#ifdef CONFIG_PXA3xx
+#define IRQ_SSP4       PXA_IRQ(13)     /* SSP4 service request */
+#define IRQ_CIR                PXA_IRQ(34)     /* Consumer IR */
+#define IRQ_TSI                PXA_IRQ(36)     /* Touch Screen Interface (PXA320) */
+#define IRQ_USIM2      PXA_IRQ(38)     /* USIM2 Controller */
+#define IRQ_GRPHICS    PXA_IRQ(39)     /* Graphics Controller */
+#define IRQ_MMC2       PXA_IRQ(41)     /* MMC2 Controller */
+#define IRQ_1WIRE      PXA_IRQ(44)     /* 1-Wire Controller */
+#define IRQ_NAND       PXA_IRQ(45)     /* NAND Controller */
+#define IRQ_USB2       PXA_IRQ(46)     /* USB 2.0 Device Controller */
+#define IRQ_WAKEUP0    PXA_IRQ(49)     /* EXT_WAKEUP0 */
+#define IRQ_WAKEUP1    PXA_IRQ(50)     /* EXT_WAKEUP1 */
+#define IRQ_DMEMC      PXA_IRQ(51)     /* Dynamic Memory Controller */
+#define IRQ_MMC3       PXA_IRQ(55)     /* MMC3 Controller (PXA310) */
+#endif
+
 #define PXA_GPIO_IRQ_BASE      (64)
 #define PXA_GPIO_IRQ_NUM       (128)
 
index 822a27cd7864e3e6e7b8978424ed4ce1406aa80e..a209966498897848f319e7d340efdee8a255b3f0 100644 (file)
 #define GPIO62_LCD_CS_N                MFP_CFG_DRV(GPIO62, AF2, DS01X)
 #define GPIO72_LCD_FCLK                MFP_CFG_DRV(GPIO72, AF1, DS01X)
 #define GPIO73_LCD_LCLK                MFP_CFG_DRV(GPIO73, AF1, DS01X)
-#define GPIO74_LCD_PCLK                MFP_CFG_DRV(GPIO74, AF1, DS01X)
+#define GPIO74_LCD_PCLK                MFP_CFG_DRV(GPIO74, AF1, DS02X)
 #define GPIO75_LCD_BIAS                MFP_CFG_DRV(GPIO75, AF1, DS01X)
 #define GPIO76_LCD_VSYNC       MFP_CFG_DRV(GPIO76, AF2, DS01X)
 
index 488a5bbc49e994ac1d65a7db3445baa9f2696459..52deedcaf3bd5fe3ebb9aa966302b49e3b729bc0 100644 (file)
@@ -18,7 +18,7 @@
 #include <asm/arch/mfp.h>
 
 /* GPIO */
-#define GPIO46_GPIO            MFP_CFG(GPIO6, AF0)
+#define GPIO46_GPIO            MFP_CFG(GPIO46, AF0)
 #define GPIO49_GPIO            MFP_CFG(GPIO49, AF0)
 #define GPIO50_GPIO            MFP_CFG(GPIO50, AF0)
 #define GPIO51_GPIO            MFP_CFG(GPIO51, AF0)
index ac4157af5a8e5878a2883358fb9c5bb5e499b21b..03c508d94f0e86c2b8b3633a1fa2aed18df89a80 100644 (file)
@@ -346,23 +346,31 @@ typedef uint32_t mfp_cfg_t;
 #define MFP_CFG_PIN(mfp_cfg)   (((mfp_cfg) >> 16) & 0xffff)
 #define MFP_CFG_VAL(mfp_cfg)   ((mfp_cfg) & 0xffff)
 
-#define MFPR_DEFAULT   (0x0000)
+/*
+ * MFP register defaults to
+ *   drive strength fast 3mA (010'b)
+ *   edge detection logic disabled
+ *   alternate function 0
+ */
+#define MFPR_DEFAULT   (0x0840)
 
 #define MFP_CFG(pin, af)               \
        ((MFP_PIN_##pin << 16) | MFPR_DEFAULT | (MFP_##af))
 
 #define MFP_CFG_DRV(pin, af, drv)      \
-       ((MFP_PIN_##pin << 16) | MFPR_DEFAULT |\
+       ((MFP_PIN_##pin << 16) | (MFPR_DEFAULT & ~MFPR_DRV_MASK) |\
         ((MFP_##drv) << 10) | (MFP_##af))
 
 #define MFP_CFG_LPM(pin, af, lpm)      \
-       ((MFP_PIN_##pin << 16) | MFPR_DEFAULT | (MFP_##af) |\
+       ((MFP_PIN_##pin << 16) | (MFPR_DEFAULT & ~MFPR_LPM_MASK) |\
         (((MFP_LPM_##lpm) & 0x3) << 7)  |\
         (((MFP_LPM_##lpm) & 0x4) << 12) |\
-        (((MFP_LPM_##lpm) & 0x8) << 10))
+        (((MFP_LPM_##lpm) & 0x8) << 10) |\
+        (MFP_##af))
 
 #define MFP_CFG_X(pin, af, drv, lpm)   \
-       ((MFP_PIN_##pin << 16) | MFPR_DEFAULT |\
+       ((MFP_PIN_##pin << 16) |\
+        (MFPR_DEFAULT & ~(MFPR_DRV_MASK | MFPR_LPM_MASK)) |\
         ((MFP_##drv) << 10) | (MFP_##af) |\
         (((MFP_LPM_##lpm) & 0x3) << 7)  |\
         (((MFP_LPM_##lpm) & 0x4) << 12) |\
index bb68b598c4360ab4d7d81463534238cfa42651cf..6b33df6f1995055e9e0b38de9e67b0da13961a65 100644 (file)
 #define DALGN          __REG(0x400000a0)  /* DMA Alignment Register */
 #define DINT           __REG(0x400000f0)  /* DMA Interrupt Register */
 
-#define DRCMR(n)       __REG2(0x40000100, (n)<<2)
+#define DRCMR(n)       (*(((n) < 64) ? \
+                       &__REG2(0x40000100, ((n) & 0x3f) << 2) : \
+                       &__REG2(0x40001100, ((n) & 0x3f) << 2)))
+
 #define DRCMR0         __REG(0x40000100)  /* Request to Channel Map Register for DREQ 0 */
 #define DRCMR1         __REG(0x40000104)  /* Request to Channel Map Register for DREQ 1 */
 #define DRCMR2         __REG(0x40000108)  /* Request to Channel Map Register for I2S receive Request */
index c31cd3682a0b77ded3ac4e76cded3f427537a551..202465a193c11f30f90d07534e04f2ddfbc10b24 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2881,6 +2881,8 @@ static void *cache_free_debugcheck(struct kmem_cache *cachep, void *objp,
        unsigned int objnr;
        struct slab *slabp;
 
+       BUG_ON(virt_to_cache(objp) != cachep);
+
        objp -= obj_offset(cachep);
        kfree_debugcheck(objp);
        page = virt_to_head_page(objp);
@@ -3759,8 +3761,6 @@ void kmem_cache_free(struct kmem_cache *cachep, void *objp)
 {
        unsigned long flags;
 
-       BUG_ON(virt_to_cache(objp) != cachep);
-
        local_irq_save(flags);
        debug_check_no_locks_freed(objp, obj_size(cachep));
        __cache_free(cachep, objp);