Merge branch 'davinci-next' of git://gitorious.org/linux-davinci/linux-davinci into...
authorRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 10 Jun 2011 07:57:14 +0000 (08:57 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 10 Jun 2011 07:57:14 +0000 (08:57 +0100)
17 files changed:
arch/arm/boot/compressed/head.S
arch/arm/kernel/devtree.c
arch/arm/kernel/entry-armv.S
arch/arm/kernel/entry-common.S
arch/arm/kernel/traps.c
arch/arm/mach-mxs/ocotp.c
arch/arm/mach-u300/clock.h
arch/arm/mach-u300/include/mach/u300-regs.h
arch/arm/mach-u300/timer.c
arch/arm/mach-vexpress/v2m.c
arch/arm/mm/context.c
arch/arm/mm/init.c
arch/arm/mm/proc-arm7tdmi.S
arch/arm/mm/proc-arm9tdmi.S
arch/arm/mm/proc-v7.S
arch/arm/plat-mxc/devices/platform-imx-dma.c
drivers/mmc/host/mmci.c

index f9da41921c521e216f07816eb5cab99c041f4845..942fad97e4472c8e27b98068efaafc1cc518787e 100644 (file)
@@ -691,9 +691,9 @@ proc_types:
 
                .word   0x41069260              @ ARM926EJ-S (v5TEJ)
                .word   0xff0ffff0
-               b       __arm926ejs_mmu_cache_on
-               b       __armv4_mmu_cache_off
-               b       __armv5tej_mmu_cache_flush
+               W(b)    __arm926ejs_mmu_cache_on
+               W(b)    __armv4_mmu_cache_off
+               W(b)    __armv5tej_mmu_cache_flush
 
                .word   0x00007000              @ ARM7 IDs
                .word   0x0000f000
index a701e4226a6c85f804ce13a627de3d6d82127464..0cdd7b456cb2a072ce3902f2a6d7934967b083d7 100644 (file)
@@ -76,6 +76,9 @@ struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys)
        unsigned long dt_root;
        const char *model;
 
+       if (!dt_phys)
+               return NULL;
+
        devtree = phys_to_virt(dt_phys);
 
        /* check device tree validity */
index e8d88567680718167cf2fe389dbe4af3e0155887..90c62cd51ca9ffc891f7c95336b1c2017097d512 100644 (file)
@@ -435,6 +435,10 @@ __irq_usr:
        usr_entry
        kuser_cmpxchg_check
 
