Merge branch 'dt/gic' into next/dt
authorArnd Bergmann <arnd@arndb.de>
Mon, 31 Oct 2011 13:08:10 +0000 (14:08 +0100)
committerArnd Bergmann <arnd@arndb.de>
Mon, 31 Oct 2011 13:08:10 +0000 (14:08 +0100)
Conflicts:
arch/arm/include/asm/localtimer.h
arch/arm/mach-msm/board-msm8x60.c
arch/arm/mach-omap2/board-generic.c

35 files changed:
1  2 
arch/arm/include/asm/localtimer.h
arch/arm/kernel/perf_event_v7.c
arch/arm/mach-at91/at91sam9g45.c
arch/arm/mach-msm/board-msm8x60.c
arch/arm/mach-mx5/board-mx51_babbage.c
arch/arm/mach-omap2/board-2430sdp.c
arch/arm/mach-omap2/board-3430sdp.c
arch/arm/mach-omap2/board-3630sdp.c
arch/arm/mach-omap2/board-4430sdp.c
arch/arm/mach-omap2/board-am3517crane.c
arch/arm/mach-omap2/board-am3517evm.c
arch/arm/mach-omap2/board-apollon.c
arch/arm/mach-omap2/board-cm-t35.c
arch/arm/mach-omap2/board-cm-t3517.c
arch/arm/mach-omap2/board-devkit8000.c
arch/arm/mach-omap2/board-generic.c
arch/arm/mach-omap2/board-h4.c
arch/arm/mach-omap2/board-igep0020.c
arch/arm/mach-omap2/board-ldp.c
arch/arm/mach-omap2/board-n8x0.c
arch/arm/mach-omap2/board-omap3beagle.c
arch/arm/mach-omap2/board-omap3evm.c
arch/arm/mach-omap2/board-omap3logic.c
arch/arm/mach-omap2/board-omap3pandora.c
arch/arm/mach-omap2/board-omap3stalker.c
arch/arm/mach-omap2/board-omap3touchbook.c
arch/arm/mach-omap2/board-omap4panda.c
arch/arm/mach-omap2/board-overo.c
arch/arm/mach-omap2/board-rm680.c
arch/arm/mach-omap2/board-rx51.c
arch/arm/mach-omap2/board-ti8168evm.c
arch/arm/mach-omap2/board-zoom.c
arch/arm/mach-omap2/io.c
arch/arm/mm/init.c
arch/arm/plat-omap/include/plat/io.h

@@@ -10,7 -10,7 +10,8 @@@
  #ifndef __ASM_ARM_LOCALTIMER_H
  #define __ASM_ARM_LOCALTIMER_H
  
 +#include <linux/errno.h>
+ #include <linux/interrupt.h>
  
  struct clock_event_device;
  
   */
  void percpu_timer_setup(void);
  
- /*
-  * Called from assembly, this is the local timer IRQ handler
-  */
- asmlinkage void do_local_timer(struct pt_regs *);
  #ifdef CONFIG_LOCAL_TIMERS
  
  #ifdef CONFIG_HAVE_ARM_TWD
  
  #include "smp_twd.h"
  
- #define local_timer_ack()     twd_timer_ack()
+ #define local_timer_stop(c)   twd_timer_stop((c))
  
  #else
  
  /*
-  * Platform provides this to acknowledge a local timer IRQ.
-  * Returns true if the local timer IRQ is to be processed.
+  * Stop the local timer
   */
int local_timer_ack(void);
void local_timer_stop(struct clock_event_device *);
  
  #endif
  
@@@ -54,6 -47,10 +48,10 @@@ static inline int local_timer_setup(str
  {
        return -ENXIO;
  }
+ static inline void local_timer_stop(struct clock_event_device *evt)
+ {
+ }
  #endif
  
  #endif
@@@ -17,6 -17,9 +17,9 @@@
   */
  
  #ifdef CONFIG_CPU_V7
+ static struct arm_pmu armv7pmu;
  /*
   * Common ARMv7 event types
   *
@@@ -321,8 -324,8 +324,8 @@@ static const unsigned armv7_a9_perf_map
        [PERF_COUNT_HW_CPU_CYCLES]          = ARMV7_PERFCTR_CPU_CYCLES,
        [PERF_COUNT_HW_INSTRUCTIONS]        =
                                        ARMV7_PERFCTR_INST_OUT_OF_RENAME_STAGE,
 -      [PERF_COUNT_HW_CACHE_REFERENCES]    = ARMV7_PERFCTR_COHERENT_LINE_HIT,
 -      [PERF_COUNT_HW_CACHE_MISSES]        = ARMV7_PERFCTR_COHERENT_LINE_MISS,
 +      [PERF_COUNT_HW_CACHE_REFERENCES]    = ARMV7_PERFCTR_DCACHE_ACCESS,
 +      [PERF_COUNT_HW_CACHE_MISSES]        = ARMV7_PERFCTR_DCACHE_REFILL,
        [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV7_PERFCTR_PC_WRITE,
        [PERF_COUNT_HW_BRANCH_MISSES]       = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
        [PERF_COUNT_HW_BUS_CYCLES]          = ARMV7_PERFCTR_CLOCK_CYCLES,
@@@ -676,23 -679,24 +679,24 @@@ static const unsigned armv7_a15_perf_ca
  };
  
  /*
-  * Perf Events counters
+  * Perf Events' indices
   */
- enum armv7_counters {
-       ARMV7_CYCLE_COUNTER             = 1,    /* Cycle counter */
-       ARMV7_COUNTER0                  = 2,    /* First event counter */
- };
+ #define       ARMV7_IDX_CYCLE_COUNTER 0
+ #define       ARMV7_IDX_COUNTER0      1
+ #define       ARMV7_IDX_COUNTER_LAST  (ARMV7_IDX_CYCLE_COUNTER + cpu_pmu->num_events - 1)
+ #define       ARMV7_MAX_COUNTERS      32
+ #define       ARMV7_COUNTER_MASK      (ARMV7_MAX_COUNTERS - 1)
  
  /*
-  * The cycle counter is ARMV7_CYCLE_COUNTER.
-  * The first event counter is ARMV7_COUNTER0.
-  * The last event counter is (ARMV7_COUNTER0 + armpmu->num_events - 1).
+  * ARMv7 low level PMNC access
   */
- #define       ARMV7_COUNTER_LAST      (ARMV7_COUNTER0 + armpmu->num_events - 1)
  
  /*
-  * ARMv7 low level PMNC access
+  * Perf Event to low level counters mapping
   */
+ #define       ARMV7_IDX_TO_COUNTER(x) \
+       (((x) - ARMV7_IDX_COUNTER0) & ARMV7_COUNTER_MASK)
  
  /*
   * Per-CPU PMNC: config reg
  #define       ARMV7_PMNC_MASK         0x3f     /* Mask for writable bits */
  
  /*
-  * Available counters
-  */
- #define ARMV7_CNT0            0       /* First event counter */
- #define ARMV7_CCNT            31      /* Cycle counter */
- /* Perf Event to low level counters mapping */
- #define ARMV7_EVENT_CNT_TO_CNTx       (ARMV7_COUNTER0 - ARMV7_CNT0)
- /*
-  * CNTENS: counters enable reg
-  */
- #define ARMV7_CNTENS_P(idx)   (1 << (idx - ARMV7_EVENT_CNT_TO_CNTx))
- #define ARMV7_CNTENS_C                (1 << ARMV7_CCNT)
- /*
-  * CNTENC: counters disable reg
-  */
- #define ARMV7_CNTENC_P(idx)   (1 << (idx - ARMV7_EVENT_CNT_TO_CNTx))
- #define ARMV7_CNTENC_C                (1 << ARMV7_CCNT)
- /*
-  * INTENS: counters overflow interrupt enable reg
-  */
- #define ARMV7_INTENS_P(idx)   (1 << (idx - ARMV7_EVENT_CNT_TO_CNTx))
- #define ARMV7_INTENS_C                (1 << ARMV7_CCNT)
- /*
-  * INTENC: counters overflow interrupt disable reg
-  */
- #define ARMV7_INTENC_P(idx)   (1 << (idx - ARMV7_EVENT_CNT_TO_CNTx))
- #define ARMV7_INTENC_C                (1 << ARMV7_CCNT)
- /*
-  * EVTSEL: Event selection reg
+  * FLAG: counters overflow flag status reg
   */
- #define       ARMV7_EVTSEL_MASK       0xff            /* Mask for writable bits */
+ #define       ARMV7_FLAG_MASK         0xffffffff      /* Mask for writable bits */
+ #define       ARMV7_OVERFLOWED_MASK   ARMV7_FLAG_MASK
  
  /*
-  * SELECT: Counter selection reg
+  * PMXEVTYPER: Event selection reg
   */
- #define       ARMV7_SELECT_MASK       0x1f            /* Mask for writable bits */
+ #define       ARMV7_EVTYPE_MASK       0xc00000ff      /* Mask for writable bits */
+ #define       ARMV7_EVTYPE_EVENT      0xff            /* Mask for EVENT bits */
  
  /*
-  * FLAG: counters overflow flag status reg
+  * Event filters for PMUv2
   */
- #define ARMV7_FLAG_P(idx)     (1 << (idx - ARMV7_EVENT_CNT_TO_CNTx))
- #define ARMV7_FLAG_C          (1 << ARMV7_CCNT)
- #define       ARMV7_FLAG_MASK         0xffffffff      /* Mask for writable bits */
- #define       ARMV7_OVERFLOWED_MASK   ARMV7_FLAG_MASK
+ #define       ARMV7_EXCLUDE_PL1       (1 << 31)
+ #define       ARMV7_EXCLUDE_USER      (1 << 30)
+ #define       ARMV7_INCLUDE_HYP       (1 << 27)
  
- static inline unsigned long armv7_pmnc_read(void)
+ static inline u32 armv7_pmnc_read(void)
  {
        u32 val;
        asm volatile("mrc p15, 0, %0, c9, c12, 0" : "=r"(val));
        return val;
  }
  
- static inline void armv7_pmnc_write(unsigned long val)
+ static inline void armv7_pmnc_write(u32 val)
  {
        val &= ARMV7_PMNC_MASK;
        isb();
        asm volatile("mcr p15, 0, %0, c9, c12, 0" : : "r"(val));
  }
  
- static inline int armv7_pmnc_has_overflowed(unsigned long pmnc)
+ static inline int armv7_pmnc_has_overflowed(u32 pmnc)
  {
        return pmnc & ARMV7_OVERFLOWED_MASK;
  }
  
- static inline int armv7_pmnc_counter_has_overflowed(unsigned long pmnc,
-                                       enum armv7_counters counter)
+ static inline int armv7_pmnc_counter_valid(int idx)
+ {
+       return idx >= ARMV7_IDX_CYCLE_COUNTER && idx <= ARMV7_IDX_COUNTER_LAST;
+ }
+ static inline int armv7_pmnc_counter_has_overflowed(u32 pmnc, int idx)
  {
        int ret = 0;
+       u32 counter;
  
-       if (counter == ARMV7_CYCLE_COUNTER)
-               ret = pmnc & ARMV7_FLAG_C;
-       else if ((counter >= ARMV7_COUNTER0) && (counter <= ARMV7_COUNTER_LAST))
-               ret = pmnc & ARMV7_FLAG_P(counter);
-       else
+       if (!armv7_pmnc_counter_valid(idx)) {
                pr_err("CPU%u checking wrong counter %d overflow status\n",
-                       smp_processor_id(), counter);
+                       smp_processor_id(), idx);
+       } else {
+               counter = ARMV7_IDX_TO_COUNTER(idx);
+               ret = pmnc & BIT(counter);
+       }
  
        return ret;
  }
  
