Merge branch 'devel-map-io' into omap-for-linus
Tony Lindgren [Wed, 4 Aug 2010 11:43:45 +0000 (14:43 +0300)]
35 files changed:
1  2 
arch/arm/mach-omap1/board-ams-delta.c
arch/arm/mach-omap1/board-fsample.c
arch/arm/mach-omap1/board-generic.c
arch/arm/mach-omap1/board-h2.c
arch/arm/mach-omap1/board-h3.c
arch/arm/mach-omap1/board-htcherald.c
arch/arm/mach-omap1/board-innovator.c
arch/arm/mach-omap1/board-nokia770.c
arch/arm/mach-omap1/board-osk.c
arch/arm/mach-omap1/board-palmte.c
arch/arm/mach-omap1/board-palmtt.c
arch/arm/mach-omap1/board-palmz71.c
arch/arm/mach-omap1/board-perseus2.c
arch/arm/mach-omap1/board-sx1.c
arch/arm/mach-omap1/board-voiceblue.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-apollon.c
arch/arm/mach-omap2/board-cm-t35.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-ldp.c
arch/arm/mach-omap2/board-n8x0.c
arch/arm/mach-omap2/board-omap3beagle.c
arch/arm/mach-omap2/board-omap3pandora.c
arch/arm/mach-omap2/board-omap3touchbook.c
arch/arm/mach-omap2/board-overo.c
arch/arm/mach-omap2/board-zoom2.c
arch/arm/mach-omap2/board-zoom3.c
arch/arm/mach-omap2/clock3xxx_data.c
arch/arm/mach-omap2/io.c
arch/arm/plat-omap/include/plat/common.h

@@@ -235,7 -235,7 +235,7 @@@ static void __init ams_delta_init(void
        /* Clear latch2 (NAND, LCD, modem enable) */
        ams_delta_latch2_write(~0, 0);
  
 -      omap_usb_init(&ams_delta_usb_config);
 +      omap1_usb_init(&ams_delta_usb_config);
        platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices));
  
  #ifdef CONFIG_AMS_DELTA_FIQ