+#ifdef CONFIG_IRQSOFF_TRACER
+       bl      trace_hardirqs_off
+#endif
+
        get_thread_info tsk
 #ifdef CONFIG_PREEMPT
        ldr     r8, [tsk, #TI_PREEMPT]          @ get preempt count
@@ -453,7 +457,7 @@ __irq_usr:
 #endif
 
        mov     why, #0
-       b       ret_to_user
+       b       ret_to_user_from_irq
  UNWIND(.fnend         )
 ENDPROC(__irq_usr)
 
index 1e7b04a40a3164f7226ce82907012acb231fec45..b2a27b6b0046ee6c1e0f0928c3269ab5f6c63cd2 100644 (file)
@@ -64,6 +64,7 @@ work_resched:
 ENTRY(ret_to_user)
 ret_slow_syscall:
        disable_irq                             @ disable interrupts
+ENTRY(ret_to_user_from_irq)
        ldr     r1, [tsk, #TI_FLAGS]
        tst     r1, #_TIF_WORK_MASK
        bne     work_pending
@@ -75,6 +76,7 @@ no_work_pending:
        arch_ret_to_user r1, lr
 
        restore_user_regs fast = 0, offset = 0
+ENDPROC(ret_to_user_from_irq)
 ENDPROC(ret_to_user)
 
 /*
index d52eec268b4746a006ef3badf6805b8acae5d7e1..6807cb1e76ddb119f78100aa3ccc7d59b1184721 100644 (file)
@@ -139,7 +139,7 @@ static void dump_instr(const char *lvl, struct pt_regs *regs)
        fs = get_fs();
        set_fs(KERNEL_DS);
 
-       for (i = -4; i < 1; i++) {
+       for (i = -4; i < 1 + !!thumb; i++) {
                unsigned int val, bad;
 
                if (thumb)
@@ -563,7 +563,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
                if (!pmd_present(*pmd))
                        goto bad_access;
                pte = pte_offset_map_lock(mm, pmd, addr, &ptl);
-               if (!pte_present(*pte) || !pte_dirty(*pte)) {
+               if (!pte_present(*pte) || !pte_write(*pte) || !pte_dirty(*pte)) {
                        pte_unmap_unlock(pte, ptl);
                        goto bad_access;
                }
index 65157a35dbba351d6751bdcb4ee483e37b25ee88..54add60f94c98c5d8d15c119e996395a13b6fc86 100644 (file)
@@ -16,6 +16,8 @@
 #include <linux/err.h>
 #include <linux/mutex.h>
 
+#include <asm/processor.h>     /* for cpu_relax() */
+
 #include <mach/mxs.h>
 
 #define OCOTP_WORD_OFFSET              0x20
index c34f3ea3017c4db1b4da624b12c1f800e24a91b0..4f50ca8f901e2bebd5de51defd425ba9e83f9ff4 100644 (file)
@@ -31,7 +31,7 @@ struct clk {
        bool reset;
        __u16 clk_val;
        __s8 usecount;
-       __u32 res_reg;
+       void __iomem * res_reg;
        __u16 res_mask;
 
        bool hw_ctrld;
index 8b85df4c8d8fcce5530535ffb2d91e15f25b636d..035fdc9dbdb03ebb50e88873a67232707d4fbc50 100644 (file)
  * the defines are used for setting up the I/O memory mapping.
  */
 
+#ifdef __ASSEMBLER__
+#define IOMEM(a) (a)
+#else
+#define IOMEM(a) (void __iomem *) a
+#endif
+
 /* NAND Flash CS0 */
 #define U300_NAND_CS0_PHYS_BASE                0x80000000
 
 #define U300_SEMI_CONFIG_BASE          0x30000000
 #endif
 
-/*
- * All the following peripherals are specified at their PHYSICAL address,
- * so if you need to access them (in the kernel), you MUST use the macros
- * defined in <asm/io.h> to map to the IO_ADDRESS_AHB() IO_ADDRESS_FAST()
- * etc.
- */
-
 /*
  * AHB peripherals
  */
 
 /* Vectored Interrupt Controller 0, servicing 32 interrupts */
 #define U300_INTCON0_BASE              (U300_AHB_PER_PHYS_BASE+0x1000)
-#define U300_INTCON0_VBASE             (U300_AHB_PER_VIRT_BASE+0x1000)
+#define U300_INTCON0_VBASE             IOMEM(U300_AHB_PER_VIRT_BASE+0x1000)
 
 /* Vectored Interrupt Controller 1, servicing 32 interrupts */
 #define U300_INTCON1_BASE              (U300_AHB_PER_PHYS_BASE+0x2000)
-#define U300_INTCON1_VBASE             (U300_AHB_PER_VIRT_BASE+0x2000)
+#define U300_INTCON1_VBASE             IOMEM(U300_AHB_PER_VIRT_BASE+0x2000)
 
 /* Memory Stick Pro (MSPRO) controller */
 #define U300_MSPRO_BASE                        (U300_AHB_PER_PHYS_BASE+0x3000)
 
 /* SYSCON */
 #define U300_SYSCON_BASE               (U300_SLOW_PER_PHYS_BASE+0x1000)
-#define U300_SYSCON_VBASE              (U300_SLOW_PER_VIRT_BASE+0x1000)
+#define U300_SYSCON_VBASE              IOMEM(U300_SLOW_PER_VIRT_BASE+0x1000)
 
 /* Watchdog */
 #define U300_WDOG_BASE                 (U300_SLOW_PER_PHYS_BASE+0x2000)
 
 /* APP side special timer */
 #define U300_TIMER_APP_BASE            (U300_SLOW_PER_PHYS_BASE+0x4000)
-#define U300_TIMER_APP_VBASE           (U300_SLOW_PER_VIRT_BASE+0x4000)
+#define U300_TIMER_APP_VBASE           IOMEM(U300_SLOW_PER_VIRT_BASE+0x4000)
 
 /* Keypad */
 #define U300_KEYPAD_BASE               (U300_SLOW_PER_PHYS_BASE+0x5000)
  * Virtual accessor macros for static devices
  */
 
-
 #endif
index 891cf44591e073ea4de84968d33f598595a8263c..18d7fa0603c230259ff96d3f9dc910b4a53a3b04 100644 (file)
@@ -411,8 +411,7 @@ static void __init u300_timer_init(void)
        /* Use general purpose timer 2 as clock source */
        if (clocksource_mmio_init(U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT2CC,
                        "GPT2", rate, 300, 32, clocksource_mmio_readl_up))
-               printk(KERN_ERR "timer: failed to initialize clock "
-                      "source %s\n", clocksource_u300_1mhz.name);
+               pr_err("timer: failed to initialize U300 clock source\n");
 
        clockevents_calc_mult_shift(&clockevent_u300_1mhz,
                                    rate, APPTIMER_MIN_RANGE);
index 285edcd2da2aa9a9d6186a6c17cf053918b0b66e..9e6b93b1a04342e7883aa241ddecb02856818a0e 100644 (file)
@@ -46,12 +46,6 @@ static struct map_desc v2m_io_desc[] __initdata = {
        },
 };
 
-static void __init v2m_init_early(void)
-{
-       ct_desc->init_early();
-       versatile_sched_clock_init(MMIO_P2V(V2M_SYS_24MHZ), 24000000);
-}
-
 static void __init v2m_timer_init(void)
 {
        u32 scctrl;
@@ -365,6 +359,13 @@ static struct clk_lookup v2m_lookups[] = {
        },
 };
 
+static void __init v2m_init_early(void)
+{
+       ct_desc->init_early();
+       clkdev_add_table(v2m_lookups, ARRAY_SIZE(v2m_lookups));
+       versatile_sched_clock_init(MMIO_P2V(V2M_SYS_24MHZ), 24000000);
+}
+
 static void v2m_power_off(void)
 {
        if (v2m_cfg_write(SYS_CFG_SHUTDOWN | SYS_CFG_SITE_MB, 0))
@@ -418,8 +419,6 @@ static void __init v2m_init(void)
 {
        int i;
 
-       clkdev_add_table(v2m_lookups, ARRAY_SIZE(v2m_lookups));
-
        platform_device_register(&v2m_pcie_i2c_device);
        platform_device_register(&v2m_ddc_i2c_device);
        platform_device_register(&v2m_flash_device);
index 8bfae964b133987e061c430a0426f951b07172fa..b0ee9ba3cfab41a52853eca727466abff88ddf27 100644 (file)
@@ -24,7 +24,9 @@ DEFINE_PER_CPU(struct mm_struct *, current_mm);
 
 /*
  * We fork()ed a process, and we need a new context for the child
- * to run in.
+ * to run in.  We reserve version 0 for initial tasks so we will
+ * always allocate an ASID. The ASID 0 is reserved for the TTBR
+ * register changing sequence.
  */
 void __init_new_context(struct task_struct *tsk, struct mm_struct *mm)
 {
@@ -34,11 +36,8 @@ void __init_new_context(struct task_struct *tsk, struct mm_struct *mm)
 
 static void flush_context(void)
 {
-       u32 ttb;
-       /* Copy TTBR1 into TTBR0 */
-       asm volatile("mrc       p15, 0, %0, c2, c0, 1\n"
-                    "mcr       p15, 0, %0, c2, c0, 0"
-                    : "=r" (ttb));
+       /* set the reserved ASID before flushing the TLB */
+       asm("mcr        p15, 0, %0, c13, c0, 1\n" : : "r" (0));
        isb();
        local_flush_tlb_all();
        if (icache_is_vivt_asid_tagged()) {
@@ -94,7 +93,7 @@ static void reset_context(void *info)
                return;
 
        smp_rmb();
-       asid = cpu_last_asid + cpu;
+       asid = cpu_last_asid + cpu + 1;
 
        flush_context();
        set_mm_context(mm, asid);
@@ -144,13 +143,13 @@ void __new_context(struct mm_struct *mm)
         * to start a new version and flush the TLB.
         */
        if (unlikely((asid & ~ASID_MASK) == 0)) {
-               asid = cpu_last_asid + smp_processor_id();
+               asid = cpu_last_asid + smp_processor_id() + 1;
                flush_context();
 #ifdef CONFIG_SMP
                smp_wmb();
                smp_call_function(reset_context, NULL, 1);
 #endif
-               cpu_last_asid += NR_CPUS - 1;
+               cpu_last_asid += NR_CPUS;
        }
 
        set_mm_context(mm, asid);
index 2c2cce9cd8c8399e02cf841298649daf72d06330..b2cf9460ea604a1ed2c2934b412d57cd677efb1a 100644 (file)
@@ -635,7 +635,8 @@ void __init mem_init(void)
                        "    modules : 0x%08lx - 0x%08lx   (%4ld MB)\n"
                        "      .init : 0x%p" " - 0x%p" "   (%4d kB)\n"
                        "      .text : 0x%p" " - 0x%p" "   (%4d kB)\n"
-                       "      .data : 0x%p" " - 0x%p" "   (%4d kB)\n",
+                       "      .data : 0x%p" " - 0x%p" "   (%4d kB)\n"
+                       "       .bss : 0x%p" " - 0x%p" "   (%4d kB)\n",
 
                        MLK(UL(CONFIG_VECTORS_BASE), UL(CONFIG_VECTORS_BASE) +
                                (PAGE_SIZE)),
@@ -657,7 +658,8 @@ void __init mem_init(void)
 
                        MLK_ROUNDUP(__init_begin, __init_end),
                        MLK_ROUNDUP(_text, _etext),
-                       MLK_ROUNDUP(_sdata, _edata));
+                       MLK_ROUNDUP(_sdata, _edata),
+                       MLK_ROUNDUP(__bss_start, __bss_stop));
 
 #undef MLK
 #undef MLM
index e4c165ca669680eb6d74ce8e3d5822de50bbe44f..537ffcb0646d5e0c77ef8a336f4b39b07937beab 100644 (file)
@@ -146,7 +146,7 @@ __arm7tdmi_proc_info:
                .long   0
                .long   0
                .long   v4_cache_fns
-               .size   __arm7tdmi_proc_info, . - __arm7dmi_proc_info
+               .size   __arm7tdmi_proc_info, . - __arm7tdmi_proc_info
 
                .type   __triscenda7_proc_info, #object
 __triscenda7_proc_info:
index 7b7ebd4d096d9cb3939bed7a059be8514486d463..546b54da10059752195476dc6bd9fc0b1b243775 100644 (file)
@@ -116,7 +116,7 @@ __arm9tdmi_proc_info:
                .long   0
                .long   0
                .long   v4_cache_fns
-               .size   __arm9tdmi_proc_info, . - __arm9dmi_proc_info
+               .size   __arm9tdmi_proc_info, . - __arm9tdmi_proc_info
 
                .type   __p2001_proc_info, #object
 __p2001_proc_info:
index b3b566ec83d397c1074c1dcbee0d5e33542e7d9c..3c3867850a3011d1e163d347a25ffbabc4aa4dc7 100644 (file)
@@ -108,16 +108,18 @@ ENTRY(cpu_v7_switch_mm)
 #ifdef CONFIG_ARM_ERRATA_430973
        mcr     p15, 0, r2, c7, c5, 6           @ flush BTAC/BTB
 #endif
-       mrc     p15, 0, r2, c2, c0, 1           @ load TTB 1
-       mcr     p15, 0, r2, c2, c0, 0           @ into TTB 0
+#ifdef CONFIG_ARM_ERRATA_754322
+       dsb
+#endif
+       mcr     p15, 0, r2, c13, c0, 1          @ set reserved context ID
+       isb
+1:     mcr     p15, 0, r0, c2, c0, 0           @ set TTB 0
        isb
 #ifdef CONFIG_ARM_ERRATA_754322
        dsb
 #endif
        mcr     p15, 0, r1, c13, c0, 1          @ set context ID
        isb
-       mcr     p15, 0, r0, c2, c0, 0           @ set TTB 0
-       isb
 #endif
        mov     pc, lr
 ENDPROC(cpu_v7_switch_mm)
index 3538b85ede910a4bc32c8e85b604789809cef21d..b130f60ca6b73e9b7b8435dcc52633bb1761078c 100644 (file)
@@ -139,7 +139,7 @@ static struct sdma_script_start_addrs addr_imx35_to2 = {
 #endif
 
 #ifdef CONFIG_SOC_IMX51
-static struct sdma_script_start_addrs addr_imx51_to1 = {
+static struct sdma_script_start_addrs addr_imx51 = {
        .ap_2_ap_addr = 642,
        .uart_2_mcu_addr = 817,
        .mcu_2_app_addr = 747,
@@ -196,7 +196,9 @@ static int __init imxXX_add_imx_dma(void)
 
 #if defined(CONFIG_SOC_IMX51)
        if (cpu_is_mx51()) {
-               imx51_imx_sdma_data.pdata.script_addrs = &addr_imx51_to1;
+               int to_version = mx51_revision() >> 4;
+               imx51_imx_sdma_data.pdata.to_version = to_version;
+               imx51_imx_sdma_data.pdata.script_addrs = &addr_imx51;
                ret = imx_add_imx_sdma(&imx51_imx_sdma_data);
        } else
 #endif
index 5da5bea0f9f09ed49eedf281da1308c04a0b7341..7721de942c69e29cd0d36300eb48a695dfbdafbf 100644 (file)
@@ -1144,9 +1144,17 @@ static int __devinit mmci_probe(struct amba_device *dev,
                else if (ret != -ENOSYS)
                        goto err_gpio_cd;
 
+               /*
+                * A gpio pin that will detect cards when inserted and removed
+                * will most likely want to trigger on the edges if it is
+                * 0 when ejected and 1 when inserted (or mutatis mutandis
+                * for the inverted case) so we request triggers on both
+                * edges.
+                */
                ret = request_any_context_irq(gpio_to_irq(plat->gpio_cd),
-                                             mmci_cd_irq, 0,
-                                             DRIVER_NAME " (cd)", host);
+                               mmci_cd_irq,
+                               IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
+                               DRIVER_NAME " (cd)", host);
                if (ret >= 0)
                        host->gpio_cd_irq = gpio_to_irq(plat->gpio_cd);
        }