- static inline int armv7_pmnc_select_counter(unsigned int idx)
+ static inline int armv7_pmnc_select_counter(int idx)
  {
-       u32 val;
+       u32 counter;
  
-       if ((idx < ARMV7_COUNTER0) || (idx > ARMV7_COUNTER_LAST)) {
-               pr_err("CPU%u selecting wrong PMNC counter"
-                       " %d\n", smp_processor_id(), idx);
-               return -1;
+       if (!armv7_pmnc_counter_valid(idx)) {
+               pr_err("CPU%u selecting wrong PMNC counter %d\n",
+                       smp_processor_id(), idx);
+               return -EINVAL;
        }
  
-       val = (idx - ARMV7_EVENT_CNT_TO_CNTx) & ARMV7_SELECT_MASK;
-       asm volatile("mcr p15, 0, %0, c9, c12, 5" : : "r" (val));
+       counter = ARMV7_IDX_TO_COUNTER(idx);
+       asm volatile("mcr p15, 0, %0, c9, c12, 5" : : "r" (counter));
        isb();
  
        return idx;
  
  static inline u32 armv7pmu_read_counter(int idx)
  {
-       unsigned long value = 0;
+       u32 value = 0;
  
-       if (idx == ARMV7_CYCLE_COUNTER)
-               asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r" (value));
-       else if ((idx >= ARMV7_COUNTER0) && (idx <= ARMV7_COUNTER_LAST)) {
-               if (armv7_pmnc_select_counter(idx) == idx)
-                       asm volatile("mrc p15, 0, %0, c9, c13, 2"
-                                    : "=r" (value));
-       } else
+       if (!armv7_pmnc_counter_valid(idx))
                pr_err("CPU%u reading wrong counter %d\n",
                        smp_processor_id(), idx);
+       else if (idx == ARMV7_IDX_CYCLE_COUNTER)
+               asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r" (value));
+       else if (armv7_pmnc_select_counter(idx) == idx)
+               asm volatile("mrc p15, 0, %0, c9, c13, 2" : "=r" (value));
  
        return value;
  }
  
  static inline void armv7pmu_write_counter(int idx, u32 value)
  {
-       if (idx == ARMV7_CYCLE_COUNTER)
-               asm volatile("mcr p15, 0, %0, c9, c13, 0" : : "r" (value));
-       else if ((idx >= ARMV7_COUNTER0) && (idx <= ARMV7_COUNTER_LAST)) {
-               if (armv7_pmnc_select_counter(idx) == idx)
-                       asm volatile("mcr p15, 0, %0, c9, c13, 2"
-                                    : : "r" (value));
-       } else
+       if (!armv7_pmnc_counter_valid(idx))
                pr_err("CPU%u writing wrong counter %d\n",
                        smp_processor_id(), idx);
+       else if (idx == ARMV7_IDX_CYCLE_COUNTER)
+               asm volatile("mcr p15, 0, %0, c9, c13, 0" : : "r" (value));
+       else if (armv7_pmnc_select_counter(idx) == idx)
+               asm volatile("mcr p15, 0, %0, c9, c13, 2" : : "r" (value));
  }
  
- static inline void armv7_pmnc_write_evtsel(unsigned int idx, u32 val)
+ static inline void armv7_pmnc_write_evtsel(int idx, u32 val)
  {
        if (armv7_pmnc_select_counter(idx) == idx) {
-               val &= ARMV7_EVTSEL_MASK;
+               val &= ARMV7_EVTYPE_MASK;
                asm volatile("mcr p15, 0, %0, c9, c13, 1" : : "r" (val));
        }
  }
  
- static inline u32 armv7_pmnc_enable_counter(unsigned int idx)
+ static inline int armv7_pmnc_enable_counter(int idx)
  {
-       u32 val;
+       u32 counter;
  
-       if ((idx != ARMV7_CYCLE_COUNTER) &&
-           ((idx < ARMV7_COUNTER0) || (idx > ARMV7_COUNTER_LAST))) {
-               pr_err("CPU%u enabling wrong PMNC counter"
-                       " %d\n", smp_processor_id(), idx);
-               return -1;
+       if (!armv7_pmnc_counter_valid(idx)) {
+               pr_err("CPU%u enabling wrong PMNC counter %d\n",
+                       smp_processor_id(), idx);
+               return -EINVAL;
        }
  
-       if (idx == ARMV7_CYCLE_COUNTER)
-               val = ARMV7_CNTENS_C;
-       else
-               val = ARMV7_CNTENS_P(idx);
-       asm volatile("mcr p15, 0, %0, c9, c12, 1" : : "r" (val));
+       counter = ARMV7_IDX_TO_COUNTER(idx);
+       asm volatile("mcr p15, 0, %0, c9, c12, 1" : : "r" (BIT(counter)));
        return idx;
  }
  
- static inline u32 armv7_pmnc_disable_counter(unsigned int idx)
+ static inline int armv7_pmnc_disable_counter(int idx)
  {
-       u32 val;
+       u32 counter;
  
-       if ((idx != ARMV7_CYCLE_COUNTER) &&
-           ((idx < ARMV7_COUNTER0) || (idx > ARMV7_COUNTER_LAST))) {
-               pr_err("CPU%u disabling wrong PMNC counter"
-                       " %d\n", smp_processor_id(), idx);
-               return -1;
+       if (!armv7_pmnc_counter_valid(idx)) {
+               pr_err("CPU%u disabling wrong PMNC counter %d\n",
+                       smp_processor_id(), idx);
+               return -EINVAL;
        }
  
-       if (idx == ARMV7_CYCLE_COUNTER)
-               val = ARMV7_CNTENC_C;
-       else
-               val = ARMV7_CNTENC_P(idx);
-       asm volatile("mcr p15, 0, %0, c9, c12, 2" : : "r" (val));
+       counter = ARMV7_IDX_TO_COUNTER(idx);
+       asm volatile("mcr p15, 0, %0, c9, c12, 2" : : "r" (BIT(counter)));
        return idx;
  }
  
- static inline u32 armv7_pmnc_enable_intens(unsigned int idx)
+ static inline int armv7_pmnc_enable_intens(int idx)
  {
-       u32 val;
+       u32 counter;
  
-       if ((idx != ARMV7_CYCLE_COUNTER) &&
-           ((idx < ARMV7_COUNTER0) || (idx > ARMV7_COUNTER_LAST))) {
-               pr_err("CPU%u enabling wrong PMNC counter"
-                       " interrupt enable %d\n", smp_processor_id(), idx);
-               return -1;
+       if (!armv7_pmnc_counter_valid(idx)) {
+               pr_err("CPU%u enabling wrong PMNC counter IRQ enable %d\n",
+                       smp_processor_id(), idx);
+               return -EINVAL;
        }
  
-       if (idx == ARMV7_CYCLE_COUNTER)
-               val = ARMV7_INTENS_C;
-       else
-               val = ARMV7_INTENS_P(idx);
-       asm volatile("mcr p15, 0, %0, c9, c14, 1" : : "r" (val));
+       counter = ARMV7_IDX_TO_COUNTER(idx);
+       asm volatile("mcr p15, 0, %0, c9, c14, 1" : : "r" (BIT(counter)));
        return idx;
  }
  
- static inline u32 armv7_pmnc_disable_intens(unsigned int idx)
+ static inline int armv7_pmnc_disable_intens(int idx)
  {
-       u32 val;
+       u32 counter;
  
-       if ((idx != ARMV7_CYCLE_COUNTER) &&
-           ((idx < ARMV7_COUNTER0) || (idx > ARMV7_COUNTER_LAST))) {
-               pr_err("CPU%u disabling wrong PMNC counter"
-                       " interrupt enable %d\n", smp_processor_id(), idx);
-               return -1;
+       if (!armv7_pmnc_counter_valid(idx)) {
+               pr_err("CPU%u disabling wrong PMNC counter IRQ enable %d\n",
+                       smp_processor_id(), idx);
+               return -EINVAL;
        }
  
-       if (idx == ARMV7_CYCLE_COUNTER)
-               val = ARMV7_INTENC_C;
-       else
-               val = ARMV7_INTENC_P(idx);
-       asm volatile("mcr p15, 0, %0, c9, c14, 2" : : "r" (val));
+       counter = ARMV7_IDX_TO_COUNTER(idx);
+       asm volatile("mcr p15, 0, %0, c9, c14, 2" : : "r" (BIT(counter)));
        return idx;
  }
  
@@@ -973,14 -921,14 +921,14 @@@ static void armv7_pmnc_dump_regs(void
        asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r" (val));
        printk(KERN_INFO "CCNT  =0x%08x\n", val);
  
-       for (cnt = ARMV7_COUNTER0; cnt < ARMV7_COUNTER_LAST; cnt++) {
+       for (cnt = ARMV7_IDX_COUNTER0; cnt <= ARMV7_IDX_COUNTER_LAST; cnt++) {
                armv7_pmnc_select_counter(cnt);
                asm volatile("mrc p15, 0, %0, c9, c13, 2" : "=r" (val));
                printk(KERN_INFO "CNT[%d] count =0x%08x\n",
-                       cnt-ARMV7_EVENT_CNT_TO_CNTx, val);
+                       ARMV7_IDX_TO_COUNTER(cnt), val);
                asm volatile("mrc p15, 0, %0, c9, c13, 1" : "=r" (val));
                printk(KERN_INFO "CNT[%d] evtsel=0x%08x\n",
-                       cnt-ARMV7_EVENT_CNT_TO_CNTx, val);
+                       ARMV7_IDX_TO_COUNTER(cnt), val);
        }
  }
  #endif
  static void armv7pmu_enable_event(struct hw_perf_event *hwc, int idx)
  {
        unsigned long flags;
+       struct pmu_hw_events *events = cpu_pmu->get_hw_events();
  
        /*
         * Enable counter and interrupt, and set the counter to count
         * the event that we're interested in.
         */
-       raw_spin_lock_irqsave(&pmu_lock, flags);
+       raw_spin_lock_irqsave(&events->pmu_lock, flags);
  
        /*
         * Disable counter
  
        /*
         * Set event (if destined for PMNx counters)
-        * We don't need to set the event if it's a cycle count
+        * We only need to set the event for the cycle counter if we
+        * have the ability to perform event filtering.
         */
-       if (idx != ARMV7_CYCLE_COUNTER)
+       if (armv7pmu.set_event_filter || idx != ARMV7_IDX_CYCLE_COUNTER)
                armv7_pmnc_write_evtsel(idx, hwc->config_base);
  
        /*
         */
        armv7_pmnc_enable_counter(idx);
  
-       raw_spin_unlock_irqrestore(&pmu_lock, flags);
+       raw_spin_unlock_irqrestore(&events->pmu_lock, flags);
  }
  
  static void armv7pmu_disable_event(struct hw_perf_event *hwc, int idx)
  {
        unsigned long flags;
+       struct pmu_hw_events *events = cpu_pmu->get_hw_events();
  
        /*
         * Disable counter and interrupt
         */
-       raw_spin_lock_irqsave(&pmu_lock, flags);
+       raw_spin_lock_irqsave(&events->pmu_lock, flags);
  
        /*
         * Disable counter
         */
        armv7_pmnc_disable_intens(idx);
  
-       raw_spin_unlock_irqrestore(&pmu_lock, flags);
+       raw_spin_unlock_irqrestore(&events->pmu_lock, flags);
  }
  
  static irqreturn_t armv7pmu_handle_irq(int irq_num, void *dev)
  {
-       unsigned long pmnc;
+       u32 pmnc;
        struct perf_sample_data data;
-       struct cpu_hw_events *cpuc;
+       struct pmu_hw_events *cpuc;
        struct pt_regs *regs;
        int idx;
  
        perf_sample_data_init(&data, 0);
  
        cpuc = &__get_cpu_var(cpu_hw_events);
-       for (idx = 0; idx <= armpmu->num_events; ++idx) {
+       for (idx = 0; idx < cpu_pmu->num_events; ++idx) {
                struct perf_event *event = cpuc->events[idx];
                struct hw_perf_event *hwc;
  
-               if (!test_bit(idx, cpuc->active_mask))
-                       continue;
                /*
                 * We have a single interrupt for all counters. Check that
                 * each counter has overflowed before we process it.
                        continue;
  
                if (perf_event_overflow(event, &data, regs))
-                       armpmu->disable(hwc, idx);
+                       cpu_pmu->disable(hwc, idx);
        }
  
        /*
  static void armv7pmu_start(void)
  {
        unsigned long flags;
+       struct pmu_hw_events *events = cpu_pmu->get_hw_events();
  
-       raw_spin_lock_irqsave(&pmu_lock, flags);
+       raw_spin_lock_irqsave(&events->pmu_lock, flags);
        /* Enable all counters */
        armv7_pmnc_write(armv7_pmnc_read() | ARMV7_PMNC_E);
-       raw_spin_unlock_irqrestore(&pmu_lock, flags);
+       raw_spin_unlock_irqrestore(&events->pmu_lock, flags);
  }
  
  static void armv7pmu_stop(void)
  {
        unsigned long flags;
+       struct pmu_hw_events *events = cpu_pmu->get_hw_events();
  
-       raw_spin_lock_irqsave(&pmu_lock, flags);
+       raw_spin_lock_irqsave(&events->pmu_lock, flags);
        /* Disable all counters */
        armv7_pmnc_write(armv7_pmnc_read() & ~ARMV7_PMNC_E);
-       raw_spin_unlock_irqrestore(&pmu_lock, flags);
+       raw_spin_unlock_irqrestore(&events->pmu_lock, flags);
  }
  
- static int armv7pmu_get_event_idx(struct cpu_hw_events *cpuc,
+ static int armv7pmu_get_event_idx(struct pmu_hw_events *cpuc,
                                  struct hw_perf_event *event)
  {
        int idx;
+       unsigned long evtype = event->config_base & ARMV7_EVTYPE_EVENT;
  
        /* Always place a cycle counter into the cycle counter. */
-       if (event->config_base == ARMV7_PERFCTR_CPU_CYCLES) {
-               if (test_and_set_bit(ARMV7_CYCLE_COUNTER, cpuc->used_mask))
+       if (evtype == ARMV7_PERFCTR_CPU_CYCLES) {
+               if (test_and_set_bit(ARMV7_IDX_CYCLE_COUNTER, cpuc->used_mask))
                        return -EAGAIN;
  
-               return ARMV7_CYCLE_COUNTER;
-       } else {
-               /*
-                * For anything other than a cycle counter, try and use
-                * the events counters
-                */
-               for (idx = ARMV7_COUNTER0; idx <= armpmu->num_events; ++idx) {
-                       if (!test_and_set_bit(idx, cpuc->used_mask))
-                               return idx;
-               }
+               return ARMV7_IDX_CYCLE_COUNTER;
+       }
  
-               /* The counters are all in use. */
-               return -EAGAIN;
+       /*
+        * For anything other than a cycle counter, try and use
+        * the events counters
+        */
+       for (idx = ARMV7_IDX_COUNTER0; idx < cpu_pmu->num_events; ++idx) {
+               if (!test_and_set_bit(idx, cpuc->used_mask))
+                       return idx;
        }
+       /* The counters are all in use. */
+       return -EAGAIN;
+ }
+ /*
+  * Add an event filter to a given event. This will only work for PMUv2 PMUs.
+  */
+ static int armv7pmu_set_event_filter(struct hw_perf_event *event,
+                                    struct perf_event_attr *attr)
+ {
+       unsigned long config_base = 0;
+       if (attr->exclude_idle)
+               return -EPERM;
+       if (attr->exclude_user)
+               config_base |= ARMV7_EXCLUDE_USER;
+       if (attr->exclude_kernel)
+               config_base |= ARMV7_EXCLUDE_PL1;
+       if (!attr->exclude_hv)
+               config_base |= ARMV7_INCLUDE_HYP;
+       /*
+        * Install the filter into config_base as this is used to
+        * construct the event type.
+        */
+       event->config_base = config_base;
+       return 0;
  }
  
  static void armv7pmu_reset(void *info)
  {
-       u32 idx, nb_cnt = armpmu->num_events;
+       u32 idx, nb_cnt = cpu_pmu->num_events;
  
        /* The counter and interrupt enable registers are unknown at reset. */
-       for (idx = 1; idx < nb_cnt; ++idx)
+       for (idx = ARMV7_IDX_CYCLE_COUNTER; idx < nb_cnt; ++idx)
                armv7pmu_disable_event(NULL, idx);
  
        /* Initialize & Reset PMNC: C and P bits */
        armv7_pmnc_write(ARMV7_PMNC_P | ARMV7_PMNC_C);
  }
  
+ static int armv7_a8_map_event(struct perf_event *event)
+ {
+       return map_cpu_event(event, &armv7_a8_perf_map,
+                               &armv7_a8_perf_cache_map, 0xFF);
+ }
+ static int armv7_a9_map_event(struct perf_event *event)
+ {
+       return map_cpu_event(event, &armv7_a9_perf_map,
+                               &armv7_a9_perf_cache_map, 0xFF);
+ }
+ static int armv7_a5_map_event(struct perf_event *event)
+ {
+       return map_cpu_event(event, &armv7_a5_perf_map,
+                               &armv7_a5_perf_cache_map, 0xFF);
+ }
+ static int armv7_a15_map_event(struct perf_event *event)
+ {
+       return map_cpu_event(event, &armv7_a15_perf_map,
+                               &armv7_a15_perf_cache_map, 0xFF);
+ }
  static struct arm_pmu armv7pmu = {
        .handle_irq             = armv7pmu_handle_irq,
        .enable                 = armv7pmu_enable_event,
        .start                  = armv7pmu_start,
        .stop                   = armv7pmu_stop,
        .reset                  = armv7pmu_reset,
-       .raw_event_mask         = 0xFF,
        .max_period             = (1LLU << 32) - 1,
  };
  
@@@ -1188,62 -1188,59 +1188,59 @@@ static u32 __init armv7_read_num_pmnc_e
        return nb_cnt + 1;
  }
  
- static const struct arm_pmu *__init armv7_a8_pmu_init(void)
+ static struct arm_pmu *__init armv7_a8_pmu_init(void)
  {
        armv7pmu.id             = ARM_PERF_PMU_ID_CA8;
        armv7pmu.name           = "ARMv7 Cortex-A8";
-       armv7pmu.cache_map      = &armv7_a8_perf_cache_map;
-       armv7pmu.event_map      = &armv7_a8_perf_map;
+       armv7pmu.map_event      = armv7_a8_map_event;
        armv7pmu.num_events     = armv7_read_num_pmnc_events();
        return &armv7pmu;
  }
  
- static const struct arm_pmu *__init armv7_a9_pmu_init(void)
+ static struct arm_pmu *__init armv7_a9_pmu_init(void)
  {
        armv7pmu.id             = ARM_PERF_PMU_ID_CA9;
        armv7pmu.name           = "ARMv7 Cortex-A9";
-       armv7pmu.cache_map      = &armv7_a9_perf_cache_map;
-       armv7pmu.event_map      = &armv7_a9_perf_map;
+       armv7pmu.map_event      = armv7_a9_map_event;
        armv7pmu.num_events     = armv7_read_num_pmnc_events();
        return &armv7pmu;
  }
  
- static const struct arm_pmu *__init armv7_a5_pmu_init(void)
+ static struct arm_pmu *__init armv7_a5_pmu_init(void)
  {
        armv7pmu.id             = ARM_PERF_PMU_ID_CA5;
        armv7pmu.name           = "ARMv7 Cortex-A5";
-       armv7pmu.cache_map      = &armv7_a5_perf_cache_map;
-       armv7pmu.event_map      = &armv7_a5_perf_map;
+       armv7pmu.map_event      = armv7_a5_map_event;
        armv7pmu.num_events     = armv7_read_num_pmnc_events();
        return &armv7pmu;
  }
  
- static const struct arm_pmu *__init armv7_a15_pmu_init(void)
+ static struct arm_pmu *__init armv7_a15_pmu_init(void)
  {
        armv7pmu.id             = ARM_PERF_PMU_ID_CA15;
        armv7pmu.name           = "ARMv7 Cortex-A15";
-       armv7pmu.cache_map      = &armv7_a15_perf_cache_map;
-       armv7pmu.event_map      = &armv7_a15_perf_map;
+       armv7pmu.map_event      = armv7_a15_map_event;
        armv7pmu.num_events     = armv7_read_num_pmnc_events();
+       armv7pmu.set_event_filter = armv7pmu_set_event_filter;
        return &armv7pmu;
  }
  #else
- static const struct arm_pmu *__init armv7_a8_pmu_init(void)
+ static struct arm_pmu *__init armv7_a8_pmu_init(void)
  {
        return NULL;
  }
  
- static const struct arm_pmu *__init armv7_a9_pmu_init(void)
+ static struct arm_pmu *__init armv7_a9_pmu_init(void)
  {
        return NULL;
  }
  
- static const struct arm_pmu *__init armv7_a5_pmu_init(void)
+ static struct arm_pmu *__init armv7_a5_pmu_init(void)
  {
        return NULL;
  }
  
- static const struct arm_pmu *__init armv7_a15_pmu_init(void)
+ static struct arm_pmu *__init armv7_a15_pmu_init(void)
  {
        return NULL;
  }
@@@ -12,6 -12,7 +12,7 @@@
  
  #include <linux/module.h>
  #include <linux/pm.h>
+ #include <linux/dma-mapping.h>
  
  #include <asm/irq.h>
  #include <asm/mach/arch.h>
@@@ -215,12 -216,6 +216,12 @@@ static struct clk_lookup periph_clocks_
        CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tcb0_clk),
        CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
        CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
 +      /* more usart lookup table for DT entries */
 +      CLKDEV_CON_DEV_ID("usart", "ffffee00.serial", &mck),
 +      CLKDEV_CON_DEV_ID("usart", "fff8c000.serial", &usart0_clk),
 +      CLKDEV_CON_DEV_ID("usart", "fff90000.serial", &usart1_clk),
 +      CLKDEV_CON_DEV_ID("usart", "fff94000.serial", &usart2_clk),
 +      CLKDEV_CON_DEV_ID("usart", "fff98000.serial", &usart3_clk),
  };
  
  static struct clk_lookup usart_clocks_lookups[] = {
@@@ -325,6 -320,7 +326,7 @@@ static void at91sam9g45_poweroff(void
  static void __init at91sam9g45_map_io(void)
  {
        at91_init_sram(0, AT91SAM9G45_SRAM_BASE, AT91SAM9G45_SRAM_SIZE);
+       init_consistent_dma_size(SZ_4M);
  }
  
  static void __init at91sam9g45_initialize(void)
@@@ -1,4 -1,4 +1,4 @@@
 -/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
 +/* Copyright (c) 2010, 2011, Code Aurora Forum. All rights reserved.
   *
   * This program is free software; you can redistribute it and/or modify
   * it under the terms of the GNU General Public License version 2 and
@@@ -8,24 -8,43 +8,41 @@@
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * GNU General Public License for more details.
 - *
 - * You should have received a copy of the GNU General Public License
 - * along with this program; if not, write to the Free Software
 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 - * 02110-1301, USA.
 - *
   */
  
  #include <linux/kernel.h>
  #include <linux/platform_device.h>
  #include <linux/io.h>
  #include <linux/irq.h>
 +#include <linux/irqdomain.h>
 +#include <linux/of.h>
 +#include <linux/of_address.h>
 +#include <linux/of_platform.h>
+ #include <linux/memblock.h>
  
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
  #include <asm/hardware/gic.h>
+ #include <asm/setup.h>
  
  #include <mach/board.h>
  #include <mach/msm_iomap.h>
  
+ static void __init msm8x60_fixup(struct machine_desc *desc, struct tag *tag,
+                        char **cmdline, struct meminfo *mi)
+ {
+       for (; tag->hdr.size; tag = tag_next(tag))
+               if (tag->hdr.tag == ATAG_MEM &&
+                               tag->u.mem.start == 0x40200000) {
+                       tag->u.mem.start = 0x40000000;
+                       tag->u.mem.size += SZ_2M;
+               }
+ }
+ static void __init msm8x60_reserve(void)
+ {
+       memblock_remove(0x40000000, SZ_2M);
+ }
  
  static void __init msm8x60_map_io(void)
  {
@@@ -34,8 -53,6 +51,6 @@@
  
  static void __init msm8x60_init_irq(void)
  {
-       unsigned int i;
        gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
                 (void *)MSM_QGIC_CPU_BASE);
  
         */
        if (!machine_is_msm8x60_sim())
                writel(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET);
-       /* FIXME: Not installing AVS_SVICINT and AVS_SVICINTSWDONE yet
-        * as they are configured as level, which does not play nice with
-        * handle_percpu_irq.
-        */
-       for (i = GIC_PPI_START; i < GIC_SPI_START; i++) {
-               if (i != AVS_SVICINT && i != AVS_SVICINTSWDONE)
-                       irq_set_handler(i, handle_percpu_irq);
-       }
  }
  
  static void __init msm8x60_init(void)
  {
  }
  
 +#ifdef CONFIG_OF
 +static struct of_dev_auxdata msm_auxdata_lookup[] __initdata = {
 +      {}
 +};
 +
 +static struct of_device_id msm_dt_gic_match[] __initdata = {
 +      { .compatible = "qcom,msm-8660-qgic", },
 +      {}
 +};
 +
 +static void __init msm8x60_dt_init(void)
 +{
 +      struct device_node *node;
 +
 +      node = of_find_matching_node_by_address(NULL, msm_dt_gic_match,
 +                      MSM8X60_QGIC_DIST_PHYS);
 +      if (node)
 +              irq_domain_add_simple(node, GIC_SPI_START);
 +
 +      if (of_machine_is_compatible("qcom,msm8660-surf")) {
 +              printk(KERN_INFO "Init surf UART registers\n");
 +              msm8x60_init_uart12dm();
 +      }
 +
 +      of_platform_populate(NULL, of_default_bus_match_table,
 +                      msm_auxdata_lookup, NULL);
 +}
 +
 +static const char *msm8x60_fluid_match[] __initdata = {
 +      "qcom,msm8660-fluid",
 +      "qcom,msm8660-surf",
 +      NULL
 +};
 +#endif /* CONFIG_OF */
 +
  MACHINE_START(MSM8X60_RUMI3, "QCT MSM8X60 RUMI3")
+       .fixup = msm8x60_fixup,
+       .reserve = msm8x60_reserve,
        .map_io = msm8x60_map_io,
        .init_irq = msm8x60_init_irq,
        .init_machine = msm8x60_init,
  MACHINE_END
  
  MACHINE_START(MSM8X60_SURF, "QCT MSM8X60 SURF")
+       .fixup = msm8x60_fixup,
+       .reserve = msm8x60_reserve,
        .map_io = msm8x60_map_io,
        .init_irq = msm8x60_init_irq,
        .init_machine = msm8x60_init,
  MACHINE_END
  
  MACHINE_START(MSM8X60_SIM, "QCT MSM8X60 SIMULATOR")
+       .fixup = msm8x60_fixup,
+       .reserve = msm8x60_reserve,
        .map_io = msm8x60_map_io,
        .init_irq = msm8x60_init_irq,
        .init_machine = msm8x60_init,
  MACHINE_END
  
  MACHINE_START(MSM8X60_FFA, "QCT MSM8X60 FFA")
+       .fixup = msm8x60_fixup,
+       .reserve = msm8x60_reserve,
        .map_io = msm8x60_map_io,
        .init_irq = msm8x60_init_irq,
        .init_machine = msm8x60_init,
        .timer = &msm_timer,
  MACHINE_END
 +
 +#ifdef CONFIG_OF
 +/* TODO: General device tree support for all MSM. */
 +DT_MACHINE_START(MSM_DT, "Qualcomm MSM (Flattened Device Tree)")
 +      .map_io = msm8x60_map_io,
 +      .init_irq = msm8x60_init_irq,
 +      .init_machine = msm8x60_dt_init,
 +      .timer = &msm_timer,
 +      .dt_compat = msm8x60_fluid_match,
 +MACHINE_END
 +#endif /* CONFIG_OF */
@@@ -351,12 -351,6 +351,12 @@@ static const struct esdhc_platform_dat
        .wp_type = ESDHC_WP_GPIO,
  };
  
 +void __init imx51_babbage_common_init(void)
 +{
 +      mxc_iomux_v3_setup_multiple_pads(mx51babbage_pads,
 +                                       ARRAY_SIZE(mx51babbage_pads));
 +}
 +
  /*
   * Board specific initialization.
   */
@@@ -371,7 -365,8 +371,7 @@@ static void __init mx51_babbage_init(vo
  #if defined(CONFIG_CPU_FREQ_IMX)
        get_cpu_op = mx51_get_cpu_op;
  #endif
 -      mxc_iomux_v3_setup_multiple_pads(mx51babbage_pads,
 -                                      ARRAY_SIZE(mx51babbage_pads));
 +      imx51_babbage_common_init();
  
        imx51_add_imx_uart(0, &uart_pdata);
        imx51_add_imx_uart(1, NULL);
@@@ -421,7 -416,7 +421,7 @@@ static struct sys_timer mx51_babbage_ti
  
  MACHINE_START(MX51_BABBAGE, "Freescale MX51 Babbage Board")
        /* Maintainer: Amit Kucheria <amit.kucheria@canonical.com> */
-       .boot_params = MX51_PHYS_OFFSET + 0x100,
+       .atag_offset = 0x100,
        .map_io = mx51_map_io,
        .init_early = imx51_init_early,
        .init_irq = mx51_init_irq,
@@@ -141,6 -141,12 +141,6 @@@ static struct omap_board_config_kernel 
        {OMAP_TAG_LCD, &sdp2430_lcd_config},
  };
  
 -static void __init omap_2430sdp_init_early(void)
 -{
 -      omap2_init_common_infrastructure();
 -      omap2_init_common_devices(NULL, NULL);
 -}
 -
  static struct regulator_consumer_supply sdp2430_vmmc1_supplies[] = {
        REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
  };
@@@ -187,8 -193,7 +187,8 @@@ static int __init omap2430_i2c_init(voi
  {
        omap_register_i2c_bus(1, 100, sdp2430_i2c1_boardinfo,
                        ARRAY_SIZE(sdp2430_i2c1_boardinfo));
 -      omap2_pmic_init("twl4030", &sdp2430_twldata);
 +      omap_pmic_init(2, 100, "twl4030", INT_24XX_SYS_NIRQ,
 +                      &sdp2430_twldata);
        return 0;
  }
  
@@@ -230,7 -235,6 +230,7 @@@ static void __init omap_2430sdp_init(vo
  
        platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices));
        omap_serial_init();
 +      omap_sdrc_init(NULL, NULL);
        omap2_hsmmc_init(mmc);
        omap2_usbfs_init(&sdp2430_usb_config);
  
                         "Secondary LCD backlight");
  }
  
 -static void __init omap_2430sdp_map_io(void)
 -{
 -      omap2_set_globals_243x();
 -      omap243x_map_common_io();
 -}
 -
  MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board")
        /* Maintainer: Syed Khasim - Texas Instruments Inc */
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
 -      .map_io         = omap_2430sdp_map_io,
 -      .init_early     = omap_2430sdp_init_early,
 +      .map_io         = omap243x_map_io,
 +      .init_early     = omap2430_init_early,
        .init_irq       = omap2_init_irq,
        .init_machine   = omap_2430sdp_init,
        .timer          = &omap2_timer,
@@@ -225,6 -225,12 +225,6 @@@ static struct omap_dss_board_info sdp34
  static struct omap_board_config_kernel sdp3430_config[] __initdata = {
  };
  
 -static void __init omap_3430sdp_init_early(void)
 -{
 -      omap2_init_common_infrastructure();
 -      omap2_init_common_devices(hyb18m512160af6_sdrc_params, NULL);
 -}
 -
  static struct omap2_hsmmc_info mmc[] = {
        {
                .mmc            = 1,
@@@ -713,7 -719,6 +713,7 @@@ static void __init omap_3430sdp_init(vo
                gpio_pendown = SDP3430_TS_GPIO_IRQ_SDPV1;
        omap_ads7846_init(1, gpio_pendown, 310, NULL);
        board_serial_init();
 +      omap_sdrc_init(hyb18m512160af6_sdrc_params, NULL);
        usb_musb_init(NULL);
        board_smc91x_init();
        board_flash_init(sdp_flash_partitions, chip_sel_3430, 0);
  
  MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board")
        /* Maintainer: Syed Khasim - Texas Instruments Inc */
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
        .map_io         = omap3_map_io,
 -      .init_early     = omap_3430sdp_init_early,
 +      .init_early     = omap3430_init_early,
        .init_irq       = omap3_init_irq,
        .init_machine   = omap_3430sdp_init,
        .timer          = &omap3_timer,
@@@ -70,6 -70,13 +70,6 @@@ static const struct usbhs_omap_board_da
  static struct omap_board_config_kernel sdp_config[] __initdata = {
  };
  
 -static void __init omap_sdp_init_early(void)
 -{
 -      omap2_init_common_infrastructure();
 -      omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params,
 -                                h8mbx00u0mer0em_sdrc_params);
 -}
 -
  #ifdef CONFIG_OMAP_MUX
  static struct omap_board_mux board_mux[] __initdata = {
        { .reg_offset = OMAP_MUX_TERMINATOR },
@@@ -200,8 -207,6 +200,8 @@@ static void __init omap_sdp_init(void
        omap_board_config = sdp_config;
        omap_board_config_size = ARRAY_SIZE(sdp_config);
        zoom_peripherals_init();
 +      omap_sdrc_init(h8mbx00u0mer0em_sdrc_params,
 +                                h8mbx00u0mer0em_sdrc_params);
        zoom_display_init();
        board_smc91x_init();
        board_flash_init(sdp_flash_partitions, chip_sel_sdp, NAND_BUSWIDTH_16);
  }
  
  MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
        .map_io         = omap3_map_io,
 -      .init_early     = omap_sdp_init_early,
 +      .init_early     = omap3630_init_early,
        .init_irq       = omap3_init_irq,
        .init_machine   = omap_sdp_init,
        .timer          = &omap3_timer,
@@@ -129,7 -129,7 +129,7 @@@ static const int sdp4430_keymap[] = 
        KEY(7, 6, KEY_OK),
        KEY(7, 7, KEY_DOWN),
  };
 -static struct omap_device_pad keypad_pads[] __initdata = {
 +static struct omap_device_pad keypad_pads[] = {
        {       .name   = "kpd_col1.kpd_col1",
                .enable = OMAP_WAKEUP_EN | OMAP_MUX_MODE1,
        },
@@@ -389,6 -389,12 +389,6 @@@ static struct omap_board_config_kernel 
        { OMAP_TAG_LCD,         &sdp4430_lcd_config },
  };
  
 -static void __init omap_4430sdp_init_early(void)
 -{
 -      omap2_init_common_infrastructure();
 -      omap2_init_common_devices(NULL, NULL);
 -}
 -
  static struct omap_musb_board_data musb_board_data = {
        .interface_type         = MUSB_INTERFACE_UTMI,
        .mode                   = MUSB_OTG,
@@@ -803,7 -809,6 +803,7 @@@ static void __init omap_4430sdp_init(vo
        omap_sfh7741prox_init();
        platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices));
        board_serial_init();
 +      omap_sdrc_init(NULL, NULL);
        omap4_sdp4430_wifi_init();
        omap4_twl6030_hsmmc_init(mmc);
  
        omap_4430sdp_display_init();
  }
  
 -static void __init omap_4430sdp_map_io(void)
 -{
 -      omap2_set_globals_443x();
 -      omap44xx_map_common_io();
 -}
 -
  MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
        /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
 -      .map_io         = omap_4430sdp_map_io,
 -      .init_early     = omap_4430sdp_init_early,
 +      .map_io         = omap4_map_io,
 +      .init_early     = omap4430_init_early,
        .init_irq       = gic_init_irq,
        .init_machine   = omap_4430sdp_init,
        .timer          = &omap4_timer,
@@@ -47,6 -47,12 +47,6 @@@ static struct omap_board_mux board_mux[
  };
  #endif
  
 -static void __init am3517_crane_init_early(void)
 -{
 -      omap2_init_common_infrastructure();
 -      omap2_init_common_devices(NULL, NULL);
 -}
 -
  static struct usbhs_omap_board_data usbhs_bdata __initdata = {
        .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
        .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
@@@ -64,7 -70,6 +64,7 @@@ static void __init am3517_crane_init(vo
  
        omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
        omap_serial_init();
 +      omap_sdrc_init(NULL, NULL);
  
        omap_board_config = am3517_crane_config;
        omap_board_config_size = ARRAY_SIZE(am3517_crane_config);
  }
  
  MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD")
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
        .map_io         = omap3_map_io,
 -      .init_early     = am3517_crane_init_early,
 +      .init_early     = am35xx_init_early,
        .init_irq       = omap3_init_irq,
        .init_machine   = am3517_crane_init,
        .timer          = &omap3_timer,
@@@ -362,6 -362,11 +362,6 @@@ static struct omap_dss_board_info am351
  /*
   * Board initialization
   */
 -static void __init am3517_evm_init_early(void)
 -{
 -      omap2_init_common_infrastructure();
 -      omap2_init_common_devices(NULL, NULL);
 -}
  
  static struct omap_musb_board_data musb_board_data = {
        .interface_type         = MUSB_INTERFACE_ULPI,
@@@ -464,7 -469,6 +464,7 @@@ static void __init am3517_evm_init(void
        am3517_evm_i2c_init();
        omap_display_init(&am3517_evm_dss_data);
        omap_serial_init();
 +      omap_sdrc_init(NULL, NULL);
  
        /* Configure GPIO for EHCI port */
        omap_mux_init_gpio(57, OMAP_PIN_OUTPUT);
  }
  
  MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM")
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
        .map_io         = omap3_map_io,
 -      .init_early     = am3517_evm_init_early,
 +      .init_early     = am35xx_init_early,
        .init_irq       = omap3_init_irq,
        .init_machine   = am3517_evm_init,
        .timer          = &omap3_timer,
@@@ -273,6 -273,12 +273,6 @@@ static struct omap_board_config_kernel 
        { OMAP_TAG_LCD,         &apollon_lcd_config },
  };
  
 -static void __init omap_apollon_init_early(void)
 -{
 -      omap2_init_common_infrastructure();
 -      omap2_init_common_devices(NULL, NULL);
 -}
 -
  static struct gpio apollon_gpio_leds[] __initdata = {
        { LED0_GPIO13, GPIOF_OUT_INIT_LOW, "LED0" }, /* LED0 - AA10 */
        { LED1_GPIO14, GPIOF_OUT_INIT_LOW, "LED1" }, /* LED1 - AA6  */
@@@ -334,15 -340,20 +334,15 @@@ static void __init omap_apollon_init(vo
         */
        platform_add_devices(apollon_devices, ARRAY_SIZE(apollon_devices));
        omap_serial_init();
 -}
 -
 -static void __init omap_apollon_map_io(void)
 -{
 -      omap2_set_globals_242x();
 -      omap242x_map_common_io();
 +      omap_sdrc_init(NULL, NULL);
  }
  
  MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon")
        /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
 -      .map_io         = omap_apollon_map_io,
 -      .init_early     = omap_apollon_init_early,
 +      .map_io         = omap242x_map_io,
 +      .init_early     = omap2420_init_early,
        .init_irq       = omap2_init_irq,
        .init_machine   = omap_apollon_init,
        .timer          = &omap2_timer,
@@@ -471,6 -471,13 +471,6 @@@ static void __init cm_t35_init_i2c(void
        omap3_pmic_init("tps65930", &cm_t35_twldata);
  }
  
 -static void __init cm_t35_init_early(void)
 -{
 -      omap2_init_common_infrastructure();
 -      omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
 -                           mt46h32m32lf6_sdrc_params);
 -}
 -
  #ifdef CONFIG_OMAP_MUX
  static struct omap_board_mux board_mux[] __initdata = {
        /* nCS and IRQ for CM-T35 ethernet */
@@@ -603,8 -610,6 +603,8 @@@ static void __init cm_t3x_common_init(v
        omap_board_config_size = ARRAY_SIZE(cm_t35_config);
        omap3_mux_init(board_mux, OMAP_PACKAGE_CUS);
        omap_serial_init();
 +      omap_sdrc_init(mt46h32m32lf6_sdrc_params,
 +                           mt46h32m32lf6_sdrc_params);
        cm_t35_init_i2c();
        omap_ads7846_init(1, CM_T35_GPIO_PENDOWN, 0, NULL);
        cm_t35_init_ethernet();
@@@ -629,20 -634,20 +629,20 @@@ static void __init cm_t3730_init(void
  }
  
  MACHINE_START(CM_T35, "Compulab CM-T35")
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
        .map_io         = omap3_map_io,
 -      .init_early     = cm_t35_init_early,
 +      .init_early     = omap35xx_init_early,
        .init_irq       = omap3_init_irq,
        .init_machine   = cm_t35_init,
        .timer          = &omap3_timer,
  MACHINE_END
  
  MACHINE_START(CM_T3730, "Compulab CM-T3730")
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
        .map_io         = omap3_map_io,
 -      .init_early     = cm_t35_init_early,
 +      .init_early     = omap3630_init_early,
        .init_irq       = omap3_init_irq,
        .init_machine   = cm_t3730_init,
        .timer          = &omap3_timer,
@@@ -251,6 -251,12 +251,6 @@@ static inline void cm_t3517_init_nand(v
  static struct omap_board_config_kernel cm_t3517_config[] __initdata = {
  };
  
 -static void __init cm_t3517_init_early(void)
 -{
 -      omap2_init_common_infrastructure();
 -      omap2_init_common_devices(NULL, NULL);
 -}
 -
  #ifdef CONFIG_OMAP_MUX
  static struct omap_board_mux board_mux[] __initdata = {
        /* GPIO186 - Green LED */
@@@ -283,7 -289,6 +283,7 @@@ static void __init cm_t3517_init(void
  {
        omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
        omap_serial_init();
 +      omap_sdrc_init(NULL, NULL);
        omap_board_config = cm_t3517_config;
        omap_board_config_size = ARRAY_SIZE(cm_t3517_config);
        cm_t3517_init_leds();
  }
  
  MACHINE_START(CM_T3517, "Compulab CM-T3517")
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
        .map_io         = omap3_map_io,
 -      .init_early     = cm_t3517_init_early,
 +      .init_early     = am35xx_init_early,
        .init_irq       = omap3_init_irq,
        .init_machine   = cm_t3517_init,
        .timer          = &omap3_timer,
@@@ -397,6 -397,19 +397,6 @@@ static struct platform_device keys_gpi
        },
  };
  
 -
 -static void __init devkit8000_init_early(void)
 -{
 -      omap2_init_common_infrastructure();
 -      omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
 -                                mt46h32m32lf6_sdrc_params);
 -}
 -
 -static void __init devkit8000_init_irq(void)
 -{
 -      omap3_init_irq();
 -}
 -
  #define OMAP_DM9000_BASE      0x2c000000
  
  static struct resource omap_dm9000_resources[] = {
@@@ -632,8 -645,6 +632,8 @@@ static void __init devkit8000_init(void
  {
        omap3_mux_init(board_mux, OMAP_PACKAGE_CUS);
        omap_serial_init();
 +      omap_sdrc_init(mt46h32m32lf6_sdrc_params,
 +                                mt46h32m32lf6_sdrc_params);
  
        omap_dm9000_init();
  
  }
  
  MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000")
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
        .map_io         = omap3_map_io,
 -      .init_early     = devkit8000_init_early,
 -      .init_irq       = devkit8000_init_irq,
 +      .init_early     = omap35xx_init_early,
 +      .init_irq       = omap3_init_irq,
        .init_machine   = devkit8000_init,
        .timer          = &omap3_secure_timer,
  MACHINE_END
  /*
 - * linux/arch/arm/mach-omap2/board-generic.c
 - *
   * Copyright (C) 2005 Nokia Corporation
   * Author: Paul Mundt <paul.mundt@nokia.com>
   *
 - * Modified from mach-omap/omap1/board-generic.c
 + * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
   *
 - * Code for generic OMAP2 board. Should work on many OMAP2 systems where
 - * the bootloader passes the board-specific data to the kernel.
 - * Do not put any board specific code to this file; create a new machine
 - * type if you need custom low-level initializations.
 + * Modified from the original mach-omap/omap2/board-generic.c did by Paul
 + * to support the OMAP2+ device tree boards with an unique board file.
   *
   * This program is free software; you can redistribute it and/or modify
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   */
  
 -#include <linux/kernel.h>
 -#include <linux/init.h>
 -#include <linux/device.h>
 +#include <linux/io.h>
 +#include <linux/of_platform.h>
 +#include <linux/irqdomain.h>
 +#include <linux/i2c/twl.h>
  
  #include <mach/hardware.h>
 -#include <asm/mach-types.h>
  #include <asm/mach/arch.h>
 -#include <asm/mach/map.h>
  
 -#include <mach/gpio.h>
 -#include <plat/usb.h>
  #include <plat/board.h>
  #include <plat/common.h>
 +#include <mach/omap4-common.h>
 +#include "common-board-devices.h"
 +
 +/*
 + * XXX: Still needed to boot until the i2c & twl driver is adapted to
 + * device-tree
 + */
 +static struct twl4030_platform_data sdp4430_twldata = {
 +      .irq_base       = TWL6030_IRQ_BASE,
 +      .irq_end        = TWL6030_IRQ_END,
 +};
  
 -static struct omap_board_config_kernel generic_config[] = {
 +static void __init omap4_i2c_init(void)
 +{
 +      omap4_pmic_init("twl6030", &sdp4430_twldata);
 +}
 +
 +static struct twl4030_platform_data beagle_twldata = {
 +      .irq_base       = TWL4030_IRQ_BASE,
 +      .irq_end        = TWL4030_IRQ_END,
  };
  
 -static void __init omap_generic_init_early(void)
 +static void __init omap3_i2c_init(void)
  {
 -      omap2_init_common_infrastructure();
 -      omap2_init_common_devices(NULL, NULL);
 +      omap3_pmic_init("twl4030", &beagle_twldata);
  }
  
 +static struct of_device_id omap_dt_match_table[] __initdata = {
 +      { .compatible = "simple-bus", },
 +      { .compatible = "ti,omap-infra", },
 +      { }
 +};
 +
 +static struct of_device_id intc_match[] __initdata = {
 +      { .compatible = "ti,omap3-intc", },
 +      { .compatible = "arm,cortex-a9-gic", },
 +      { }
 +};
 +
  static void __init omap_generic_init(void)
  {
 +      struct device_node *node = of_find_matching_node(NULL, intc_match);
 +      if (node)
 +              irq_domain_add_simple(node, 0);
 +
        omap_serial_init();
 -      omap_board_config = generic_config;
 -      omap_board_config_size = ARRAY_SIZE(generic_config);
 +      omap_sdrc_init(NULL, NULL);
 +
 +      of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
 +}
 +
 +static void __init omap4_init(void)
 +{
 +      omap4_i2c_init();
 +      omap_generic_init();
  }
  
 -static void __init omap_generic_map_io(void)
 +static void __init omap3_init(void)
  {
 -      if (cpu_is_omap242x()) {
 -              omap2_set_globals_242x();
 -              omap242x_map_common_io();
 -      } else if (cpu_is_omap243x()) {
 -              omap2_set_globals_243x();
 -              omap243x_map_common_io();
 -      } else if (cpu_is_omap34xx()) {
 -              omap2_set_globals_3xxx();
 -              omap34xx_map_common_io();
 -      } else if (cpu_is_omap44xx()) {
 -              omap2_set_globals_443x();
 -              omap44xx_map_common_io();
 -      }
 +      omap3_i2c_init();
 +      omap_generic_init();
  }
  
 -/* XXX This machine entry name should be updated */
 -MACHINE_START(OMAP_GENERIC, "Generic OMAP24xx")
 -      /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */
 +#if defined(CONFIG_SOC_OMAP2420)
 +static const char *omap242x_boards_compat[] __initdata = {
 +      "ti,omap2420",
 +      NULL,
 +};
 +
 +DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)")
++      .atag_offset    = 0x100,
 +      .reserve        = omap_reserve,
 +      .map_io         = omap242x_map_io,
 +      .init_early     = omap2420_init_early,
 +      .init_irq       = omap2_init_irq,
 +      .init_machine   = omap_generic_init,
 +      .timer          = &omap2_timer,
 +      .dt_compat      = omap242x_boards_compat,
 +MACHINE_END
 +#endif
 +
 +#if defined(CONFIG_SOC_OMAP2430)
 +static const char *omap243x_boards_compat[] __initdata = {
 +      "ti,omap2430",
 +      NULL,
 +};
 +
 +DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened Device Tree)")
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
 -      .map_io         = omap_generic_map_io,
 -      .init_early     = omap_generic_init_early,
 +      .map_io         = omap243x_map_io,
 +      .init_early     = omap2430_init_early,
        .init_irq       = omap2_init_irq,
        .init_machine   = omap_generic_init,
        .timer          = &omap2_timer,
 +      .dt_compat      = omap243x_boards_compat,
 +MACHINE_END
 +#endif
 +
 +#if defined(CONFIG_ARCH_OMAP3)
 +static const char *omap3_boards_compat[] __initdata = {
 +      "ti,omap3",
 +      NULL,
 +};
 +
 +DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)")
++      .atag_offset    = 0x100,
 +      .reserve        = omap_reserve,
 +      .map_io         = omap3_map_io,
 +      .init_early     = omap3430_init_early,
 +      .init_irq       = omap3_init_irq,
 +      .init_machine   = omap3_init,
 +      .timer          = &omap3_timer,
 +      .dt_compat      = omap3_boards_compat,
 +MACHINE_END
 +#endif
 +
 +#if defined(CONFIG_ARCH_OMAP4)
 +static const char *omap4_boards_compat[] __initdata = {
 +      "ti,omap4",
 +      NULL,
 +};
 +
 +DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
++      .atag_offset    = 0x100,
 +      .reserve        = omap_reserve,
 +      .map_io         = omap4_map_io,
 +      .init_early     = omap4430_init_early,
 +      .init_irq       = gic_init_irq,
 +      .init_machine   = omap4_init,
 +      .timer          = &omap4_timer,
 +      .dt_compat      = omap4_boards_compat,
  MACHINE_END
 +#endif
@@@ -290,6 -290,17 +290,6 @@@ static struct omap_board_config_kernel 
        { OMAP_TAG_LCD,         &h4_lcd_config },
  };
  
 -static void __init omap_h4_init_early(void)
 -{
 -      omap2_init_common_infrastructure();
 -      omap2_init_common_devices(NULL, NULL);
 -}
 -
 -static void __init omap_h4_init_irq(void)
 -{
 -      omap2_init_irq();
 -}
 -
  static struct at24_platform_data m24c01 = {
        .byte_len       = SZ_1K / 8,
        .page_size      = 16,
@@@ -360,17 -371,22 +360,17 @@@ static void __init omap_h4_init(void
        platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices));
        omap2_usbfs_init(&h4_usb_config);
        omap_serial_init();
 +      omap_sdrc_init(NULL, NULL);
        h4_init_flash();
  }
  
 -static void __init omap_h4_map_io(void)
 -{
 -      omap2_set_globals_242x();
 -      omap242x_map_common_io();
 -}
 -
  MACHINE_START(OMAP_H4, "OMAP2420 H4 board")
        /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
 -      .map_io         = omap_h4_map_io,
 -      .init_early     = omap_h4_init_early,
 -      .init_irq       = omap_h4_init_irq,
 +      .map_io         = omap242x_map_io,
 +      .init_early     = omap2420_init_early,
 +      .init_irq       = omap2_init_irq,
        .init_machine   = omap_h4_init,
        .timer          = &omap2_timer,
  MACHINE_END
@@@ -491,6 -491,13 +491,6 @@@ static struct platform_device *igep_dev
        &igep_vwlan_device,
  };
  
 -static void __init igep_init_early(void)
 -{
 -      omap2_init_common_infrastructure();
 -      omap2_init_common_devices(m65kxxxxam_sdrc_params,
 -                                m65kxxxxam_sdrc_params);
 -}
 -
  static int igep2_keymap[] = {
        KEY(0, 0, KEY_LEFT),
        KEY(0, 1, KEY_RIGHT),
@@@ -643,8 -650,6 +643,8 @@@ static void __init igep_init(void
        igep_i2c_init();
        platform_add_devices(igep_devices, ARRAY_SIZE(igep_devices));
        omap_serial_init();
 +      omap_sdrc_init(m65kxxxxam_sdrc_params,
 +                                m65kxxxxam_sdrc_params);
        usb_musb_init(NULL);
  
        igep_flash_init();
  }
  
  MACHINE_START(IGEP0020, "IGEP v2 board")
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
        .map_io         = omap3_map_io,
 -      .init_early     = igep_init_early,
 +      .init_early     = omap35xx_init_early,
        .init_irq       = omap3_init_irq,
        .init_machine   = igep_init,
        .timer          = &omap3_timer,
  MACHINE_END
  
  MACHINE_START(IGEP0030, "IGEP OMAP3 module")
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
        .map_io         = omap3_map_io,
 -      .init_early     = igep_init_early,
 +      .init_early     = omap35xx_init_early,
        .init_irq       = omap3_init_irq,
        .init_machine   = igep_init,
        .timer          = &omap3_timer,
@@@ -193,6 -193,12 +193,6 @@@ static struct omap_board_config_kernel 
        { OMAP_TAG_LCD,         &ldp_lcd_config },
  };
  
 -static void __init omap_ldp_init_early(void)
 -{
 -      omap2_init_common_infrastructure();
 -      omap2_init_common_devices(NULL, NULL);
 -}
 -
  static struct twl4030_gpio_platform_data ldp_gpio_data = {
        .gpio_base      = OMAP_MAX_GPIO_LINES,
        .irq_base       = TWL4030_GPIO_IRQ_BASE,
@@@ -319,7 -325,6 +319,7 @@@ static void __init omap_ldp_init(void
        platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices));
        omap_ads7846_init(1, 54, 310, NULL);
        omap_serial_init();
 +      omap_sdrc_init(NULL, NULL);
        usb_musb_init(NULL);
        board_nand_init(ldp_nand_partitions,
                ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0);
  }
  
  MACHINE_START(OMAP_LDP, "OMAP LDP board")
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
        .map_io         = omap3_map_io,
 -      .init_early     = omap_ldp_init_early,
 +      .init_early     = omap3430_init_early,
        .init_irq       = omap3_init_irq,
        .init_machine   = omap_ldp_init,
        .timer          = &omap3_timer,
@@@ -616,6 -616,18 +616,6 @@@ static struct i2c_board_info n810_i2c_b
        },
  };
  
 -static void __init n8x0_map_io(void)
 -{
 -      omap2_set_globals_242x();
 -      omap242x_map_common_io();
 -}
 -
 -static void __init n8x0_init_early(void)
 -{
 -      omap2_init_common_infrastructure();
 -      omap2_init_common_devices(NULL, NULL);
 -}
 -
  #ifdef CONFIG_OMAP_MUX
  static struct omap_board_mux board_mux[] __initdata = {
        /* I2S codec port pins for McBSP block */
@@@ -677,37 -689,36 +677,37 @@@ static void __init n8x0_init_machine(vo
                i2c_register_board_info(2, n810_i2c_board_info_2,
                                        ARRAY_SIZE(n810_i2c_board_info_2));
        board_serial_init();
 +      omap_sdrc_init(NULL, NULL);
        gpmc_onenand_init(board_onenand_data);
        n8x0_mmc_init();
        n8x0_usb_init();
  }
  
  MACHINE_START(NOKIA_N800, "Nokia N800")
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
 -      .map_io         = n8x0_map_io,
 -      .init_early     = n8x0_init_early,
 +      .map_io         = omap242x_map_io,
 +      .init_early     = omap2420_init_early,
        .init_irq       = omap2_init_irq,
        .init_machine   = n8x0_init_machine,
        .timer          = &omap2_timer,
  MACHINE_END
  
  MACHINE_START(NOKIA_N810, "Nokia N810")
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
 -      .map_io         = n8x0_map_io,
 -      .init_early     = n8x0_init_early,
 +      .map_io         = omap242x_map_io,
 +      .init_early     = omap2420_init_early,
        .init_irq       = omap2_init_irq,
        .init_machine   = n8x0_init_machine,
        .timer          = &omap2_timer,
  MACHINE_END
  
  MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
 -      .map_io         = n8x0_map_io,
 -      .init_early     = n8x0_init_early,
 +      .map_io         = omap242x_map_io,
 +      .init_early     = omap2420_init_early,
        .init_irq       = omap2_init_irq,
        .init_machine   = n8x0_init_machine,
        .timer          = &omap2_timer,
@@@ -447,6 -447,13 +447,6 @@@ static struct platform_device keys_gpi
  static void __init omap3_beagle_init_early(void)
  {
        omap2_init_common_infrastructure();
 -      omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
 -                                mt46h32m32lf6_sdrc_params);
 -}
 -
 -static void __init omap3_beagle_init_irq(void)
 -{
 -      omap3_init_irq();
  }
  
  static struct platform_device *omap3_beagle_devices[] __initdata = {
@@@ -486,8 -493,8 +486,8 @@@ static void __init beagle_opp_init(void
        if (cpu_is_omap3630()) {
                struct device *mpu_dev, *iva_dev;
  
 -              mpu_dev = omap2_get_mpuss_device();
 -              iva_dev = omap2_get_iva_device();
 +              mpu_dev = omap_device_get_by_hwmod_name("mpu");
 +              iva_dev = omap_device_get_by_hwmod_name("iva");
  
                if (!mpu_dev || !iva_dev) {
                        pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n",
@@@ -527,8 -534,6 +527,8 @@@ static void __init omap3_beagle_init(vo
                        ARRAY_SIZE(omap3_beagle_devices));
        omap_display_init(&beagle_dss_data);
        omap_serial_init();
 +      omap_sdrc_init(mt46h32m32lf6_sdrc_params,
 +                                mt46h32m32lf6_sdrc_params);
  
        omap_mux_init_gpio(170, OMAP_PIN_INPUT);
        /* REVISIT leave DVI powered down until it's needed ... */
  
  MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
        /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
        .map_io         = omap3_map_io,
        .init_early     = omap3_beagle_init_early,
 -      .init_irq       = omap3_beagle_init_irq,
 +      .init_irq       = omap3_init_irq,
        .init_machine   = omap3_beagle_init,
        .timer          = &omap3_secure_timer,
  MACHINE_END
@@@ -520,6 -520,12 +520,6 @@@ static int __init omap3_evm_i2c_init(vo
  static struct omap_board_config_kernel omap3_evm_config[] __initdata = {
  };
  
 -static void __init omap3_evm_init_early(void)
 -{
 -      omap2_init_common_infrastructure();
 -      omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL);
 -}
 -
  static struct usbhs_omap_board_data usbhs_bdata __initdata = {
  
        .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
@@@ -634,7 -640,6 +634,7 @@@ static void __init omap3_evm_init(void
        omap_display_init(&omap3_evm_dss_data);
  
        omap_serial_init();
 +      omap_sdrc_init(mt46h32m32lf6_sdrc_params, NULL);
  
        /* OMAP3EVM uses ISP1504 phy and so register nop transceiver */
        usb_nop_xceiv_register();
  
  MACHINE_START(OMAP3EVM, "OMAP3 EVM")
        /* Maintainer: Syed Mohammed Khasim - Texas Instruments */
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
        .map_io         = omap3_map_io,
 -      .init_early     = omap3_evm_init_early,
 +      .init_early     = omap35xx_init_early,
        .init_irq       = omap3_init_irq,
        .init_machine   = omap3_evm_init,
        .timer          = &omap3_timer,
@@@ -182,6 -182,12 +182,6 @@@ static inline void __init board_smsc911
        gpmc_smsc911x_init(&board_smsc911x_data);
  }
  
 -static void __init omap3logic_init_early(void)
 -{
 -      omap2_init_common_infrastructure();
 -      omap2_init_common_devices(NULL, NULL);
 -}
 -
  #ifdef CONFIG_OMAP_MUX
  static struct omap_board_mux board_mux[] __initdata = {
        { .reg_offset = OMAP_MUX_TERMINATOR },
@@@ -194,7 -200,6 +194,7 @@@ static void __init omap3logic_init(void
        omap3torpedo_fix_pbias_voltage();
        omap3logic_i2c_init();
        omap_serial_init();
 +      omap_sdrc_init(NULL, NULL);
        board_mmc_init();
        board_smsc911x_init();
  
  }
  
  MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board")
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .map_io         = omap3_map_io,
 -      .init_early     = omap3logic_init_early,
 +      .init_early     = omap35xx_init_early,
        .init_irq       = omap3_init_irq,
        .init_machine   = omap3logic_init,
        .timer          = &omap3_timer,
  MACHINE_END
  
  MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board")
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .map_io         = omap3_map_io,
 -      .init_early     = omap3logic_init_early,
 +      .init_early     = omap35xx_init_early,
        .init_irq       = omap3_init_irq,
        .init_machine   = omap3logic_init,
        .timer          = &omap3_timer,
@@@ -525,6 -525,13 +525,6 @@@ static struct spi_board_info omap3pando
        }
  };
  
 -static void __init omap3pandora_init_early(void)
 -{
 -      omap2_init_common_infrastructure();
 -      omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
 -                                mt46h32m32lf6_sdrc_params);
 -}
 -
  static void __init pandora_wl1251_init(void)
  {
        struct wl12xx_platform_data pandora_wl1251_pdata;
@@@ -586,8 -593,6 +586,8 @@@ static void __init omap3pandora_init(vo
                        ARRAY_SIZE(omap3pandora_devices));
        omap_display_init(&pandora_dss_data);
        omap_serial_init();
 +      omap_sdrc_init(mt46h32m32lf6_sdrc_params,
 +                                mt46h32m32lf6_sdrc_params);
        spi_register_board_info(omap3pandora_spi_board_info,
                        ARRAY_SIZE(omap3pandora_spi_board_info));
        omap_ads7846_init(1, OMAP3_PANDORA_TS_GPIO, 0, NULL);
  }
  
  MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console")
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
        .map_io         = omap3_map_io,
 -      .init_early     = omap3pandora_init_early,
 +      .init_early     = omap35xx_init_early,
        .init_irq       = omap3_init_irq,
        .init_machine   = omap3pandora_init,
        .timer          = &omap3_timer,
@@@ -428,6 -428,17 +428,6 @@@ static int __init omap3_stalker_i2c_ini
  static struct omap_board_config_kernel omap3_stalker_config[] __initdata = {
  };
  
 -static void __init omap3_stalker_init_early(void)
 -{
 -      omap2_init_common_infrastructure();
 -      omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL);
 -}
 -
 -static void __init omap3_stalker_init_irq(void)
 -{
 -      omap3_init_irq();
 -}
 -
  static struct platform_device *omap3_stalker_devices[] __initdata = {
        &keys_gpio,
  };
@@@ -467,7 -478,6 +467,7 @@@ static void __init omap3_stalker_init(v
        omap_display_init(&omap3_stalker_dss_data);
  
        omap_serial_init();
 +      omap_sdrc_init(mt46h32m32lf6_sdrc_params, NULL);
        usb_musb_init(NULL);
        usbhs_init(&usbhs_bdata);
        omap_ads7846_init(1, OMAP3_STALKER_TS_GPIO, 310, NULL);
  
  MACHINE_START(SBC3530, "OMAP3 STALKER")
        /* Maintainer: Jason Lam -lzg@ema-tech.com */
-       .boot_params            = 0x80000100,
+       .atag_offset            = 0x100,
        .map_io                 = omap3_map_io,
 -      .init_early             = omap3_stalker_init_early,
 -      .init_irq               = omap3_stalker_init_irq,
 +      .init_early             = omap35xx_init_early,
 +      .init_irq               = omap3_init_irq,
        .init_machine           = omap3_stalker_init,
        .timer                  = &omap3_secure_timer,
  MACHINE_END
@@@ -326,6 -326,18 +326,6 @@@ static struct omap_board_mux board_mux[
  };
  #endif
  
 -static void __init omap3_touchbook_init_early(void)
 -{
 -      omap2_init_common_infrastructure();
 -      omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
 -                                mt46h32m32lf6_sdrc_params);
 -}
 -
 -static void __init omap3_touchbook_init_irq(void)
 -{
 -      omap3_init_irq();
 -}
 -
  static struct platform_device *omap3_touchbook_devices[] __initdata = {
        &omap3_touchbook_lcd_device,
        &leds_gpio,
@@@ -373,8 -385,6 +373,8 @@@ static void __init omap3_touchbook_init
        platform_add_devices(omap3_touchbook_devices,
                        ARRAY_SIZE(omap3_touchbook_devices));
        omap_serial_init();
 +      omap_sdrc_init(mt46h32m32lf6_sdrc_params,
 +                                mt46h32m32lf6_sdrc_params);
  
        omap_mux_init_gpio(170, OMAP_PIN_INPUT);
        /* REVISIT leave DVI powered down until it's needed ... */
  
  MACHINE_START(TOUCHBOOK, "OMAP3 touchbook Board")
        /* Maintainer: Gregoire Gentil - http://www.alwaysinnovating.com */
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
        .map_io         = omap3_map_io,
 -      .init_early     = omap3_touchbook_init_early,
 -      .init_irq       = omap3_touchbook_init_irq,
 +      .init_early     = omap3430_init_early,
 +      .init_irq       = omap3_init_irq,
        .init_machine   = omap3_touchbook_init,
        .timer          = &omap3_secure_timer,
  MACHINE_END
@@@ -95,6 -95,12 +95,6 @@@ static struct platform_device *panda_de
        &wl1271_device,
  };
  
 -static void __init omap4_panda_init_early(void)
 -{
 -      omap2_init_common_infrastructure();
 -      omap2_init_common_devices(NULL, NULL);
 -}
 -
  static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
        .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
        .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
@@@ -563,19 -569,24 +563,19 @@@ static void __init omap4_panda_init(voi
        platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
        platform_device_register(&omap_vwlan_device);
        board_serial_init();
 +      omap_sdrc_init(NULL, NULL);
        omap4_twl6030_hsmmc_init(mmc);
        omap4_ehci_init();
        usb_musb_init(&musb_board_data);
        omap4_panda_display_init();
  }
  
 -static void __init omap4_panda_map_io(void)
 -{
 -      omap2_set_globals_443x();
 -      omap44xx_map_common_io();
 -}
 -
  MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board")
        /* Maintainer: David Anders - Texas Instruments Inc */
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
 -      .map_io         = omap4_panda_map_io,
 -      .init_early     = omap4_panda_init_early,
 +      .map_io         = omap4_map_io,
 +      .init_early     = omap4430_init_early,
        .init_irq       = gic_init_irq,
        .init_machine   = omap4_panda_init,
        .timer          = &omap4_timer,
@@@ -478,6 -478,13 +478,6 @@@ static int __init overo_spi_init(void
        return 0;
  }
  
 -static void __init overo_init_early(void)
 -{
 -      omap2_init_common_infrastructure();
 -      omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
 -                                mt46h32m32lf6_sdrc_params);
 -}
 -
  static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
        .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
        .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
@@@ -507,8 -514,6 +507,8 @@@ static void __init overo_init(void
        overo_i2c_init();
        omap_display_init(&overo_dss_data);
        omap_serial_init();
 +      omap_sdrc_init(mt46h32m32lf6_sdrc_params,
 +                                mt46h32m32lf6_sdrc_params);
        omap_nand_flash_init(0, overo_nand_partitions,
                             ARRAY_SIZE(overo_nand_partitions));
        usb_musb_init(NULL);
  }
  
  MACHINE_START(OVERO, "Gumstix Overo")
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
        .map_io         = omap3_map_io,
 -      .init_early     = overo_init_early,
 +      .init_early     = omap35xx_init_early,
        .init_irq       = omap3_init_irq,
        .init_machine   = overo_init,
        .timer          = &omap3_timer,
@@@ -123,6 -123,15 +123,6 @@@ static void __init rm680_peripherals_in
        omap2_hsmmc_init(mmc);
  }
  
 -static void __init rm680_init_early(void)
 -{
 -      struct omap_sdrc_params *sdrc_params;
 -
 -      omap2_init_common_infrastructure();
 -      sdrc_params = nokia_get_sdram_timings();
 -      omap2_init_common_devices(sdrc_params, sdrc_params);
 -}
 -
  #ifdef CONFIG_OMAP_MUX
  static struct omap_board_mux board_mux[] __initdata = {
        { .reg_offset = OMAP_MUX_TERMINATOR },
  
  static void __init rm680_init(void)
  {
 +      struct omap_sdrc_params *sdrc_params;
 +
        omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
        omap_serial_init();
 +
 +      sdrc_params = nokia_get_sdram_timings();
 +      omap_sdrc_init(sdrc_params, sdrc_params);
 +
        usb_musb_init(NULL);
        rm680_peripherals_init();
  }
  
 -static void __init rm680_map_io(void)
 -{
 -      omap2_set_globals_3xxx();
 -      omap34xx_map_common_io();
 -}
 -
  MACHINE_START(NOKIA_RM680, "Nokia RM-680 board")
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
 -      .map_io         = rm680_map_io,
 -      .init_early     = rm680_init_early,
 +      .map_io         = omap3_map_io,
 +      .init_early     = omap3630_init_early,
        .init_irq       = omap3_init_irq,
        .init_machine   = rm680_init,
        .timer          = &omap3_timer,
@@@ -102,6 -102,15 +102,6 @@@ static struct omap_board_config_kernel 
        { OMAP_TAG_LCD,         &rx51_lcd_config },
  };
  
 -static void __init rx51_init_early(void)
 -{
 -      struct omap_sdrc_params *sdrc_params;
 -
 -      omap2_init_common_infrastructure();
 -      sdrc_params = nokia_get_sdram_timings();
 -      omap2_init_common_devices(sdrc_params, sdrc_params);
 -}
 -
  extern void __init rx51_peripherals_init(void);
  
  #ifdef CONFIG_OMAP_MUX
@@@ -118,17 -127,11 +118,17 @@@ static struct omap_musb_board_data musb
  
  static void __init rx51_init(void)
  {
 +      struct omap_sdrc_params *sdrc_params;
 +
        omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
        omap_board_config = rx51_config;
        omap_board_config_size = ARRAY_SIZE(rx51_config);
        omap3_pm_init_cpuidle(rx51_cpuidle_params);
        omap_serial_init();
 +
 +      sdrc_params = nokia_get_sdram_timings();
 +      omap_sdrc_init(sdrc_params, sdrc_params);
 +
        usb_musb_init(&musb_board_data);
        rx51_peripherals_init();
  
        platform_device_register(&leds_gpio);
  }
  
 -static void __init rx51_map_io(void)
 -{
 -      omap2_set_globals_3xxx();
 -      omap34xx_map_common_io();
 -}
 -
  static void __init rx51_reserve(void)
  {
        rx51_video_mem_init();
  
  MACHINE_START(NOKIA_RX51, "Nokia RX-51 board")
        /* Maintainer: Lauri Leukkunen <lauri.leukkunen@nokia.com> */
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = rx51_reserve,
 -      .map_io         = rx51_map_io,
 -      .init_early     = rx51_init_early,
 +      .map_io         = omap3_map_io,
 +      .init_early     = omap3430_init_early,
        .init_irq       = omap3_init_irq,
        .init_machine   = rx51_init,
        .timer          = &omap3_timer,
  static struct omap_board_config_kernel ti8168_evm_config[] __initdata = {
  };
  
 -static void __init ti8168_init_early(void)
 -{
 -      omap2_init_common_infrastructure();
 -      omap2_init_common_devices(NULL, NULL);
 -}
 -
  static void __init ti8168_evm_init(void)
  {
        omap_serial_init();
 +      omap_sdrc_init(NULL, NULL);
        omap_board_config = ti8168_evm_config;
        omap_board_config_size = ARRAY_SIZE(ti8168_evm_config);
  }
@@@ -43,9 -48,9 +43,9 @@@ static void __init ti8168_evm_map_io(vo
  
  MACHINE_START(TI8168EVM, "ti8168evm")
        /* Maintainer: Texas Instruments */
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .map_io         = ti8168_evm_map_io,
 -      .init_early     = ti8168_init_early,
 +      .init_early     = ti816x_init_early,
        .init_irq       = ti816x_init_irq,
        .timer          = &omap3_timer,
        .init_machine   = ti8168_evm_init,
  
  #define ZOOM3_EHCI_RESET_GPIO         64
  
 -static void __init omap_zoom_init_early(void)
 -{
 -      omap2_init_common_infrastructure();
 -      if (machine_is_omap_zoom2())
 -              omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
 -                                        mt46h32m32lf6_sdrc_params);
 -      else if (machine_is_omap_zoom3())
 -              omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params,
 -                                        h8mbx00u0mer0em_sdrc_params);
 -}
 -
  #ifdef CONFIG_OMAP_MUX
  static struct omap_board_mux board_mux[] __initdata = {
        /* WLAN IRQ - GPIO 162 */
@@@ -118,32 -129,24 +118,32 @@@ static void __init omap_zoom_init(void
                                                ZOOM_NAND_CS, NAND_BUSWIDTH_16);
        zoom_debugboard_init();
        zoom_peripherals_init();
 +
 +      if (machine_is_omap_zoom2())
 +              omap_sdrc_init(mt46h32m32lf6_sdrc_params,
 +                                        mt46h32m32lf6_sdrc_params);
 +      else if (machine_is_omap_zoom3())
 +              omap_sdrc_init(h8mbx00u0mer0em_sdrc_params,
 +                                        h8mbx00u0mer0em_sdrc_params);
 +
        zoom_display_init();
  }
  
  MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board")
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
        .map_io         = omap3_map_io,
 -      .init_early     = omap_zoom_init_early,
 +      .init_early     = omap3430_init_early,
        .init_irq       = omap3_init_irq,
        .init_machine   = omap_zoom_init,
        .timer          = &omap3_timer,
  MACHINE_END
  
  MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
        .map_io         = omap3_map_io,
 -      .init_early     = omap_zoom_init_early,
 +      .init_early     = omap3630_init_early,
        .init_irq       = omap3_init_irq,
        .init_machine   = omap_zoom_init,
        .timer          = &omap3_timer,
diff --combined arch/arm/mach-omap2/io.c
@@@ -16,7 -16,6 +16,6 @@@
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   */
  #include <linux/module.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
@@@ -38,7 -37,6 +37,7 @@@
  #include "io.h"
  
  #include <plat/omap-pm.h>
 +#include "voltage.h"
  #include "powerdomain.h"
  
  #include "clockdomain.h"
@@@ -251,6 -249,7 +250,7 @@@ static void __init _omap2_map_common_io
  
        omap2_check_revision();
        omap_sram_init();
+       omap_init_consistent_dma_size();
  }
  
  #ifdef CONFIG_SOC_OMAP2420
@@@ -342,22 -341,18 +342,22 @@@ void __init omap2_init_common_infrastru
        u8 postsetup_state;
  
        if (cpu_is_omap242x()) {
 -              omap2xxx_powerdomains_init();
 -              omap2xxx_clockdomains_init();
 +              omap2xxx_voltagedomains_init();
 +              omap242x_powerdomains_init();
 +              omap242x_clockdomains_init();
                omap2420_hwmod_init();
        } else if (cpu_is_omap243x()) {
 -              omap2xxx_powerdomains_init();
 -              omap2xxx_clockdomains_init();
 +              omap2xxx_voltagedomains_init();
 +              omap243x_powerdomains_init();
 +              omap243x_clockdomains_init();
                omap2430_hwmod_init();
        } else if (cpu_is_omap34xx()) {
 +              omap3xxx_voltagedomains_init();
                omap3xxx_powerdomains_init();
                omap3xxx_clockdomains_init();
                omap3xxx_hwmod_init();
        } else if (cpu_is_omap44xx()) {
 +              omap44xx_voltagedomains_init();
                omap44xx_powerdomains_init();
                omap44xx_clockdomains_init();
                omap44xx_hwmod_init();
         * omap_hwmod_late_init(), so boards that desire full watchdog
         * coverage of kernel initialization can reprogram the
         * postsetup_state between the calls to
 -       * omap2_init_common_infra() and omap2_init_common_devices().
 +       * omap2_init_common_infra() and omap_sdrc_init().
         *
         * XXX ideally we could detect whether the MPU WDT was currently
         * enabled here and make this conditional
                pr_err("Could not init clock framework - unknown SoC\n");
  }
  
 -void __init omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0,
 +void __init omap2420_init_early(void)
 +{
 +      omap2_init_common_infrastructure();
 +}
 +
 +void __init omap2430_init_early(void)
 +{
 +      omap2_init_common_infrastructure();
 +}
 +
 +void __init omap3430_init_early(void)
 +{
 +      omap2_init_common_infrastructure();
 +}
 +
 +void __init omap35xx_init_early(void)
 +{
 +      omap2_init_common_infrastructure();
 +}
 +
 +void __init omap3630_init_early(void)
 +{
 +      omap2_init_common_infrastructure();
 +}
 +
 +void __init am35xx_init_early(void)
 +{
 +      omap2_init_common_infrastructure();
 +}
 +
 +void __init ti816x_init_early(void)
 +{
 +      omap2_init_common_infrastructure();
 +}
 +
 +void __init omap4430_init_early(void)
 +{
 +      omap2_init_common_infrastructure();
 +}
 +
 +void __init omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
                                      struct omap_sdrc_params *sdrc_cs1)
  {
        if (cpu_is_omap24xx() || omap3_has_sdrc()) {
diff --combined arch/arm/mm/init.c
@@@ -496,13 -496,6 +496,13 @@@ static void __init free_unused_memmap(s
                 */
                bank_start = min(bank_start,
                                 ALIGN(prev_bank_end, PAGES_PER_SECTION));
 +#else
 +              /*
 +               * Align down here since the VM subsystem insists that the
 +               * memmap entries are valid from the bank start aligned to
 +               * MAX_ORDER_NR_PAGES.
 +               */
 +              bank_start = round_down(bank_start, MAX_ORDER_NR_PAGES);
  #endif
                /*
                 * If we had a previous bank, and there is a space
@@@ -660,9 -653,6 +660,6 @@@ void __init mem_init(void
                        "    ITCM    : 0x%08lx - 0x%08lx   (%4ld kB)\n"
  #endif
                        "    fixmap  : 0x%08lx - 0x%08lx   (%4ld kB)\n"
- #ifdef CONFIG_MMU
-                       "    DMA     : 0x%08lx - 0x%08lx   (%4ld MB)\n"
- #endif
                        "    vmalloc : 0x%08lx - 0x%08lx   (%4ld MB)\n"
                        "    lowmem  : 0x%08lx - 0x%08lx   (%4ld MB)\n"
  #ifdef CONFIG_HIGHMEM
                        MLK(ITCM_OFFSET, (unsigned long) itcm_end),
  #endif
                        MLK(FIXADDR_START, FIXADDR_TOP),
- #ifdef CONFIG_MMU
-                       MLM(CONSISTENT_BASE, CONSISTENT_END),
- #endif
                        MLM(VMALLOC_START, VMALLOC_END),
                        MLM(PAGE_OFFSET, (unsigned long)high_memory),
  #ifdef CONFIG_HIGHMEM
         * be detected at build time already.
         */
  #ifdef CONFIG_MMU
-       BUILD_BUG_ON(VMALLOC_END                        > CONSISTENT_BASE);
-       BUG_ON(VMALLOC_END                              > CONSISTENT_BASE);
        BUILD_BUG_ON(TASK_SIZE                          > MODULES_VADDR);
        BUG_ON(TASK_SIZE                                > MODULES_VADDR);
  #endif
  
  #define OMAP44XX_EMIF2_PHYS   OMAP44XX_EMIF2_BASE
                                                /* 0x4d000000 --> 0xfd200000 */
 -#define OMAP44XX_EMIF2_VIRT   (OMAP44XX_EMIF2_PHYS + OMAP4_L3_PER_IO_OFFSET)
  #define OMAP44XX_EMIF2_SIZE   SZ_1M
 +#define OMAP44XX_EMIF2_VIRT   (OMAP44XX_EMIF1_VIRT + OMAP44XX_EMIF1_SIZE)
  
  #define OMAP44XX_DMM_PHYS     OMAP44XX_DMM_BASE
                                                /* 0x4e000000 --> 0xfd300000 */
 -#define OMAP44XX_DMM_VIRT     (OMAP44XX_DMM_PHYS + OMAP4_L3_PER_IO_OFFSET)
  #define OMAP44XX_DMM_SIZE     SZ_1M
 +#define OMAP44XX_DMM_VIRT     (OMAP44XX_EMIF2_VIRT + OMAP44XX_EMIF2_SIZE)
  /*
   * ----------------------------------------------------------------------------
   * Omap specific register access
@@@ -300,7 -300,7 +300,7 @@@ static inline void omap44xx_map_common_
  #endif
  
  extern void omap2_init_common_infrastructure(void);
 -extern void omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0,
 +extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
                                      struct omap_sdrc_params *sdrc_cs1);
  
  #define __arch_ioremap        omap_ioremap
  void __iomem *omap_ioremap(unsigned long phys, size_t size, unsigned int type);
  void omap_iounmap(volatile void __iomem *addr);
  
+ extern void __init omap_init_consistent_dma_size(void);
  #endif
  
  #endif