@@@ -301,6 -301,7 +301,7 @@@ MACHINE_START(AMS_DELTA, "Amstrad E3 (D
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
        .map_io         = ams_delta_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = ams_delta_init_irq,
        .init_machine   = ams_delta_init,
        .timer          = &omap_timer,
@@@ -292,18 -292,6 +292,18 @@@ static void __init omap_fsample_init(vo
        omap_cfg_reg(L3_1610_FLASH_CS2B_OE);
        omap_cfg_reg(M8_1610_FLASH_CS2B_WE);
  
 +      /* Mux pins for keypad */
 +      omap_cfg_reg(E2_7XX_KBR0);
 +      omap_cfg_reg(J7_7XX_KBR1);
 +      omap_cfg_reg(E1_7XX_KBR2);
 +      omap_cfg_reg(F3_7XX_KBR3);
 +      omap_cfg_reg(D2_7XX_KBR4);
 +      omap_cfg_reg(C2_7XX_KBC0);
 +      omap_cfg_reg(D3_7XX_KBC1);
 +      omap_cfg_reg(E4_7XX_KBC2);
 +      omap_cfg_reg(F4_7XX_KBC3);
 +      omap_cfg_reg(E3_7XX_KBC4);
 +
        platform_add_devices(devices, ARRAY_SIZE(devices));
  
        omap_board_config = fsample_config;
@@@ -390,6 -378,7 +390,7 @@@ MACHINE_START(OMAP_FSAMPLE, "OMAP730 F-
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
        .map_io         = omap_fsample_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_fsample_init_irq,
        .init_machine   = omap_fsample_init,
        .timer          = &omap_timer,
@@@ -72,12 -72,12 +72,12 @@@ static void __init omap_generic_init(vo
                omap_cfg_reg(UART3_TX);
                omap_cfg_reg(UART3_RX);
  
 -              omap_usb_init(&generic1510_usb_config);
 +              omap1_usb_init(&generic1510_usb_config);
        }
  #endif
  #if defined(CONFIG_ARCH_OMAP16XX)
        if (!cpu_is_omap1510()) {
 -              omap_usb_init(&generic1610_usb_config);
 +              omap1_usb_init(&generic1610_usb_config);
        }
  #endif
  
@@@ -98,6 -98,7 +98,7 @@@ MACHINE_START(OMAP_GENERIC, "Generic OM
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
        .map_io         = omap_generic_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_generic_init_irq,
        .init_machine   = omap_generic_init,
        .timer          = &omap_timer,
@@@ -292,6 -292,15 +292,6 @@@ static struct platform_device h2_kp_dev
  
  #define H2_IRDA_FIRSEL_GPIO_PIN       17
  
 -#if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE)
 -static int h2_transceiver_mode(struct device *dev, int state)
 -{
 -      /* SIR when low, else MIR/FIR when HIGH */
 -      gpio_set_value(H2_IRDA_FIRSEL_GPIO_PIN, !(state & IR_SIRMODE));
 -      return 0;
 -}
 -#endif
 -
  static struct omap_irda_config h2_irda_data = {
        .transceiver_cap        = IR_SIRMODE | IR_MIRMODE | IR_FIRMODE,
        .rx_channel             = OMAP_DMA_UART3_RX,
@@@ -428,18 -437,14 +428,18 @@@ static void __init h2_init(void
        /* omap_cfg_reg(U19_ARMIO1); */         /* CD */
        omap_cfg_reg(BALLOUT_V8_ARMIO3);        /* WP */
  
 -      /* Irda */
 -#if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE)
 -      omap_writel(omap_readl(FUNC_MUX_CTRL_A) | 7, FUNC_MUX_CTRL_A);
 -      if (gpio_request(H2_IRDA_FIRSEL_GPIO_PIN, "IRDA mode") < 0)
 -              BUG();
 -      gpio_direction_output(H2_IRDA_FIRSEL_GPIO_PIN, 0);
 -      h2_irda_data.transceiver_mode = h2_transceiver_mode;
 -#endif
 +      /* Mux pins for keypad */
 +      omap_cfg_reg(F18_1610_KBC0);
 +      omap_cfg_reg(D20_1610_KBC1);
 +      omap_cfg_reg(D19_1610_KBC2);
 +      omap_cfg_reg(E18_1610_KBC3);
 +      omap_cfg_reg(C21_1610_KBC4);
 +      omap_cfg_reg(G18_1610_KBR0);
 +      omap_cfg_reg(F19_1610_KBR1);
 +      omap_cfg_reg(H14_1610_KBR2);
 +      omap_cfg_reg(E20_1610_KBR3);
 +      omap_cfg_reg(E19_1610_KBR4);
 +      omap_cfg_reg(N19_1610_KBR5);
  
        platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices));
        omap_board_config = h2_config;
        omap_serial_init();
        omap_register_i2c_bus(1, 100, h2_i2c_board_info,
                              ARRAY_SIZE(h2_i2c_board_info));
 -      omap_usb_init(&h2_usb_config);
 +      omap1_usb_init(&h2_usb_config);
        h2_mmc_init();
  }
  
@@@ -462,6 -467,7 +462,7 @@@ MACHINE_START(OMAP_H2, "TI-H2"
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
        .map_io         = h2_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = h2_init_irq,
        .init_machine   = h2_init,
        .timer          = &omap_timer,
@@@ -397,19 -397,6 +397,19 @@@ static void __init h3_init(void
        /* GPIO10 pullup/down register, Enable pullup on GPIO10 */
        omap_cfg_reg(V2_1710_GPIO10);
  
 +      /* Mux pins for keypad */
 +      omap_cfg_reg(F18_1610_KBC0);
 +      omap_cfg_reg(D20_1610_KBC1);
 +      omap_cfg_reg(D19_1610_KBC2);
 +      omap_cfg_reg(E18_1610_KBC3);
 +      omap_cfg_reg(C21_1610_KBC4);
 +      omap_cfg_reg(G18_1610_KBR0);
 +      omap_cfg_reg(F19_1610_KBR1);
 +      omap_cfg_reg(H14_1610_KBR2);
 +      omap_cfg_reg(E20_1610_KBR3);
 +      omap_cfg_reg(E19_1610_KBR4);
 +      omap_cfg_reg(N19_1610_KBR5);
 +
        platform_add_devices(devices, ARRAY_SIZE(devices));
        spi_register_board_info(h3_spi_board_info,
                                ARRAY_SIZE(h3_spi_board_info));
        omap_serial_init();
        omap_register_i2c_bus(1, 100, h3_i2c_board_info,
                              ARRAY_SIZE(h3_i2c_board_info));
 -      omap_usb_init(&h3_usb_config);
 +      omap1_usb_init(&h3_usb_config);
        h3_mmc_init();
  }
  
@@@ -450,6 -437,7 +450,7 @@@ MACHINE_START(OMAP_H3, "TI OMAP1710 H3 
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
        .map_io         = h3_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = h3_init_irq,
        .init_machine   = h3_init,
        .timer          = &omap_timer,
@@@ -287,7 -287,7 +287,7 @@@ static void __init htcherald_init(void
        htcherald_disable_watchdog();
  
        htcherald_usb_enable();
 -      omap_usb_init(&htcherald_usb_config);
 +      omap1_usb_init(&htcherald_usb_config);
  }
  
  static void __init htcherald_init_irq(void)
@@@ -304,6 -304,7 +304,7 @@@ MACHINE_START(HERALD, "HTC Herald"
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
        .map_io         = htcherald_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = htcherald_init_irq,
        .init_machine   = htcherald_init,
        .timer          = &omap_timer,
@@@ -422,13 -422,13 +422,13 @@@ static void __init innovator_init(void
  
  #ifdef CONFIG_ARCH_OMAP15XX
        if (cpu_is_omap1510()) {
 -              omap_usb_init(&innovator1510_usb_config);
 +              omap1_usb_init(&innovator1510_usb_config);
                innovator_config[1].data = &innovator1510_lcd_config;
        }
  #endif
  #ifdef CONFIG_ARCH_OMAP16XX
        if (cpu_is_omap1610()) {
 -              omap_usb_init(&h2_usb_config);
 +              omap1_usb_init(&h2_usb_config);
                innovator_config[1].data = &innovator1610_lcd_config;
        }
  #endif
@@@ -463,6 -463,7 +463,7 @@@ MACHINE_START(OMAP_INNOVATOR, "TI-Innov
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
        .map_io         = innovator_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = innovator_init_irq,
        .init_machine   = innovator_init,
        .timer          = &omap_timer,
@@@ -32,6 -32,7 +32,6 @@@
  #include <plat/board.h>
  #include <plat/keypad.h>
  #include <plat/common.h>
 -#include <plat/dsp_common.h>
  #include <plat/hwa742.h>
  #include <plat/lcd_mipid.h>
  #include <plat/mmc.h>
@@@ -241,6 -242,138 +241,6 @@@ static inline void nokia770_mmc_init(vo
  }
  #endif
  
 -#if   defined(CONFIG_OMAP_DSP)
 -/*
 - * audio power control
 - */
 -#define       HEADPHONE_GPIO          14
 -#define       AMPLIFIER_CTRL_GPIO     58
 -
 -static struct clk *dspxor_ck;
 -static DEFINE_MUTEX(audio_pwr_lock);
 -/*
 - * audio_pwr_state
 - * +--+-------------------------+---------------------------------------+
 - * |-1|down                   |power-up request -> 0                  |
 - * +--+-------------------------+---------------------------------------+
 - * | 0|up                     |power-down(1) request -> 1             |
 - * |  |                               |power-down(2) request -> (ignore)      |
 - * +--+-------------------------+---------------------------------------+
 - * | 1|up,                    |power-up request -> 0                  |
 - * |  |received down(1) request       |power-down(2) request -> -1            |
 - * +--+-------------------------+---------------------------------------+
 - */
 -static int audio_pwr_state = -1;
 -
 -static inline void aic23_power_up(void)
 -{
 -}
 -static inline void aic23_power_down(void)
 -{
 -}
 -
 -/*
 - * audio_pwr_up / down should be called under audio_pwr_lock
 - */
 -static void nokia770_audio_pwr_up(void)
 -{
 -      clk_enable(dspxor_ck);
 -
 -      /* Turn on codec */
 -      aic23_power_up();
 -
 -      if (gpio_get_value(HEADPHONE_GPIO))
 -              /* HP not connected, turn on amplifier */
 -              gpio_set_value(AMPLIFIER_CTRL_GPIO, 1);
 -      else
 -              /* HP connected, do not turn on amplifier */
 -              printk("HP connected\n");
 -}
 -
 -static void codec_delayed_power_down(struct work_struct *work)
 -{
 -      mutex_lock(&audio_pwr_lock);
 -      if (audio_pwr_state == -1)
 -              aic23_power_down();
 -      clk_disable(dspxor_ck);
 -      mutex_unlock(&audio_pwr_lock);
 -}
 -
 -static DECLARE_DELAYED_WORK(codec_power_down_work, codec_delayed_power_down);
 -
 -static void nokia770_audio_pwr_down(void)
 -{
 -      /* Turn off amplifier */
 -      gpio_set_value(AMPLIFIER_CTRL_GPIO, 0);
 -
 -      /* Turn off codec: schedule delayed work */
 -      schedule_delayed_work(&codec_power_down_work, HZ / 20); /* 50ms */
 -}
 -
 -static int
 -nokia770_audio_pwr_up_request(struct dsp_kfunc_device *kdev, int stage)
 -{
 -      mutex_lock(&audio_pwr_lock);
 -      if (audio_pwr_state == -1)
 -              nokia770_audio_pwr_up();
 -      /* force audio_pwr_state = 0, even if it was 1. */
 -      audio_pwr_state = 0;
 -      mutex_unlock(&audio_pwr_lock);
 -      return 0;
 -}
 -
 -static int
 -nokia770_audio_pwr_down_request(struct dsp_kfunc_device *kdev, int stage)
 -{
 -      mutex_lock(&audio_pwr_lock);
 -      switch (stage) {
 -      case 1:
 -              if (audio_pwr_state == 0)
 -                      audio_pwr_state = 1;
 -              break;
 -      case 2:
 -              if (audio_pwr_state == 1) {
 -                      nokia770_audio_pwr_down();
 -                      audio_pwr_state = -1;
 -              }
 -              break;
 -      }
 -      mutex_unlock(&audio_pwr_lock);
 -      return 0;
 -}
 -
 -static struct dsp_kfunc_device nokia770_audio_device = {
 -      .name    = "audio",
 -      .type    = DSP_KFUNC_DEV_TYPE_AUDIO,
 -      .enable  = nokia770_audio_pwr_up_request,
 -      .disable = nokia770_audio_pwr_down_request,
 -};
 -
 -static __init int omap_dsp_init(void)
 -{
 -      int ret;
 -
 -      dspxor_ck = clk_get(0, "dspxor_ck");
 -      if (IS_ERR(dspxor_ck)) {
 -              printk(KERN_ERR "couldn't acquire dspxor_ck\n");
 -              return PTR_ERR(dspxor_ck);
 -      }
 -
 -      ret = dsp_kfunc_device_register(&nokia770_audio_device);
 -      if (ret) {
 -              printk(KERN_ERR
 -                     "KFUNC device registration faild: %s\n",
 -                     nokia770_audio_device.name);
 -              goto out;
 -      }
 -      return 0;
 - out:
 -      return ret;
 -}
 -#else
 -#define omap_dsp_init()               do {} while (0)
 -#endif        /* CONFIG_OMAP_DSP */
 -
  static void __init omap_nokia770_init(void)
  {
        platform_add_devices(nokia770_devices, ARRAY_SIZE(nokia770_devices));
        omap_gpio_init();
        omap_serial_init();
        omap_register_i2c_bus(1, 100, NULL, 0);
        hwa742_dev_init();
        ads7846_dev_init();
        mipid_dev_init();
 -      omap_usb_init(&nokia770_usb_config);
 +      omap1_usb_init(&nokia770_usb_config);
        nokia770_mmc_init();
  }
  
@@@ -266,6 -400,7 +266,7 @@@ MACHINE_START(NOKIA770, "Nokia 770"
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
        .map_io         = omap_nokia770_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_nokia770_init_irq,
        .init_machine   = omap_nokia770_init,
        .timer          = &omap_timer,
@@@ -560,7 -560,7 +560,7 @@@ static void __init osk_init(void
        l |= (3 << 1);
        omap_writel(l, USB_TRANSCEIVER_CTRL);
  
 -      omap_usb_init(&osk_usb_config);
 +      omap1_usb_init(&osk_usb_config);
  
        /* irq for tps65010 chip */
        /* bootloader effectively does:  omap_cfg_reg(U19_1610_MPUIO1); */
@@@ -584,6 -584,7 +584,7 @@@ MACHINE_START(OMAP_OSK, "TI-OSK"
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
        .map_io         = osk_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = osk_init_irq,
        .init_machine   = osk_init,
        .timer          = &omap_timer,
@@@ -213,6 -213,90 +213,6 @@@ static struct omap_lcd_config palmte_lc
        .ctrl_name      = "internal",
  };
  
 -#ifdef CONFIG_APM
 -/*
 - * Values measured in 10 minute intervals averaged over 10 samples.
 - * May differ slightly from device to device but should be accurate
 - * enough to give basic idea of battery life left and trigger
 - * potential alerts.
 - */
 -static const int palmte_battery_sample[] = {
 -      2194, 2157, 2138, 2120,
 -      2104, 2089, 2075, 2061,
 -      2048, 2038, 2026, 2016,
 -      2008, 1998, 1989, 1980,
 -      1970, 1958, 1945, 1928,
 -      1910, 1888, 1860, 1827,
 -      1791, 1751, 1709, 1656,
 -};
 -
 -#define INTERVAL              10
 -#define BATTERY_HIGH_TRESHOLD 66
 -#define BATTERY_LOW_TRESHOLD  33
 -
 -static void palmte_get_power_status(struct apm_power_info *info, int *battery)
 -{
 -      int charging, batt, hi, lo, mid;
 -
 -      charging = !gpio_get_value(PALMTE_DC_GPIO);
 -      batt = battery[0];
 -      if (charging)
 -              batt -= 60;
 -
 -      hi = ARRAY_SIZE(palmte_battery_sample);
 -      lo = 0;
 -
 -      info->battery_flag = 0;
 -      info->units = APM_UNITS_MINS;
 -
 -      if (batt > palmte_battery_sample[lo]) {
 -              info->battery_life = 100;
 -              info->time = INTERVAL * ARRAY_SIZE(palmte_battery_sample);
 -      } else if (batt <= palmte_battery_sample[hi - 1]) {
 -              info->battery_life = 0;
 -              info->time = 0;
 -      } else {
 -              while (hi > lo + 1) {
 -                      mid = (hi + lo) >> 1;
 -                      if (batt <= palmte_battery_sample[mid])
 -                              lo = mid;
 -                      else
 -                              hi = mid;
 -              }
 -
 -              mid = palmte_battery_sample[lo] - palmte_battery_sample[hi];
 -              hi = palmte_battery_sample[lo] - batt;
 -              info->battery_life = 100 - (100 * lo + 100 * hi / mid) /
 -                      ARRAY_SIZE(palmte_battery_sample);
 -              info->time = INTERVAL * (ARRAY_SIZE(palmte_battery_sample) -
 -                              lo) - INTERVAL * hi / mid;
 -      }
 -
 -      if (charging) {
 -              info->ac_line_status = APM_AC_ONLINE;
 -              info->battery_status = APM_BATTERY_STATUS_CHARGING;
 -              info->battery_flag |= APM_BATTERY_FLAG_CHARGING;
 -      } else {
 -              info->ac_line_status = APM_AC_OFFLINE;
 -              if (info->battery_life > BATTERY_HIGH_TRESHOLD)
 -                      info->battery_status = APM_BATTERY_STATUS_HIGH;
 -              else if (info->battery_life > BATTERY_LOW_TRESHOLD)
 -                      info->battery_status = APM_BATTERY_STATUS_LOW;
 -              else
 -                      info->battery_status = APM_BATTERY_STATUS_CRITICAL;
 -      }
 -
 -      if (info->battery_life > BATTERY_HIGH_TRESHOLD)
 -              info->battery_flag |= APM_BATTERY_FLAG_HIGH;
 -      else if (info->battery_life > BATTERY_LOW_TRESHOLD)
 -              info->battery_flag |= APM_BATTERY_FLAG_LOW;
 -      else
 -              info->battery_flag |= APM_BATTERY_FLAG_CRITICAL;
 -}
 -#else
 -#define palmte_get_power_status       NULL
 -#endif
 -
  static struct omap_board_config_kernel palmte_config[] __initdata = {
        { OMAP_TAG_LCD,         &palmte_lcd_config },
  };
@@@ -275,7 -359,7 +275,7 @@@ static void __init omap_palmte_init(voi
        spi_register_board_info(palmte_spi_info, ARRAY_SIZE(palmte_spi_info));
        palmte_misc_gpio_setup();
        omap_serial_init();
 -      omap_usb_init(&palmte_usb_config);
 +      omap1_usb_init(&palmte_usb_config);
        omap_register_i2c_bus(1, 100, NULL, 0);
  }
  
@@@ -289,6 -373,7 +289,7 @@@ MACHINE_START(OMAP_PALMTE, "OMAP310 bas
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
        .map_io         = omap_palmte_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_palmte_init_irq,
        .init_machine   = omap_palmte_init,
        .timer          = &omap_timer,
@@@ -307,7 -307,7 +307,7 @@@ static void __init omap_palmtt_init(voi
  
        spi_register_board_info(palmtt_boardinfo,ARRAY_SIZE(palmtt_boardinfo));
        omap_serial_init();
 -      omap_usb_init(&palmtt_usb_config);
 +      omap1_usb_init(&palmtt_usb_config);
        omap_register_i2c_bus(1, 100, NULL, 0);
  }
  
@@@ -321,6 -321,7 +321,7 @@@ MACHINE_START(OMAP_PALMTT, "OMAP1510 ba
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
        .map_io         = omap_palmtt_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_palmtt_init_irq,
        .init_machine   = omap_palmtt_init,
        .timer          = &omap_timer,
@@@ -325,7 -325,7 +325,7 @@@ omap_palmz71_init(void
  
        spi_register_board_info(palmz71_boardinfo,
                                ARRAY_SIZE(palmz71_boardinfo));
 -      omap_usb_init(&palmz71_usb_config);
 +      omap1_usb_init(&palmz71_usb_config);
        omap_serial_init();
        omap_register_i2c_bus(1, 100, NULL, 0);
        palmz71_gpio_setup(0);
@@@ -338,10 -338,12 +338,12 @@@ omap_palmz71_map_io(void
  }
  
  MACHINE_START(OMAP_PALMZ71, "OMAP310 based Palm Zire71")
-       .phys_io = 0xfff00000,
-       .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
-       .boot_params = 0x10000100,.map_io = omap_palmz71_map_io,
-       .init_irq = omap_palmz71_init_irq,
-       .init_machine = omap_palmz71_init,
-       .timer = &omap_timer,
+       .phys_io        = 0xfff00000,
+       .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
+       .boot_params    = 0x10000100,
+       .map_io         = omap_palmz71_map_io,
+       .reserve        = omap_reserve,
+       .init_irq       = omap_palmz71_init_irq,
+       .init_machine   = omap_palmz71_init,
+       .timer          = &omap_timer,
  MACHINE_END
@@@ -260,18 -260,6 +260,18 @@@ static void __init omap_perseus2_init(v
        omap_cfg_reg(L3_1610_FLASH_CS2B_OE);
        omap_cfg_reg(M8_1610_FLASH_CS2B_WE);
  
 +      /* Mux pins for keypad */
 +      omap_cfg_reg(E2_7XX_KBR0);
 +      omap_cfg_reg(J7_7XX_KBR1);
 +      omap_cfg_reg(E1_7XX_KBR2);
 +      omap_cfg_reg(F3_7XX_KBR3);
 +      omap_cfg_reg(D2_7XX_KBR4);
 +      omap_cfg_reg(C2_7XX_KBC0);
 +      omap_cfg_reg(D3_7XX_KBC1);
 +      omap_cfg_reg(E4_7XX_KBC2);
 +      omap_cfg_reg(F4_7XX_KBC3);
 +      omap_cfg_reg(E3_7XX_KBC4);
 +
        platform_add_devices(devices, ARRAY_SIZE(devices));
  
        omap_board_config = perseus2_config;
@@@ -351,6 -339,7 +351,7 @@@ MACHINE_START(OMAP_PERSEUS2, "OMAP730 P
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
        .map_io         = omap_perseus2_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_perseus2_init_irq,
        .init_machine   = omap_perseus2_init,
        .timer          = &omap_timer,
@@@ -392,7 -392,7 +392,7 @@@ static void __init omap_sx1_init(void
        omap_board_config_size = ARRAY_SIZE(sx1_config);
        omap_serial_init();
        omap_register_i2c_bus(1, 100, NULL, 0);
 -      omap_usb_init(&sx1_usb_config);
 +      omap1_usb_init(&sx1_usb_config);
        sx1_mmc_init();
  
        /* turn on USB power */
@@@ -423,7 -423,8 +423,8 @@@ MACHINE_START(SX1, "OMAP310 based Sieme
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
        .map_io         = omap_sx1_map_io,
-       .init_irq               = omap_sx1_init_irq,
+       .reserve        = omap_reserve,
+       .init_irq       = omap_sx1_init_irq,
        .init_machine   = omap_sx1_init,
        .timer          = &omap_timer,
  MACHINE_END
@@@ -198,7 -198,7 +198,7 @@@ static void __init voiceblue_init(void
        omap_board_config = voiceblue_config;
        omap_board_config_size = ARRAY_SIZE(voiceblue_config);
        omap_serial_init();
 -      omap_usb_init(&voiceblue_usb_config);
 +      omap1_usb_init(&voiceblue_usb_config);
        omap_register_i2c_bus(1, 100, NULL, 0);
  
        /* There is a good chance board is going up, so enable power LED
@@@ -287,6 -287,7 +287,7 @@@ MACHINE_START(VOICEBLUE, "VoiceBlue OMA
        .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
        .boot_params    = 0x10000100,
        .map_io         = voiceblue_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = voiceblue_init_irq,
        .init_machine   = voiceblue_init,
        .timer          = &omap_timer,
  #include <asm/mach/map.h>
  
  #include <mach/gpio.h>
 -#include <plat/mux.h>
  #include <plat/board.h>
  #include <plat/common.h>
  #include <plat/gpmc.h>
  #include <plat/usb.h>
  #include <plat/gpmc-smc91x.h>
  
 +#include "mux.h"
  #include "hsmmc.h"
  
  #define SDP2430_CS0_BASE      0x04000000
@@@ -122,7 -122,11 +122,7 @@@ static struct omap_smc91x_platform_dat
  
  static void __init board_smc91x_init(void)
  {
 -      if (omap_rev() > OMAP3430_REV_ES1_0)
 -              board_smc91x_data.gpio_irq = 6;
 -      else
 -              board_smc91x_data.gpio_irq = 29;
 -
 +      omap_mux_init_gpio(149, OMAP_PIN_INPUT);
        gpmc_smc91x_init(&board_smc91x_data);
  }
  
@@@ -213,30 -217,17 +213,30 @@@ static struct omap_usb_config sdp2430_u
        .pins[0]        = 3,
  };
  
 +#ifdef CONFIG_OMAP_MUX
 +static struct omap_board_mux board_mux[] __initdata = {
 +      { .reg_offset = OMAP_MUX_TERMINATOR },
 +};
 +#else
 +#define board_mux     NULL
 +#endif
 +
  static void __init omap_2430sdp_init(void)
  {
        int ret;
  
 +      omap2430_mux_init(board_mux, OMAP_PACKAGE_ZAC);
 +
        omap2430_i2c_init();
  
        platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices));
        omap_serial_init();
        omap2_hsmmc_init(mmc);
 -      omap_usb_init(&sdp2430_usb_config);
 +      omap2_usbfs_init(&sdp2430_usb_config);
 +
 +      omap_mux_init_signal("usb0hs_stp", OMAP_PULL_ENA | OMAP_PULL_UP);
        usb_musb_init(&musb_board_data);
 +
        board_smc91x_init();
  
        /* Turn off secondary LCD backlight */
@@@ -257,6 -248,7 +257,7 @@@ MACHINE_START(OMAP_2430SDP, "OMAP2430 s
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = omap_2430sdp_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_2430sdp_init_irq,
        .init_machine   = omap_2430sdp_init,
        .timer          = &omap_timer,
@@@ -41,7 -41,7 +41,7 @@@
  #include <plat/control.h>
  #include <plat/gpmc-smc91x.h>
  
 -#include <mach/board-sdp.h>
 +#include <mach/board-flash.h>
  
  #include "mux.h"
  #include "sdram-qimonda-hyb18m512160af-6.h"
@@@ -667,18 -667,6 +667,18 @@@ static struct omap_board_mux board_mux[
  #define board_mux     NULL
  #endif
  
 +/*
 + * SDP3430 V2 Board CS organization
 + * Different from SDP3430 V1. Now 4 switches used to specify CS
 + *
 + * See also the Switch S8 settings in the comments.
 + */
 +static char chip_sel_3430[][GPMC_CS_NUM] = {
 +      {PDC_NOR, PDC_NAND, PDC_ONENAND, DBG_MPDB, 0, 0, 0, 0}, /* S8:1111 */
 +      {PDC_ONENAND, PDC_NAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1110 */
 +      {PDC_NAND, PDC_ONENAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1101 */
 +};
 +
  static struct mtd_partition sdp_nor_partitions[] = {
        /* bootloader (U-Boot, etc) in first sector */
        {
@@@ -809,24 -797,19 +809,19 @@@ static void __init omap_3430sdp_init(vo
        omap_serial_init();
        usb_musb_init(&musb_board_data);
        board_smc91x_init();
 -      sdp_flash_init(sdp_flash_partitions);
 +      board_flash_init(sdp_flash_partitions, chip_sel_3430);
        sdp3430_display_init();
        enable_board_wakeup_source();
        usb_ehci_init(&ehci_pdata);
  }
  
- static void __init omap_3430sdp_map_io(void)
- {
-       omap2_set_globals_343x();
-       omap34xx_map_common_io();
- }
  MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board")
        /* Maintainer: Syed Khasim - Texas Instruments Inc */
        .phys_io        = 0x48000000,
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
-       .map_io         = omap_3430sdp_map_io,
+       .map_io         = omap3_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_3430sdp_init_irq,
        .init_machine   = omap_3430sdp_init,
        .timer          = &omap_timer,
  #include <plat/common.h>
  #include <plat/board.h>
  #include <plat/gpmc-smc91x.h>
  #include <plat/usb.h>
  
  #include <mach/board-zoom.h>
 +#include <mach/board-flash.h>
  
  #include "mux.h"
  #include "sdram-hynix-h8mbx00u0mer-0em.h"
@@@ -66,12 -66,6 +66,6 @@@ static const struct ehci_hcd_omap_platf
        .reset_gpio_port[2]  = -EINVAL
  };
  
- static void __init omap_sdp_map_io(void)
- {
-       omap2_set_globals_36xx();
-       omap34xx_map_common_io();
- }
  static struct omap_board_config_kernel sdp_config[] __initdata = {
  };
  
@@@ -93,131 -87,12 +87,131 @@@ static struct omap_board_mux board_mux[
  #define board_mux     NULL
  #endif
  
 +/*
 + * SDP3630 CS organization
 + * See also the Switch S8 settings in the comments.
 + */
 +static char chip_sel_sdp[][GPMC_CS_NUM] = {
 +      {PDC_NOR, PDC_NAND, PDC_ONENAND, DBG_MPDB, 0, 0, 0, 0}, /* S8:1111 */
 +      {PDC_ONENAND, PDC_NAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1110 */
 +      {PDC_NAND, PDC_ONENAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1101 */
 +};
 +
 +static struct mtd_partition sdp_nor_partitions[] = {
 +      /* bootloader (U-Boot, etc) in first sector */
 +      {
 +              .name           = "Bootloader-NOR",
 +              .offset         = 0,
 +              .size           = SZ_256K,
 +              .mask_flags     = MTD_WRITEABLE, /* force read-only */
 +      },
 +      /* bootloader params in the next sector */
 +      {
 +              .name           = "Params-NOR",
 +              .offset         = MTDPART_OFS_APPEND,
 +              .size           = SZ_256K,
 +              .mask_flags     = 0,
 +      },
 +      /* kernel */
 +      {
 +              .name           = "Kernel-NOR",
 +              .offset         = MTDPART_OFS_APPEND,
 +              .size           = SZ_2M,
 +              .mask_flags     = 0
 +      },
 +      /* file system */
 +      {
 +              .name           = "Filesystem-NOR",
 +              .offset         = MTDPART_OFS_APPEND,
 +              .size           = MTDPART_SIZ_FULL,
 +              .mask_flags     = 0
 +      }
 +};
 +
 +static struct mtd_partition sdp_onenand_partitions[] = {
 +      {
 +              .name           = "X-Loader-OneNAND",
 +              .offset         = 0,
 +              .size           = 4 * (64 * 2048),
 +              .mask_flags     = MTD_WRITEABLE  /* force read-only */
 +      },
 +      {
 +              .name           = "U-Boot-OneNAND",
 +              .offset         = MTDPART_OFS_APPEND,
 +              .size           = 2 * (64 * 2048),
 +              .mask_flags     = MTD_WRITEABLE  /* force read-only */
 +      },
 +      {
 +              .name           = "U-Boot Environment-OneNAND",
 +              .offset         = MTDPART_OFS_APPEND,
 +              .size           = 1 * (64 * 2048),
 +      },
 +      {
 +              .name           = "Kernel-OneNAND",
 +              .offset         = MTDPART_OFS_APPEND,
 +              .size           = 16 * (64 * 2048),
 +      },
 +      {
 +              .name           = "File System-OneNAND",
 +              .offset         = MTDPART_OFS_APPEND,
 +              .size           = MTDPART_SIZ_FULL,
 +      },
 +};
 +
 +static struct mtd_partition sdp_nand_partitions[] = {
 +      /* All the partition sizes are listed in terms of NAND block size */
 +      {
 +              .name           = "X-Loader-NAND",
 +              .offset         = 0,
 +              .size           = 4 * (64 * 2048),
 +              .mask_flags     = MTD_WRITEABLE,        /* force read-only */
 +      },
 +      {
 +              .name           = "U-Boot-NAND",
 +              .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x80000 */
 +              .size           = 10 * (64 * 2048),
 +              .mask_flags     = MTD_WRITEABLE,        /* force read-only */
 +      },
 +      {
 +              .name           = "Boot Env-NAND",
 +
 +              .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x1c0000 */
 +              .size           = 6 * (64 * 2048),
 +      },
 +      {
 +              .name           = "Kernel-NAND",
 +              .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x280000 */
 +              .size           = 40 * (64 * 2048),
 +      },
 +      {
 +              .name           = "File System - NAND",
 +              .size           = MTDPART_SIZ_FULL,
 +              .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x780000 */
 +      },
 +};
 +
 +static struct flash_partitions sdp_flash_partitions[] = {
 +      {
 +              .parts = sdp_nor_partitions,
 +              .nr_parts = ARRAY_SIZE(sdp_nor_partitions),
 +      },
 +      {
 +              .parts = sdp_onenand_partitions,
 +              .nr_parts = ARRAY_SIZE(sdp_onenand_partitions),
 +      },
 +      {
 +              .parts = sdp_nand_partitions,
 +              .nr_parts = ARRAY_SIZE(sdp_nand_partitions),
 +      },
 +};
 +
  static void __init omap_sdp_init(void)
  {
        omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
        omap_serial_init();
        zoom_peripherals_init();
        board_smc91x_init();
 +      board_flash_init(sdp_flash_partitions, chip_sel_sdp);
        enable_board_wakeup_source();
        usb_ehci_init(&ehci_pdata);
  }
@@@ -226,7 -101,8 +220,8 @@@ MACHINE_START(OMAP_3630SDP, "OMAP 3630S
        .phys_io        = 0x48000000,
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
-       .map_io         = omap_sdp_map_io,
+       .map_io         = omap3_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_sdp_init_irq,
        .init_machine   = omap_sdp_init,
        .timer          = &omap_timer,
@@@ -21,7 -21,6 +21,7 @@@
  #include <linux/spi/spi.h>
  #include <linux/i2c/twl.h>
  #include <linux/regulator/machine.h>
 +#include <linux/leds.h>
  
  #include <mach/hardware.h>
  #include <mach/omap4-common.h>
  #define ETH_KS8851_POWER_ON           48
  #define ETH_KS8851_QUART              138
  
 +static struct gpio_led sdp4430_gpio_leds[] = {
 +      {
 +              .name   = "omap4:green:debug0",
 +              .gpio   = 61,
 +      },
 +      {
 +              .name   = "omap4:green:debug1",
 +              .gpio   = 30,
 +      },
 +      {
 +              .name   = "omap4:green:debug2",
 +              .gpio   = 7,
 +      },
 +      {
 +              .name   = "omap4:green:debug3",
 +              .gpio   = 8,
 +      },
 +      {
 +              .name   = "omap4:green:debug4",
 +              .gpio   = 50,
 +      },
 +      {
 +              .name   = "omap4:blue:user",
 +              .gpio   = 169,
 +      },
 +      {
 +              .name   = "omap4:red:user",
 +              .gpio   = 170,
 +      },
 +      {
 +              .name   = "omap4:green:user",
 +              .gpio   = 139,
 +      },
 +
 +};
 +
 +static struct gpio_led_platform_data sdp4430_led_data = {
 +      .leds   = sdp4430_gpio_leds,
 +      .num_leds       = ARRAY_SIZE(sdp4430_gpio_leds),
 +};
 +
 +static struct platform_device sdp4430_leds_gpio = {
 +      .name   = "leds-gpio",
 +      .id     = -1,
 +      .dev    = {
 +              .platform_data = &sdp4430_led_data,
 +      },
 +};
  static struct spi_board_info sdp4430_spi_board_info[] __initdata = {
        {
                .modalias               = "ks8851",
@@@ -161,7 -112,6 +161,7 @@@ static struct platform_device sdp4430_l
  
  static struct platform_device *sdp4430_devices[] __initdata = {
        &sdp4430_lcd_device,
 +      &sdp4430_leds_gpio,
  };
  
  static struct omap_lcd_config sdp4430_lcd_config __initdata = {
@@@ -206,16 -156,14 +206,16 @@@ static struct omap2_hsmmc_info mmc[] = 
        {}      /* Terminator */
  };
  
 -static struct regulator_consumer_supply sdp4430_vmmc_supply[] = {
 +static struct regulator_consumer_supply sdp4430_vaux_supply[] = {
        {
                .supply = "vmmc",
 -              .dev_name = "mmci-omap-hs.0",
 +              .dev_name = "mmci-omap-hs.1",
        },
 +};
 +static struct regulator_consumer_supply sdp4430_vmmc_supply[] = {
        {
                .supply = "vmmc",
 -              .dev_name = "mmci-omap-hs.1",
 +              .dev_name = "mmci-omap-hs.0",
        },
  };
  
@@@ -262,8 -210,6 +262,8 @@@ static struct regulator_init_data sdp44
                                        | REGULATOR_CHANGE_MODE
                                        | REGULATOR_CHANGE_STATUS,
        },
 +      .num_consumer_supplies  = 1,
 +      .consumer_supplies      = sdp4430_vaux_supply,
  };
  
  static struct regulator_init_data sdp4430_vaux2 = {
@@@ -304,7 -250,7 +304,7 @@@ static struct regulator_init_data sdp44
                                        | REGULATOR_CHANGE_MODE
                                        | REGULATOR_CHANGE_STATUS,
        },
 -      .num_consumer_supplies  = 2,
 +      .num_consumer_supplies  = 1,
        .consumer_supplies      = sdp4430_vmmc_supply,
  };
  
@@@ -407,11 -353,6 +407,11 @@@ static struct i2c_board_info __initdat
                .platform_data = &sdp4430_twldata,
        },
  };
 +static struct i2c_board_info __initdata sdp4430_i2c_3_boardinfo[] = {
 +      {
 +              I2C_BOARD_INFO("tmp105", 0x48),
 +      },
 +};
  static int __init omap4_i2c_init(void)
  {
        /*
        omap_register_i2c_bus(1, 400, sdp4430_i2c_boardinfo,
                        ARRAY_SIZE(sdp4430_i2c_boardinfo));
        omap_register_i2c_bus(2, 400, NULL, 0);
 -      omap_register_i2c_bus(3, 400, NULL, 0);
 +      omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo,
 +                              ARRAY_SIZE(sdp4430_i2c_3_boardinfo));
        omap_register_i2c_bus(4, 400, NULL, 0);
        return 0;
  }
@@@ -462,6 -402,7 +462,7 @@@ MACHINE_START(OMAP_4430SDP, "OMAP4430 4
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = omap_4430sdp_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_4430sdp_init_irq,
        .init_machine   = omap_4430sdp_init,
        .timer          = &omap_timer,
  
  #include <mach/gpio.h>
  #include <plat/led.h>
 -#include <plat/mux.h>
  #include <plat/usb.h>
  #include <plat/board.h>
  #include <plat/common.h>
  #include <plat/gpmc.h>
  #include <plat/control.h>
  
 +#include "mux.h"
 +
  /* LED & Switch macros */
  #define LED0_GPIO13           13
  #define LED1_GPIO14           14
@@@ -245,7 -244,7 +245,7 @@@ static inline void __init apollon_init_
        apollon_smc91x_resources[0].end   = base + 0x30f;
        udelay(100);
  
 -      omap_cfg_reg(W4__24XX_GPIO74);
 +      omap_mux_init_gpio(74, 0);
        if (gpio_request(APOLLON_ETHR_GPIO_IRQ, "SMC91x irq") < 0) {
                printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n",
                        APOLLON_ETHR_GPIO_IRQ);
@@@ -287,15 -286,15 +287,15 @@@ static void __init omap_apollon_init_ir
  static void __init apollon_led_init(void)
  {
        /* LED0 - AA10 */
 -      omap_cfg_reg(AA10_242X_GPIO13);
 +      omap_mux_init_signal("vlynq_clk.gpio_13", 0);
        gpio_request(LED0_GPIO13, "LED0");
        gpio_direction_output(LED0_GPIO13, 0);
        /* LED1  - AA6 */
 -      omap_cfg_reg(AA6_242X_GPIO14);
 +      omap_mux_init_signal("vlynq_rx1.gpio_14", 0);
        gpio_request(LED1_GPIO14, "LED1");
        gpio_direction_output(LED1_GPIO14, 0);
        /* LED2  - AA4 */
 -      omap_cfg_reg(AA4_242X_GPIO15);
 +      omap_mux_init_signal("vlynq_rx0.gpio_15", 0);
        gpio_request(LED2_GPIO15, "LED2");
        gpio_direction_output(LED2_GPIO15, 0);
  }
@@@ -304,35 -303,22 +304,35 @@@ static void __init apollon_usb_init(voi
  {
        /* USB device */
        /* DEVICE_SUSPEND */
 -      omap_cfg_reg(P21_242X_GPIO12);
 +      omap_mux_init_signal("mcbsp2_clkx.gpio_12", 0);
        gpio_request(12, "USB suspend");
        gpio_direction_output(12, 0);
 -      omap_usb_init(&apollon_usb_config);
 +      omap2_usbfs_init(&apollon_usb_config);
  }
  
 +#ifdef CONFIG_OMAP_MUX
 +static struct omap_board_mux board_mux[] __initdata = {
 +      { .reg_offset = OMAP_MUX_TERMINATOR },
 +};
 +#else
 +#define board_mux     NULL
 +#endif
 +
  static void __init omap_apollon_init(void)
  {
        u32 v;
  
 +      omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC);
 +
        apollon_led_init();
        apollon_flash_init();
        apollon_usb_init();
  
        /* REVISIT: where's the correct place */
 -      omap_cfg_reg(W19_24XX_SYS_NIRQ);
 +      omap_mux_init_signal("sys_nirq", OMAP_PULL_ENA | OMAP_PULL_UP);
 +
 +      /* LCD PWR_EN */
 +      omap_mux_init_signal("mcbsp2_dr.gpio_11", OMAP_PULL_ENA | OMAP_PULL_UP);
  
        /* Use Interal loop-back in MMC/SDIO Module Input Clock selection */
        v = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
@@@ -360,6 -346,7 +360,7 @@@ MACHINE_START(OMAP_APOLLON, "OMAP24xx A
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = omap_apollon_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_apollon_init_irq,
        .init_machine   = omap_apollon_init,
        .timer          = &omap_timer,
@@@ -61,6 -61,8 +61,6 @@@
  #define SB_T35_SMSC911X_GPIO  65
  
  #define NAND_BLOCK_SIZE               SZ_128K
 -#define GPMC_CS0_BASE         0x60
 -#define GPMC_CS0_BASE_ADDR    (OMAP34XX_GPMC_VIRT + GPMC_CS0_BASE)
  
  #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
  #include <linux/smsc911x.h>
@@@ -221,12 -223,28 +221,12 @@@ static struct omap_nand_platform_data c
        .nr_parts               = ARRAY_SIZE(cm_t35_nand_partitions),
        .dma_channel            = -1,   /* disable DMA in OMAP NAND driver */
        .cs                     = 0,
  
  };
  
 -static struct resource cm_t35_nand_resource = {
 -      .flags          = IORESOURCE_MEM,
 -};
 -
 -static struct platform_device cm_t35_nand_device = {
 -      .name           = "omap2-nand",
 -      .id             = -1,
 -      .num_resources  = 1,
 -      .resource       = &cm_t35_nand_resource,
 -      .dev            = {
 -              .platform_data  = &cm_t35_nand_data,
 -      },
 -};
 -
  static void __init cm_t35_init_nand(void)
  {
 -      if (platform_device_register(&cm_t35_nand_device) < 0)
 +      if (gpmc_nand_init(&cm_t35_nand_data) < 0)
                pr_err("CM-T35: Unable to register NAND device\n");
  }
  #else
@@@ -690,12 -708,6 +690,6 @@@ static void __init cm_t35_init_irq(void
        omap_gpio_init();
  }
  
- static void __init cm_t35_map_io(void)
- {
-       omap2_set_globals_343x();
-       omap34xx_map_common_io();
- }
  static struct omap_board_mux board_mux[] __initdata = {
        /* nCS and IRQ for CM-T35 ethernet */
        OMAP3_MUX(GPMC_NCS5, OMAP_MUX_MODE0),
@@@ -818,7 -830,8 +812,8 @@@ MACHINE_START(CM_T35, "Compulab CM-T35"
        .phys_io        = 0x48000000,
        .io_pg_offst    = ((0xd8000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
-       .map_io         = cm_t35_map_io,
+       .map_io         = omap3_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = cm_t35_init_irq,
        .init_machine   = cm_t35_init,
        .timer          = &omap_timer,
@@@ -33,7 -33,6 +33,7 @@@
  #include <linux/i2c/twl.h>
  
  #include <mach/hardware.h>
 +#include <mach/id.h>
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/map.h>
@@@ -59,6 -58,9 +59,6 @@@
  #include "mux.h"
  #include "hsmmc.h"
  
 -#define GPMC_CS0_BASE  0x60
 -#define GPMC_CS_SIZE   0x30
 -
  #define NAND_BLOCK_SIZE               SZ_128K
  
  #define OMAP_DM9000_GPIO_IRQ  25
@@@ -102,6 -104,20 +102,6 @@@ static struct omap_nand_platform_data d
        .dma_channel    = -1,           /* disable DMA in OMAP NAND driver */
  };
  
 -static struct resource devkit8000_nand_resource = {
 -      .flags          = IORESOURCE_MEM,
 -};
 -
 -static struct platform_device devkit8000_nand_device = {
 -      .name           = "omap2-nand",
 -      .id             = -1,
 -      .dev            = {
 -              .platform_data  = &devkit8000_nand_data,
 -      },
 -      .num_resources  = 1,
 -      .resource       = &devkit8000_nand_resource,
 -};
 -
  static struct omap2_hsmmc_info mmc[] = {
        {
                .mmc            = 1,
        },
        {}      /* Terminator */
  };
 -static struct omap_board_config_kernel devkit8000_config[] __initdata = {
 -};
  
  static int devkit8000_panel_enable_lcd(struct omap_dss_device *dssdev)
  {
        twl_i2c_write_u8(TWL4030_MODULE_GPIO, 0x80, REG_GPIODATADIR1);
        twl_i2c_write_u8(TWL4030_MODULE_LED, 0x0, 0x0);
  
 +      if (gpio_is_valid(dssdev->reset_gpio))
 +              gpio_set_value(dssdev->reset_gpio, 1);
        return 0;
  }
  
  static void devkit8000_panel_disable_lcd(struct omap_dss_device *dssdev)
  {
 +      if (gpio_is_valid(dssdev->reset_gpio))
 +              gpio_set_value(dssdev->reset_gpio, 0);
  }
 +
  static int devkit8000_panel_enable_dvi(struct omap_dss_device *dssdev)
  {
 +      if (gpio_is_valid(dssdev->reset_gpio))
 +              gpio_set_value(dssdev->reset_gpio, 1);
        return 0;
  }
  
  static void devkit8000_panel_disable_dvi(struct omap_dss_device *dssdev)
  {
 +      if (gpio_is_valid(dssdev->reset_gpio))
 +              gpio_set_value(dssdev->reset_gpio, 0);
  }
  
 -static int devkit8000_panel_enable_tv(struct omap_dss_device *dssdev)
 -{
 -
 -      return 0;
 -}
 -
 -static void devkit8000_panel_disable_tv(struct omap_dss_device *dssdev)
 -{
 -}
 +static struct regulator_consumer_supply devkit8000_vmmc1_supply =
 +      REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0");
  
  
 -static struct regulator_consumer_supply devkit8000_vmmc1_supply = {
 -      .supply                 = "vmmc",
 -};
 -
 -static struct regulator_consumer_supply devkit8000_vsim_supply = {
 -      .supply                 = "vmmc_aux",
 -};
 -
 +/* ads7846 on SPI */
 +static struct regulator_consumer_supply devkit8000_vio_supply =
 +      REGULATOR_SUPPLY("vcc", "spi2.0");
  
  static struct omap_dss_device devkit8000_lcd_device = {
        .name                   = "lcd",
 -      .driver_name            = "innolux_at_panel",
 +      .driver_name            = "generic_panel",
        .type                   = OMAP_DISPLAY_TYPE_DPI,
        .phy.dpi.data_lines     = 24,
 +      .reset_gpio             = -EINVAL, /* will be replaced */
        .platform_enable        = devkit8000_panel_enable_lcd,
        .platform_disable       = devkit8000_panel_disable_lcd,
  };
@@@ -162,7 -182,6 +162,7 @@@ static struct omap_dss_device devkit800
        .driver_name            = "generic_panel",
        .type                   = OMAP_DISPLAY_TYPE_DPI,
        .phy.dpi.data_lines     = 24,
 +      .reset_gpio             = -EINVAL, /* will be replaced */
        .platform_enable        = devkit8000_panel_enable_dvi,
        .platform_disable       = devkit8000_panel_disable_dvi,
  };
@@@ -172,6 -191,8 +172,6 @@@ static struct omap_dss_device devkit800
        .driver_name            = "venc",
        .type                   = OMAP_DISPLAY_TYPE_VENC,
        .phy.venc.type          = OMAP_DSS_VENC_TYPE_SVIDEO,
 -      .platform_enable        = devkit8000_panel_enable_tv,
 -      .platform_disable       = devkit8000_panel_disable_tv,
  };
  
  
@@@ -195,8 -216,10 +195,8 @@@ static struct platform_device devkit800
        },
  };
  
 -static struct regulator_consumer_supply devkit8000_vdda_dac_supply = {
 -      .supply = "vdda_dac",
 -      .dev    = &devkit8000_dss_device.dev,
 -};
 +static struct regulator_consumer_supply devkit8000_vdda_dac_supply =
 +      REGULATOR_SUPPLY("vdda_dac", "omapdss");
  
  static int board_keymap[] = {
        KEY(0, 0, KEY_1),
@@@ -243,21 -266,7 +243,21 @@@ static int devkit8000_twl_gpio_setup(st
  
        /* link regulators to MMC adapters */
        devkit8000_vmmc1_supply.dev = mmc[0].dev;
 -      devkit8000_vsim_supply.dev = mmc[0].dev;
 +
 +      /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
 +      gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
 +
 +        /* gpio + 1 is "LCD_PWREN" (out, active high) */
 +      devkit8000_lcd_device.reset_gpio = gpio + 1;
 +      gpio_request(devkit8000_lcd_device.reset_gpio, "LCD_PWREN");
 +      /* Disable until needed */
 +      gpio_direction_output(devkit8000_lcd_device.reset_gpio, 0);
 +
 +      /* gpio + 7 is "DVI_PD" (out, active low) */
 +      devkit8000_dvi_device.reset_gpio = gpio + 7;
 +      gpio_request(devkit8000_dvi_device.reset_gpio, "DVI PowerDown");
 +      /* Disable until needed */
 +      gpio_direction_output(devkit8000_dvi_device.reset_gpio, 0);
  
        return 0;
  }
@@@ -273,8 -282,16 +273,8 @@@ static struct twl4030_gpio_platform_dat
        .setup          = devkit8000_twl_gpio_setup,
  };
  
 -static struct regulator_consumer_supply devkit8000_vpll2_supplies[] = {
 -      {
 -      .supply         = "vdvi",
 -      .dev            = &devkit8000_lcd_device.dev,
 -      },
 -      {
 -      .supply         = "vdds_dsi",
 -      .dev            = &devkit8000_dss_device.dev,
 -      }
 -};
 +static struct regulator_consumer_supply devkit8000_vpll1_supply =
 +      REGULATOR_SUPPLY("vdds_dsi", "omapdss");
  
  /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
  static struct regulator_init_data devkit8000_vmmc1 = {
        .consumer_supplies      = &devkit8000_vmmc1_supply,
  };
  
 -/* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */
 -static struct regulator_init_data devkit8000_vsim = {
 -      .constraints = {
 -              .min_uV                 = 1800000,
 -              .max_uV                 = 3000000,
 -              .valid_modes_mask       = REGULATOR_MODE_NORMAL
 -                                      | REGULATOR_MODE_STANDBY,
 -              .valid_ops_mask         = REGULATOR_CHANGE_VOLTAGE
 -                                      | REGULATOR_CHANGE_MODE
 -                                      | REGULATOR_CHANGE_STATUS,
 -      },
 -      .num_consumer_supplies  = 1,
 -      .consumer_supplies      = &devkit8000_vsim_supply,
 -};
 -
  /* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */
  static struct regulator_init_data devkit8000_vdac = {
        .constraints = {
        .consumer_supplies      = &devkit8000_vdda_dac_supply,
  };
  
 -/* VPLL2 for digital video outputs */
 -static struct regulator_init_data devkit8000_vpll2 = {
 +/* VPLL1 for digital video outputs */
 +static struct regulator_init_data devkit8000_vpll1 = {
        .constraints = {
 -              .name                   = "VDVI",
                .min_uV                 = 1800000,
                .max_uV                 = 1800000,
                .valid_modes_mask       = REGULATOR_MODE_NORMAL
                .valid_ops_mask         = REGULATOR_CHANGE_MODE
                                        | REGULATOR_CHANGE_STATUS,
        },
 -      .num_consumer_supplies  = ARRAY_SIZE(devkit8000_vpll2_supplies),
 -      .consumer_supplies      = devkit8000_vpll2_supplies,
 +      .num_consumer_supplies  = 1,
 +      .consumer_supplies      = &devkit8000_vpll1_supply,
 +};
 +
 +/* VAUX4 for ads7846 and nubs */
 +static struct regulator_init_data devkit8000_vio = {
 +      .constraints = {
 +              .min_uV                 = 1800000,
 +              .max_uV                 = 1800000,
 +              .apply_uV               = true,
 +              .valid_modes_mask       = REGULATOR_MODE_NORMAL
 +                      | REGULATOR_MODE_STANDBY,
 +              .valid_ops_mask         = REGULATOR_CHANGE_MODE
 +                      | REGULATOR_CHANGE_STATUS,
 +      },
 +      .num_consumer_supplies  = 1,
 +      .consumer_supplies      = &devkit8000_vio_supply,
  };
  
  static struct twl4030_usb_data devkit8000_usb_data = {
@@@ -356,15 -374,15 +356,15 @@@ static struct twl4030_platform_data dev
        .gpio           = &devkit8000_gpio_data,
        .codec          = &devkit8000_codec_data,
        .vmmc1          = &devkit8000_vmmc1,
 -      .vsim           = &devkit8000_vsim,
        .vdac           = &devkit8000_vdac,
 -      .vpll2          = &devkit8000_vpll2,
 +      .vpll1          = &devkit8000_vpll1,
 +      .vio            = &devkit8000_vio,
        .keypad         = &devkit8000_kp_data,
  };
  
  static struct i2c_board_info __initdata devkit8000_i2c_boardinfo[] = {
        {
 -              I2C_BOARD_INFO("twl4030", 0x48),
 +              I2C_BOARD_INFO("tps65930", 0x48),
                .flags = I2C_CLIENT_WAKE,
                .irq = INT_34XX_SYS_NIRQ,
                .platform_data = &devkit8000_twldata,
@@@ -446,6 -464,8 +446,6 @@@ static struct platform_device keys_gpi
  
  static void __init devkit8000_init_irq(void)
  {
 -      omap_board_config = devkit8000_config;
 -      omap_board_config_size = ARRAY_SIZE(devkit8000_config);
        omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
                             mt46h32m32lf6_sdrc_params);
        omap_init_irq();
@@@ -540,9 -560,6 +540,9 @@@ static struct platform_device omap_dm90
  
  static void __init omap_dm9000_init(void)
  {
 +      unsigned char *eth_addr = omap_dm9000_platdata.dev_addr;
 +      struct omap_die_id odi;
 +
        if (gpio_request(OMAP_DM9000_GPIO_IRQ, "dm9000 irq") < 0) {
                printk(KERN_ERR "Failed to request GPIO%d for dm9000 IRQ\n",
                        OMAP_DM9000_GPIO_IRQ);
                }
  
        gpio_direction_input(OMAP_DM9000_GPIO_IRQ);
 +
 +      /* init the mac address using DIE id */
 +      omap_get_die_id(&odi);
 +
 +      eth_addr[0] = 0x02; /* locally administered */
 +      eth_addr[1] = odi.id_1 & 0xff;
 +      eth_addr[2] = (odi.id_0 & 0xff000000) >> 24;
 +      eth_addr[3] = (odi.id_0 & 0x00ff0000) >> 16;
 +      eth_addr[4] = (odi.id_0 & 0x0000ff00) >> 8;
 +      eth_addr[5] = (odi.id_0 & 0x000000ff);
  }
  
  static struct platform_device *devkit8000_devices[] __initdata = {
@@@ -574,6 -581,8 +574,6 @@@ static void __init devkit8000_flash_ini
        u8 cs = 0;
        u8 nandcs = GPMC_CS_NUM + 1;
  
 -      u32 gpmc_base_add = OMAP34XX_GPMC_VIRT;
 -
        /* find out the chip-select on which NAND exists */
        while (cs < GPMC_CS_NUM) {
                u32 ret = 0;
  
        if (nandcs < GPMC_CS_NUM) {
                devkit8000_nand_data.cs = nandcs;
 -              devkit8000_nand_data.gpmc_cs_baseaddr = (void *)
 -                      (gpmc_base_add + GPMC_CS0_BASE + nandcs * GPMC_CS_SIZE);
 -              devkit8000_nand_data.gpmc_baseaddr = (void *)
 -                      (gpmc_base_add);
  
                printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
 -              if (platform_device_register(&devkit8000_nand_device) < 0)
 +              if (gpmc_nand_init(&devkit8000_nand_data) < 0)
                        printk(KERN_ERR "Unable to register NAND device\n");
        }
  }
@@@ -784,6 -797,8 +784,6 @@@ static void __init devkit8000_init(void
        devkit8000_i2c_init();
        platform_add_devices(devkit8000_devices,
                        ARRAY_SIZE(devkit8000_devices));
 -      omap_board_config = devkit8000_config;
 -      omap_board_config_size = ARRAY_SIZE(devkit8000_config);
  
        spi_register_board_info(devkit8000_spi_board_info,
        ARRAY_SIZE(devkit8000_spi_board_info));
        omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
  }
  
- static void __init devkit8000_map_io(void)
- {
-       omap2_set_globals_343x();
-       omap34xx_map_common_io();
- }
  MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000")
        .phys_io        = 0x48000000,
        .io_pg_offst    = ((0xd8000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
-       .map_io         = devkit8000_map_io,
+       .map_io         = omap3_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = devkit8000_init_irq,
        .init_machine   = devkit8000_init,
        .timer          = &omap_timer,
@@@ -26,6 -26,7 +26,6 @@@
  #include <asm/mach/map.h>
  
  #include <mach/gpio.h>
 -#include <plat/mux.h>
  #include <plat/usb.h>
  #include <plat/board.h>
  #include <plat/common.h>
@@@ -58,6 -59,7 +58,7 @@@ MACHINE_START(OMAP_GENERIC, "Generic OM
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = omap_generic_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_generic_init_irq,
        .init_machine   = omap_generic_init,
        .timer          = &omap_timer,
@@@ -33,6 -33,7 +33,6 @@@
  
  #include <plat/control.h>
  #include <mach/gpio.h>
 -#include <plat/mux.h>
  #include <plat/usb.h>
  #include <plat/board.h>
  #include <plat/common.h>
@@@ -41,8 -42,6 +41,8 @@@
  #include <plat/dma.h>
  #include <plat/gpmc.h>
  
 +#include "mux.h"
 +
  #define H4_FLASH_CS   0
  #define H4_SMC91X_CS  1
  
@@@ -247,7 -246,7 +247,7 @@@ static inline void __init h4_init_debug
  
        udelay(100);
  
 -      omap_cfg_reg(M15_24XX_GPIO92);
 +      omap_mux_init_gpio(92, 0);
        if (debug_card_init(cs_mem_base, H4_ETHR_GPIO_IRQ) < 0)
                gpmc_cs_free(eth_cs);
  
@@@ -273,6 -272,27 +273,6 @@@ static struct omap_lcd_config h4_lcd_co
  };
  
  static struct omap_usb_config h4_usb_config __initdata = {
 -#ifdef        CONFIG_MACH_OMAP2_H4_USB1
 -      /* NOTE:  usb1 could also be used with 3 wire signaling */
 -      .pins[1]        = 4,
 -#endif
 -
 -#ifdef        CONFIG_MACH_OMAP_H4_OTG
 -      /* S1.10 ON -- USB OTG port
 -       * usb0 switched to Mini-AB port and isp1301 transceiver;
 -       * S2.POS3 = OFF, S2.POS4 = ON ... to allow battery charging
 -       */
 -      .otg            = 1,
 -      .pins[0]        = 4,
 -#ifdef        CONFIG_USB_GADGET_OMAP
 -      /* use OTG cable, or standard A-to-MiniB */
 -      .hmc_mode       = 0x14, /* 0:dev/otg 1:host 2:disable */
 -#elif defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
 -      /* use OTG cable, or NONSTANDARD (B-to-MiniB) */
 -      .hmc_mode       = 0x11, /* 0:host 1:host 2:disable */
 -#endif        /* XX */
 -
 -#else
        /* S1.10 OFF -- usb "download port"
         * usb0 switched to Mini-B port and isp1105 transceiver;
         * S2.POS3 = ON, S2.POS4 = OFF ... to enable battery charging
        .pins[0]        = 3,
  /*    .hmc_mode       = 0x14,*/       /* 0:dev 1:host 2:disable */
        .hmc_mode       = 0x00,         /* 0:dev|otg 1:disable 2:disable */
 -#endif
  };
  
  static struct omap_board_config_kernel h4_config[] = {
@@@ -317,54 -338,31 +317,54 @@@ static struct i2c_board_info __initdat
        },
  };
  
 +#ifdef CONFIG_OMAP_MUX
 +static struct omap_board_mux board_mux[] __initdata = {
 +      { .reg_offset = OMAP_MUX_TERMINATOR },
 +};
 +#else
 +#define board_mux     NULL
 +#endif
 +
  static void __init omap_h4_init(void)
  {
 +      omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAF);
 +
        /*
         * Make sure the serial ports are muxed on at this point.
         * You have to mux them off in device drivers later on
         * if not needed.
         */
 -#if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE)
 -      omap_cfg_reg(K15_24XX_UART3_TX);
 -      omap_cfg_reg(K14_24XX_UART3_RX);
 -#endif
  
  #if defined(CONFIG_KEYBOARD_OMAP) || defined(CONFIG_KEYBOARD_OMAP_MODULE)
 +      omap_mux_init_gpio(88, OMAP_PULL_ENA | OMAP_PULL_UP);
 +      omap_mux_init_gpio(89, OMAP_PULL_ENA | OMAP_PULL_UP);
 +      omap_mux_init_gpio(124, OMAP_PULL_ENA | OMAP_PULL_UP);
 +      omap_mux_init_signal("mcbsp2_dr.gpio_11", OMAP_PULL_ENA | OMAP_PULL_UP);
        if (omap_has_menelaus()) {
 +              omap_mux_init_signal("sdrc_a14.gpio0",
 +                      OMAP_PULL_ENA | OMAP_PULL_UP);
 +              omap_mux_init_signal("vlynq_rx0.gpio_15", 0);
 +              omap_mux_init_signal("gpio_98", 0);
                row_gpios[5] = 0;
                col_gpios[2] = 15;
                col_gpios[6] = 18;
 +      } else {
 +              omap_mux_init_signal("gpio_96", OMAP_PULL_ENA | OMAP_PULL_UP);
 +              omap_mux_init_signal("gpio_100", 0);
 +              omap_mux_init_signal("gpio_98", 0);
        }
 +      omap_mux_init_signal("gpio_90", 0);
 +      omap_mux_init_signal("gpio_91", 0);
 +      omap_mux_init_signal("gpio_36", 0);
 +      omap_mux_init_signal("mcbsp2_clkx.gpio_12", 0);
 +      omap_mux_init_signal("gpio_97", 0);
  #endif
  
        i2c_register_board_info(1, h4_i2c_board_info,
                        ARRAY_SIZE(h4_i2c_board_info));
  
        platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices));
 -      omap_usb_init(&h4_usb_config);
 +      omap2_usbfs_init(&h4_usb_config);
        omap_serial_init();
  }
  
@@@ -380,6 -378,7 +380,7 @@@ MACHINE_START(OMAP_H4, "OMAP2420 H4 boa
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = omap_h4_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_h4_init_irq,
        .init_machine   = omap_h4_init,
        .timer          = &omap_timer,
@@@ -38,7 -38,6 +38,7 @@@
  #include <plat/board.h>
  #include <plat/common.h>
  #include <plat/gpmc.h>
 +#include <mach/board-zoom.h>
  
  #include <asm/delay.h>
  #include <plat/control.h>
@@@ -389,38 -388,6 +389,38 @@@ static struct omap_musb_board_data musb
        .power                  = 100,
  };
  
 +static struct mtd_partition ldp_nand_partitions[] = {
 +      /* All the partition sizes are listed in terms of NAND block size */
 +      {
 +              .name           = "X-Loader-NAND",
 +              .offset         = 0,
 +              .size           = 4 * (64 * 2048),      /* 512KB, 0x80000 */
 +              .mask_flags     = MTD_WRITEABLE,        /* force read-only */
 +      },
 +      {
 +              .name           = "U-Boot-NAND",
 +              .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x80000 */
 +              .size           = 10 * (64 * 2048),     /* 1.25MB, 0x140000 */
 +              .mask_flags     = MTD_WRITEABLE,        /* force read-only */
 +      },
 +      {
 +              .name           = "Boot Env-NAND",
 +              .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x1c0000 */
 +              .size           = 2 * (64 * 2048),      /* 256KB, 0x40000 */
 +      },
 +      {
 +              .name           = "Kernel-NAND",
 +              .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x0200000*/
 +              .size           = 240 * (64 * 2048),    /* 30M, 0x1E00000 */
 +      },
 +      {
 +              .name           = "File System - NAND",
 +              .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x2000000 */
 +              .size           = MTDPART_SIZ_FULL,     /* 96MB, 0x6000000 */
 +      },
 +
 +};
 +
  static void __init omap_ldp_init(void)
  {
        omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
        ads7846_dev_init();
        omap_serial_init();
        usb_musb_init(&musb_board_data);
 +      board_nand_init(ldp_nand_partitions,
 +              ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS);
  
        omap2_hsmmc_init(mmc);
        /* link regulators to MMC adapters */
        ldp_vmmc1_supply.dev = mmc[0].dev;
  }
  
- static void __init omap_ldp_map_io(void)
- {
-       omap2_set_globals_343x();
-       omap34xx_map_common_io();
- }
  MACHINE_START(OMAP_LDP, "OMAP LDP board")
        .phys_io        = 0x48000000,
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
-       .map_io         = omap_ldp_map_io,
+       .map_io         = omap3_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_ldp_init_irq,
        .init_machine   = omap_ldp_init,
        .timer          = &omap_timer,
@@@ -33,8 -33,6 +33,8 @@@
  #include <plat/mmc.h>
  #include <plat/serial.h>
  
 +#include "mux.h"
 +
  static int slot1_cover_open;
  static int slot2_cover_open;
  static struct device *mmc_device;
@@@ -651,17 -649,8 +651,17 @@@ static void __init n8x0_init_irq(void
        omap_gpio_init();
  }
  
 +#ifdef CONFIG_OMAP_MUX
 +static struct omap_board_mux board_mux[] __initdata = {
 +      { .reg_offset = OMAP_MUX_TERMINATOR },
 +};
 +#else
 +#define board_mux     NULL
 +#endif
 +
  static void __init n8x0_init_machine(void)
  {
 +      omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC);
        /* FIXME: add n810 spi devices */
        spi_register_board_info(n800_spi_board_info,
                                ARRAY_SIZE(n800_spi_board_info));
@@@ -678,6 -667,7 +678,7 @@@ MACHINE_START(NOKIA_N800, "Nokia N800"
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = n8x0_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = n8x0_init_irq,
        .init_machine   = n8x0_init_machine,
        .timer          = &omap_timer,
@@@ -688,6 -678,7 +689,7 @@@ MACHINE_START(NOKIA_N810, "Nokia N810"
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = n8x0_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = n8x0_init_irq,
        .init_machine   = n8x0_init_machine,
        .timer          = &omap_timer,
@@@ -698,6 -689,7 +700,7 @@@ MACHINE_START(NOKIA_N810_WIMAX, "Nokia 
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
        .map_io         = n8x0_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = n8x0_init_irq,
        .init_machine   = n8x0_init_machine,
        .timer          = &omap_timer,
@@@ -48,6 -48,9 +48,6 @@@
  #include "mux.h"
  #include "hsmmc.h"
  
 -#define GPMC_CS0_BASE  0x60
 -#define GPMC_CS_SIZE   0x30
 -
  #define NAND_BLOCK_SIZE               SZ_128K
  
  static struct mtd_partition omap3beagle_nand_partitions[] = {
@@@ -90,6 -93,20 +90,6 @@@ static struct omap_nand_platform_data o
        .dev_ready      = NULL,
  };
  
 -static struct resource omap3beagle_nand_resource = {
 -      .flags          = IORESOURCE_MEM,
 -};
 -
 -static struct platform_device omap3beagle_nand_device = {
 -      .name           = "omap2-nand",
 -      .id             = -1,
 -      .dev            = {
 -              .platform_data  = &omap3beagle_nand_data,
 -      },
 -      .num_resources  = 1,
 -      .resource       = &omap3beagle_nand_resource,
 -};
 -
  /* DSS */
  
  static int beagle_enable_dvi(struct omap_dss_device *dssdev)
@@@ -407,6 -424,8 +407,6 @@@ static void __init omap3beagle_flash_in
        u8 cs = 0;
        u8 nandcs = GPMC_CS_NUM + 1;
  
 -      u32 gpmc_base_add = OMAP34XX_GPMC_VIRT;
 -
        /* find out the chip-select on which NAND exists */
        while (cs < GPMC_CS_NUM) {
                u32 ret = 0;
  
        if (nandcs < GPMC_CS_NUM) {
                omap3beagle_nand_data.cs = nandcs;
 -              omap3beagle_nand_data.gpmc_cs_baseaddr = (void *)
 -                      (gpmc_base_add + GPMC_CS0_BASE + nandcs * GPMC_CS_SIZE);
 -              omap3beagle_nand_data.gpmc_baseaddr = (void *) (gpmc_base_add);
  
                printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
 -              if (platform_device_register(&omap3beagle_nand_device) < 0)
 +              if (gpmc_nand_init(&omap3beagle_nand_data) < 0)
                        printk(KERN_ERR "Unable to register NAND device\n");
        }
  }
@@@ -485,18 -507,13 +485,13 @@@ static void __init omap3_beagle_init(vo
        beagle_display_init();
  }
  
- static void __init omap3_beagle_map_io(void)
- {
-       omap2_set_globals_343x();
-       omap34xx_map_common_io();
- }
  MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
        /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */
        .phys_io        = 0x48000000,
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
-       .map_io         = omap3_beagle_map_io,
+       .map_io         = omap3_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap3_beagle_init_irq,
        .init_machine   = omap3_beagle_init,
        .timer          = &omap_timer,
@@@ -25,9 -25,6 +25,9 @@@
  #include <linux/spi/ads7846.h>
  #include <linux/regulator/machine.h>
  #include <linux/i2c/twl.h>
 +#include <linux/spi/wl12xx.h>
 +#include <linux/mtd/partitions.h>
 +#include <linux/mtd/nand.h>
  #include <linux/leds.h>
  #include <linux/input.h>
  #include <linux/input/matrix_keypad.h>
  #include <plat/mcspi.h>
  #include <plat/usb.h>
  #include <plat/display.h>
 +#include <plat/nand.h>
  
  #include "mux.h"
  #include "sdram-micron-mt46h32m32lf-6.h"
  #include "hsmmc.h"
  
 +#define PANDORA_WIFI_IRQ_GPIO         21
 +#define PANDORA_WIFI_NRESET_GPIO      23
  #define OMAP3_PANDORA_TS_GPIO         94
  
 -/* hardware debounce: (value + 1) * 31us */
 -#define GPIO_DEBOUNCE_TIME            127
 +#define NAND_BLOCK_SIZE                       SZ_128K
 +
 +static struct mtd_partition omap3pandora_nand_partitions[] = {
 +      {
 +              .name           = "xloader",
 +              .offset         = 0,
 +              .size           = 4 * NAND_BLOCK_SIZE,
 +              .mask_flags     = MTD_WRITEABLE
 +      }, {
 +              .name           = "uboot",
 +              .offset         = MTDPART_OFS_APPEND,
 +              .size           = 15 * NAND_BLOCK_SIZE,
 +      }, {
 +              .name           = "uboot-env",
 +              .offset         = MTDPART_OFS_APPEND,
 +              .size           = 1 * NAND_BLOCK_SIZE,
 +      }, {
 +              .name           = "boot",
 +              .offset         = MTDPART_OFS_APPEND,
 +              .size           = 80 * NAND_BLOCK_SIZE,
 +      }, {
 +              .name           = "rootfs",
 +              .offset         = MTDPART_OFS_APPEND,
 +              .size           = MTDPART_SIZ_FULL,
 +      },
 +};
 +
 +static struct omap_nand_platform_data pandora_nand_data = {
 +      .cs             = 0,
 +      .devsize        = 1,    /* '0' for 8-bit, '1' for 16-bit device */
 +      .parts          = omap3pandora_nand_partitions,
 +      .nr_parts       = ARRAY_SIZE(omap3pandora_nand_partitions),
 +};
  
  static struct gpio_led pandora_gpio_leds[] = {
        {
@@@ -125,7 -88,6 +125,7 @@@ static struct platform_device pandora_l
        .type           = ev_type,                              \
        .code           = ev_code,                              \
        .active_low     = act_low,                              \
 +      .debounce_interval = 4,                                 \
        .desc           = "btn " descr,                         \
  }
  
@@@ -137,14 -99,14 +137,14 @@@ static struct gpio_keys_button pandora_
        GPIO_BUTTON_LOW(103,    KEY_DOWN,       "down"),
        GPIO_BUTTON_LOW(96,     KEY_LEFT,       "left"),
        GPIO_BUTTON_LOW(98,     KEY_RIGHT,      "right"),
 -      GPIO_BUTTON_LOW(109,    KEY_KP1,        "game 1"),
 -      GPIO_BUTTON_LOW(111,    KEY_KP2,        "game 2"),
 -      GPIO_BUTTON_LOW(106,    KEY_KP3,        "game 3"),
 -      GPIO_BUTTON_LOW(101,    KEY_KP4,        "game 4"),
 -      GPIO_BUTTON_LOW(102,    BTN_TL,         "l"),
 -      GPIO_BUTTON_LOW(97,     BTN_TL2,        "l2"),
 -      GPIO_BUTTON_LOW(105,    BTN_TR,         "r"),
 -      GPIO_BUTTON_LOW(107,    BTN_TR2,        "r2"),
 +      GPIO_BUTTON_LOW(109,    KEY_PAGEUP,     "game 1"),
 +      GPIO_BUTTON_LOW(111,    KEY_END,        "game 2"),
 +      GPIO_BUTTON_LOW(106,    KEY_PAGEDOWN,   "game 3"),
 +      GPIO_BUTTON_LOW(101,    KEY_HOME,       "game 4"),
 +      GPIO_BUTTON_LOW(102,    KEY_RIGHTSHIFT, "l"),
 +      GPIO_BUTTON_LOW(97,     KEY_KPPLUS,     "l2"),
 +      GPIO_BUTTON_LOW(105,    KEY_RIGHTCTRL,  "r"),
 +      GPIO_BUTTON_LOW(107,    KEY_KPMINUS,    "r2"),
        GPIO_BUTTON_LOW(104,    KEY_LEFTCTRL,   "ctrl"),
        GPIO_BUTTON_LOW(99,     KEY_MENU,       "menu"),
        GPIO_BUTTON_LOW(176,    KEY_COFFEE,     "hold"),
@@@ -165,7 -127,14 +165,7 @@@ static struct platform_device pandora_k
        },
  };
  
 -static void __init pandora_keys_gpio_init(void)
 -{
 -      /* set debounce time for GPIO banks 4 and 6 */
 -      gpio_set_debounce(32 * 3, GPIO_DEBOUNCE_TIME);
 -      gpio_set_debounce(32 * 5, GPIO_DEBOUNCE_TIME);
 -}
 -
 -static int board_keymap[] = {
 +static const uint32_t board_keymap[] = {
        /* row, col, code */
        KEY(0, 0, KEY_9),
        KEY(0, 1, KEY_8),
@@@ -286,33 -255,12 +286,33 @@@ static struct omap2_hsmmc_info omap3pan
  static int omap3pandora_twl_gpio_setup(struct device *dev,
                unsigned gpio, unsigned ngpio)
  {
 +      int ret, gpio_32khz;
 +
        /* gpio + {0,1} is "mmc{0,1}_cd" (input/IRQ) */
        omap3pandora_mmc[0].gpio_cd = gpio + 0;
        omap3pandora_mmc[1].gpio_cd = gpio + 1;
        omap2_hsmmc_init(omap3pandora_mmc);
  
 +      /* gpio + 13 drives 32kHz buffer for wifi module */
 +      gpio_32khz = gpio + 13;
 +      ret = gpio_request(gpio_32khz, "wifi 32kHz");
 +      if (ret < 0) {
 +              pr_err("Cannot get GPIO line %d, ret=%d\n", gpio_32khz, ret);
 +              goto fail;
 +      }
 +
 +      ret = gpio_direction_output(gpio_32khz, 1);
 +      if (ret < 0) {
 +              pr_err("Cannot set GPIO line %d, ret=%d\n", gpio_32khz, ret);
 +              goto fail_direction;
 +      }
 +
        return 0;
 +
 +fail_direction:
 +      gpio_free(gpio_32khz);
 +fail:
 +      return -ENODEV;
  }
  
  static struct twl4030_gpio_platform_data omap3pandora_gpio_data = {
@@@ -591,67 -539,10 +591,67 @@@ static void __init omap3pandora_init_ir
        omap_gpio_init();
  }
  
 +static void pandora_wl1251_set_power(bool enable)
 +{
 +      /*
 +       * Keep power always on until wl1251_sdio driver learns to re-init
 +       * the chip after powering it down and back up.
 +       */
 +}
 +
 +static struct wl12xx_platform_data pandora_wl1251_pdata = {
 +      .set_power      = pandora_wl1251_set_power,
 +      .use_eeprom     = true,
 +};
 +
 +static struct platform_device pandora_wl1251_data = {
 +      .name           = "wl1251_data",
 +      .id             = -1,
 +      .dev            = {
 +              .platform_data  = &pandora_wl1251_pdata,
 +      },
 +};
 +
 +static void pandora_wl1251_init(void)
 +{
 +      int ret;
 +
 +      ret = gpio_request(PANDORA_WIFI_IRQ_GPIO, "wl1251 irq");
 +      if (ret < 0)
 +              goto fail;
 +
 +      ret = gpio_direction_input(PANDORA_WIFI_IRQ_GPIO);
 +      if (ret < 0)
 +              goto fail_irq;
 +
 +      pandora_wl1251_pdata.irq = gpio_to_irq(PANDORA_WIFI_IRQ_GPIO);
 +      if (pandora_wl1251_pdata.irq < 0)
 +              goto fail_irq;
 +
 +      ret = gpio_request(PANDORA_WIFI_NRESET_GPIO, "wl1251 nreset");
 +      if (ret < 0)
 +              goto fail_irq;
 +
 +      /* start powered so that it probes with MMC subsystem */
 +      ret = gpio_direction_output(PANDORA_WIFI_NRESET_GPIO, 1);
 +      if (ret < 0)
 +              goto fail_nreset;
 +
 +      return;
 +
 +fail_nreset:
 +      gpio_free(PANDORA_WIFI_NRESET_GPIO);
 +fail_irq:
 +      gpio_free(PANDORA_WIFI_IRQ_GPIO);
 +fail:
 +      printk(KERN_ERR "wl1251 board initialisation failed\n");
 +}
 +
  static struct platform_device *omap3pandora_devices[] __initdata = {
        &pandora_leds_gpio,
        &pandora_keys_gpio,
        &pandora_dss_device,
 +      &pandora_wl1251_data,
  };
  
  static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
@@@ -684,7 -575,6 +684,7 @@@ static void __init omap3pandora_init(vo
  {
        omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
        omap3pandora_i2c_init();
 +      pandora_wl1251_init();
        platform_add_devices(omap3pandora_devices,
                        ARRAY_SIZE(omap3pandora_devices));
        omap_serial_init();
                        ARRAY_SIZE(omap3pandora_spi_board_info));
        omap3pandora_ads7846_init();
        usb_ehci_init(&ehci_pdata);
 -      pandora_keys_gpio_init();
        usb_musb_init(&musb_board_data);
 +      gpmc_nand_init(&pandora_nand_data);
  
        /* Ensure SDRC pins are mux'd for self-refresh */
        omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
        omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
  }
  
- static void __init omap3pandora_map_io(void)
- {
-       omap2_set_globals_343x();
-       omap34xx_map_common_io();
- }
  MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console")
        .phys_io        = 0x48000000,
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
-       .map_io         = omap3pandora_map_io,
+       .map_io         = omap3_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap3pandora_init_irq,
        .init_machine   = omap3pandora_init,
        .timer          = &omap_timer,
@@@ -54,6 -54,9 +54,6 @@@
  
  #include <asm/setup.h>
  
 -#define GPMC_CS0_BASE  0x60
 -#define GPMC_CS_SIZE   0x30
 -
  #define NAND_BLOCK_SIZE               SZ_128K
  
  #define OMAP3_AC_GPIO         136
@@@ -103,6 -106,20 +103,6 @@@ static struct omap_nand_platform_data o
        .dev_ready      = NULL,
  };
  
 -static struct resource omap3touchbook_nand_resource = {
 -      .flags          = IORESOURCE_MEM,
 -};
 -
 -static struct platform_device omap3touchbook_nand_device = {
 -      .name           = "omap2-nand",
 -      .id             = -1,
 -      .dev            = {
 -              .platform_data  = &omap3touchbook_nand_data,
 -      },
 -      .num_resources  = 1,
 -      .resource       = &omap3touchbook_nand_resource,
 -};
 -
  #include "sdram-micron-mt46h32m32lf-6.h"
  
  static struct omap2_hsmmc_info mmc[] = {
@@@ -441,6 -458,8 +441,6 @@@ static void __init omap3touchbook_flash
        u8 cs = 0;
        u8 nandcs = GPMC_CS_NUM + 1;
  
 -      u32 gpmc_base_add = OMAP34XX_GPMC_VIRT;
 -
        /* find out the chip-select on which NAND exists */
        while (cs < GPMC_CS_NUM) {
                u32 ret = 0;
  
        if (nandcs < GPMC_CS_NUM) {
                omap3touchbook_nand_data.cs = nandcs;
 -              omap3touchbook_nand_data.gpmc_cs_baseaddr = (void *)
 -                      (gpmc_base_add + GPMC_CS0_BASE + nandcs * GPMC_CS_SIZE);
 -              omap3touchbook_nand_data.gpmc_baseaddr =
 -                                              (void *) (gpmc_base_add);
  
                printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
 -              if (platform_device_register(&omap3touchbook_nand_device) < 0)
 +              if (gpmc_nand_init(&omap3touchbook_nand_data) < 0)
                        printk(KERN_ERR "Unable to register NAND device\n");
        }
  }
@@@ -536,18 -559,13 +536,13 @@@ static void __init omap3_touchbook_init
        omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
  }
  
- static void __init omap3_touchbook_map_io(void)
- {
-       omap2_set_globals_343x();
-       omap34xx_map_common_io();
- }
  MACHINE_START(TOUCHBOOK, "OMAP3 touchbook Board")
        /* Maintainer: Gregoire Gentil - http://www.alwaysinnovating.com */
        .phys_io        = 0x48000000,
        .io_pg_offst    = ((0xd8000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
-       .map_io         = omap3_touchbook_map_io,
+       .map_io         = omap3_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap3_touchbook_init_irq,
        .init_machine   = omap3_touchbook_init,
        .timer          = &omap_timer,
@@@ -58,6 -58,8 +58,6 @@@
  #define OVERO_GPIO_USBH_NRESET        183
  
  #define NAND_BLOCK_SIZE SZ_128K
 -#define GPMC_CS0_BASE  0x60
 -#define GPMC_CS_SIZE   0x30
  
  #define OVERO_SMSC911X_CS      5
  #define OVERO_SMSC911X_GPIO    176
@@@ -164,26 -166,9 +164,26 @@@ static struct platform_device overo_sms
        },
  };
  
 +static struct platform_device overo_smsc911x2_device = {
 +      .name           = "smsc911x",
 +      .id             = 1,
 +      .num_resources  = ARRAY_SIZE(overo_smsc911x2_resources),
 +      .resource       = overo_smsc911x2_resources,
 +      .dev            = {
 +              .platform_data = &overo_smsc911x_config,
 +      },
 +};
 +
 +static struct platform_device *smsc911x_devices[] = {
 +      &overo_smsc911x_device,
 +      &overo_smsc911x2_device,
 +};
 +
  static inline void __init overo_init_smsc911x(void)
  {
 -      unsigned long cs_mem_base;
 +      unsigned long cs_mem_base, cs_mem_base2;
 +
 +      /* set up first smsc911x chip */
  
        if (gpmc_cs_request(OVERO_SMSC911X_CS, SZ_16M, &cs_mem_base) < 0) {
                printk(KERN_ERR "Failed request for GPMC mem for smsc911x\n");
        overo_smsc911x_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X_GPIO);
        overo_smsc911x_resources[1].end   = 0;
  
 -      platform_device_register(&overo_smsc911x_device);
 +      /* set up second smsc911x chip */
 +
 +      if (gpmc_cs_request(OVERO_SMSC911X2_CS, SZ_16M, &cs_mem_base2) < 0) {
 +              printk(KERN_ERR "Failed request for GPMC mem for smsc911x2\n");
 +              return;
 +      }
 +
 +      overo_smsc911x2_resources[0].start = cs_mem_base2 + 0x0;
 +      overo_smsc911x2_resources[0].end   = cs_mem_base2 + 0xff;
 +
 +      if ((gpio_request(OVERO_SMSC911X2_GPIO, "SMSC911X2 IRQ") == 0) &&
 +          (gpio_direction_input(OVERO_SMSC911X2_GPIO) == 0)) {
 +              gpio_export(OVERO_SMSC911X2_GPIO, 0);
 +      } else {
 +              printk(KERN_ERR "could not obtain gpio for SMSC911X2 IRQ\n");
 +              return;
 +      }
 +
 +      overo_smsc911x2_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X2_GPIO);
 +      overo_smsc911x2_resources[1].end   = 0;
 +
 +      platform_add_devices(smsc911x_devices, ARRAY_SIZE(smsc911x_devices));
  }
  
  #else
@@@ -267,11 -231,28 +267,11 @@@ static struct omap_nand_platform_data o
        .dma_channel = -1,      /* disable DMA in OMAP NAND driver */
  };
  
 -static struct resource overo_nand_resource = {
 -      .flags          = IORESOURCE_MEM,
 -};
 -
 -static struct platform_device overo_nand_device = {
 -      .name           = "omap2-nand",
 -      .id             = -1,
 -      .dev            = {
 -              .platform_data  = &overo_nand_data,
 -      },
 -      .num_resources  = 1,
 -      .resource       = &overo_nand_resource,
 -};
 -
 -
  static void __init overo_flash_init(void)
  {
        u8 cs = 0;
        u8 nandcs = GPMC_CS_NUM + 1;
  
 -      u32 gpmc_base_add = OMAP34XX_GPMC_VIRT;
 -
        /* find out the chip-select on which NAND exists */
        while (cs < GPMC_CS_NUM) {
                u32 ret = 0;
  
        if (nandcs < GPMC_CS_NUM) {
                overo_nand_data.cs = nandcs;
 -              overo_nand_data.gpmc_cs_baseaddr = (void *)
 -                      (gpmc_base_add + GPMC_CS0_BASE + nandcs * GPMC_CS_SIZE);
 -              overo_nand_data.gpmc_baseaddr = (void *) (gpmc_base_add);
  
                printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
 -              if (platform_device_register(&overo_nand_device) < 0)
 +              if (gpmc_nand_init(&overo_nand_data) < 0)
                        printk(KERN_ERR "Unable to register NAND device\n");
        }
  }
@@@ -500,17 -484,12 +500,12 @@@ static void __init overo_init(void
                                        "OVERO_GPIO_USBH_CPEN\n");
  }
  
- static void __init overo_map_io(void)
- {
-       omap2_set_globals_343x();
-       omap34xx_map_common_io();
- }
  MACHINE_START(OVERO, "Gumstix Overo")
        .phys_io        = 0x48000000,
        .io_pg_offst    = ((0xfa000000) >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
-       .map_io         = overo_map_io,
+       .map_io         = omap3_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = overo_init_irq,
        .init_machine   = overo_init,
        .timer          = &omap_timer,
@@@ -71,86 -71,25 +71,81 @@@ static struct twl4030_platform_data zoo
  
  #ifdef CONFIG_OMAP_MUX
  static struct omap_board_mux board_mux[] __initdata = {
 +      /* WLAN IRQ - GPIO 162 */
 +      OMAP3_MUX(MCBSP1_CLKX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP),
 +      /* WLAN POWER ENABLE - GPIO 101 */
 +      OMAP3_MUX(CAM_D2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
 +      /* WLAN SDIO: MMC3 CMD */
 +      OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE3 | OMAP_PIN_INPUT_PULLUP),
 +      /* WLAN SDIO: MMC3 CLK */
 +      OMAP3_MUX(ETK_CLK, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
 +      /* WLAN SDIO: MMC3 DAT[0-3] */
 +      OMAP3_MUX(ETK_D3, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
 +      OMAP3_MUX(ETK_D4, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
 +      OMAP3_MUX(ETK_D5, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
 +      OMAP3_MUX(ETK_D6, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
        { .reg_offset = OMAP_MUX_TERMINATOR },
  };
  #else
  #define board_mux     NULL
  #endif
  
 +static struct mtd_partition zoom_nand_partitions[] = {
 +      /* All the partition sizes are listed in terms of NAND block size */
 +      {
 +              .name           = "X-Loader-NAND",
 +              .offset         = 0,
 +              .size           = 4 * (64 * 2048),      /* 512KB, 0x80000 */
 +              .mask_flags     = MTD_WRITEABLE,        /* force read-only */
 +      },
 +      {
 +              .name           = "U-Boot-NAND",
 +              .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x80000 */
 +              .size           = 10 * (64 * 2048),     /* 1.25MB, 0x140000 */
 +              .mask_flags     = MTD_WRITEABLE,        /* force read-only */
 +      },
 +      {
 +              .name           = "Boot Env-NAND",
 +              .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x1c0000 */
 +              .size           = 2 * (64 * 2048),      /* 256KB, 0x40000 */
 +      },
 +      {
 +              .name           = "Kernel-NAND",
 +              .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x0200000*/
 +              .size           = 240 * (64 * 2048),    /* 30M, 0x1E00000 */
 +      },
 +      {
 +              .name           = "system",
 +              .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x2000000 */
 +              .size           = 3328 * (64 * 2048),   /* 416M, 0x1A000000 */
 +      },
 +      {
 +              .name           = "userdata",
 +              .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x1C000000*/
 +              .size           = 256 * (64 * 2048),    /* 32M, 0x2000000 */
 +      },
 +      {
 +              .name           = "cache",
 +              .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x1E000000*/
 +              .size           = 256 * (64 * 2048),    /* 32M, 0x2000000 */
 +      },
 +};
 +
  static void __init omap_zoom2_init(void)
  {
        omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
        zoom_peripherals_init();
 +      board_nand_init(zoom_nand_partitions,
 +                      ARRAY_SIZE(zoom_nand_partitions), ZOOM_NAND_CS);
        zoom_debugboard_init();
  }
  
- static void __init omap_zoom2_map_io(void)
- {
-       omap2_set_globals_343x();
-       omap34xx_map_common_io();
- }
  MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board")
        .phys_io        = ZOOM_UART_BASE,
        .io_pg_offst    = (ZOOM_UART_VIRT >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
-       .map_io         = omap_zoom2_map_io,
+       .map_io         = omap3_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_zoom2_init_irq,
        .init_machine   = omap_zoom2_init,
        .timer          = &omap_timer,
  #include "mux.h"
  #include "sdram-hynix-h8mbx00u0mer-0em.h"
  
  static struct omap_board_config_kernel zoom_config[] __initdata = {
  };
  
 +static struct mtd_partition zoom_nand_partitions[] = {
 +      /* All the partition sizes are listed in terms of NAND block size */
 +      {
 +              .name           = "X-Loader-NAND",
 +              .offset         = 0,
 +              .size           = 4 * (64 * 2048),      /* 512KB, 0x80000 */
 +              .mask_flags     = MTD_WRITEABLE,        /* force read-only */
 +      },
 +      {
 +              .name           = "U-Boot-NAND",
 +              .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x80000 */
 +              .size           = 10 * (64 * 2048),     /* 1.25MB, 0x140000 */
 +              .mask_flags     = MTD_WRITEABLE,        /* force read-only */
 +      },
 +      {
 +              .name           = "Boot Env-NAND",
 +              .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x1c0000 */
 +              .size           = 2 * (64 * 2048),      /* 256KB, 0x40000 */
 +      },
 +      {
 +              .name           = "Kernel-NAND",
 +              .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x0200000*/
 +              .size           = 240 * (64 * 2048),    /* 30M, 0x1E00000 */
 +      },
 +      {
 +              .name           = "system",
 +              .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x2000000 */
 +              .size           = 3328 * (64 * 2048),   /* 416M, 0x1A000000 */
 +      },
 +      {
 +              .name           = "userdata",
 +              .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x1C000000*/
 +              .size           = 256 * (64 * 2048),    /* 32M, 0x2000000 */
 +      },
 +      {
 +              .name           = "cache",
 +              .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x1E000000*/
 +              .size           = 256 * (64 * 2048),    /* 32M, 0x2000000 */
 +      },
 +};
 +
  static void __init omap_zoom_init_irq(void)
  {
        omap_board_config = zoom_config;
  
  #ifdef CONFIG_OMAP_MUX
  static struct omap_board_mux board_mux[] __initdata = {
 +      /* WLAN IRQ - GPIO 162 */
 +      OMAP3_MUX(MCBSP1_CLKX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP),
 +      /* WLAN POWER ENABLE - GPIO 101 */
 +      OMAP3_MUX(CAM_D2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
 +      /* WLAN SDIO: MMC3 CMD */
 +      OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE3 | OMAP_PIN_INPUT_PULLUP),
 +      /* WLAN SDIO: MMC3 CLK */
 +      OMAP3_MUX(ETK_CLK, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
 +      /* WLAN SDIO: MMC3 DAT[0-3] */
 +      OMAP3_MUX(ETK_D3, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
 +      OMAP3_MUX(ETK_D4, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
 +      OMAP3_MUX(ETK_D5, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
 +      OMAP3_MUX(ETK_D6, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
        { .reg_offset = OMAP_MUX_TERMINATOR },
  };
  #else
@@@ -120,8 -60,6 +114,8 @@@ static void __init omap_zoom_init(void
  {
        omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
        zoom_peripherals_init();
 +      board_nand_init(zoom_nand_partitions,
 +                       ARRAY_SIZE(zoom_nand_partitions), ZOOM_NAND_CS);
        zoom_debugboard_init();
  
        omap_mux_init_gpio(64, OMAP_PIN_OUTPUT);
@@@ -132,7 -70,8 +126,8 @@@ MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 b
        .phys_io        = ZOOM_UART_BASE,
        .io_pg_offst    = (ZOOM_UART_VIRT >> 18) & 0xfffc,
        .boot_params    = 0x80000100,
-       .map_io         = omap_zoom_map_io,
+       .map_io         = omap3_map_io,
+       .reserve        = omap_reserve,
        .init_irq       = omap_zoom_init_irq,
        .init_machine   = omap_zoom_init,
        .timer          = &omap_timer,
@@@ -1408,7 -1408,7 +1408,7 @@@ static struct clk ts_fck = 
  
  static struct clk usbtll_fck = {
        .name           = "usbtll_fck",
 -      .ops            = &clkops_omap2_dflt,
 +      .ops            = &clkops_omap2_dflt_wait,
        .parent         = &dpll5_m2_ck,
        .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3),
        .enable_bit     = OMAP3430ES2_EN_USBTLL_SHIFT,
@@@ -3166,6 -3166,10 +3166,10 @@@ static struct clk uart4_ick_am35xx = 
        .recalc         = &followparent_recalc,
  };
  
+ static struct clk dummy_apb_pclk = {
+       .name           = "apb_pclk",
+       .ops            = &clkops_null,
+ };
  
  /*
   * clkdev
  
  /* XXX At some point we should rename this file to clock3xxx_data.c */
  static struct omap_clk omap3xxx_clks[] = {
+       CLK(NULL,       "apb_pclk",     &dummy_apb_pclk,        CK_3XXX),
        CLK(NULL,       "omap_32k_fck", &omap_32k_fck,  CK_3XXX),
        CLK(NULL,       "virt_12m_ck",  &virt_12m_ck,   CK_3XXX),
        CLK(NULL,       "virt_13m_ck",  &virt_13m_ck,   CK_3XXX),
diff --combined arch/arm/mach-omap2/io.c
  
  #include <asm/mach/map.h>
  
 -#include <plat/mux.h>
  #include <plat/sram.h>
  #include <plat/sdrc.h>
  #include <plat/gpmc.h>
  #include <plat/serial.h>
- #include <plat/vram.h>
  
  #include "clock2xxx.h"
  #include "clock3xxx.h"
@@@ -44,7 -44,6 +43,7 @@@
  
  #include <plat/clockdomain.h>
  #include "clockdomains.h"
 +
  #include <plat/omap_hwmod.h>
  
  /*
@@@ -241,8 -240,6 +240,6 @@@ static void __init _omap2_map_common_io
  
        omap2_check_revision();
        omap_sram_init();
-       omapfb_reserve_sdram();
-       omap_vram_reserve_sdram();
  }
  
  #ifdef CONFIG_ARCH_OMAP2420
@@@ -316,8 -313,6 +313,8 @@@ static int __init _omap2_init_reprogram
  void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
                                 struct omap_sdrc_params *sdrc_cs1)
  {
 +      u8 skip_setup_idle = 0;
 +
        pwrdm_init(powerdomains_omap);
        clkdm_init(clockdomains_omap, clkdm_autodeps);
        if (cpu_is_omap242x())
                omap2430_hwmod_init();
        else if (cpu_is_omap34xx())
                omap3xxx_hwmod_init();
 -      omap2_mux_init();
        /* The OPP tables have to be registered before a clk init */
        omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps);
  
                pr_err("Could not init clock framework - unknown CPU\n");
  
        omap_serial_early_init();
 +
 +#ifndef CONFIG_PM_RUNTIME
 +      skip_setup_idle = 1;
 +#endif
        if (cpu_is_omap24xx() || cpu_is_omap34xx())   /* FIXME: OMAP4 */
 -              omap_hwmod_late_init();
 -      omap_pm_if_init();
 +              omap_hwmod_late_init(skip_setup_idle);
 +
        if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
                omap2_sdrc_init(sdrc_cs0, sdrc_cs1);
                _omap2_init_reprogram_sdrc();
@@@ -34,6 -34,8 +34,8 @@@ struct sys_timer
  extern void omap_map_common_io(void);
  extern struct sys_timer omap_timer;
  
+ extern void omap_reserve(void);
  /*
   * IO bases for various OMAP processors
   * Except the tap base, rest all the io bases
@@@ -56,8 -58,7 +58,7 @@@ struct omap_globals 
  
  void omap2_set_globals_242x(void);
  void omap2_set_globals_243x(void);
- void omap2_set_globals_343x(void);
- void omap2_set_globals_36xx(void);
+ void omap2_set_globals_3xxx(void);
  void omap2_set_globals_443x(void);
  
  /* These get called from omap2_set_globals_xxxx(), do not call these */
@@@ -67,6 -68,8 +68,8 @@@ void omap2_set_globals_control(struct o
  void omap2_set_globals_prcm(struct omap_globals *);
  void omap2_set_globals_uart(struct omap_globals *);
  
+ void omap3_map_io(void);
  /**
   * omap_test_timeout - busy-loop, testing a condition
   * @cond: condition to test until it evaluates to true
@@@ -87,8 -90,4 +90,8 @@@
        }                                                       \
  })
  
 +extern struct device *omap2_get_mpuss_device(void);
 +extern struct device *omap2_get_dsp_device(void);
 +extern struct device *omap2_get_l3_device(void);
 +
  #endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */