Merge tag 'headers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 12 Dec 2012 19:45:16 +0000 (11:45 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 12 Dec 2012 19:45:16 +0000 (11:45 -0800)
Pull ARM SoC Header cleanups from Olof Johansson:
 "This is a collection of header file cleanups, mostly for OMAP and
  AT91, that keeps moving the platforms in the direction of
  multiplatform by removing the need for mach-dependent header files
  used in drivers and other places."

Fix up mostly trivial conflicts as per Olof.

* tag 'headers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (106 commits)
  ARM: OMAP2+: Move iommu/iovmm headers to platform_data
  ARM: OMAP2+: Make some definitions local
  ARM: OMAP2+: Move iommu2 to drivers/iommu/omap-iommu2.c
  ARM: OMAP2+: Move plat/iovmm.h to include/linux/omap-iommu.h
  ARM: OMAP2+: Move iopgtable header to drivers/iommu/
  ARM: OMAP: Merge iommu2.h into iommu.h
  atmel: move ATMEL_MAX_UART to platform_data/atmel.h
  ARM: OMAP: Remove omap_init_consistent_dma_size()
  arm: at91: move at91rm9200 rtc header in drivers/rtc
  arm: at91: move reset controller header to arm/arm/mach-at91
  arm: at91: move pit define to the driver
  arm: at91: move at91_shdwc.h to arch/arm/mach-at91
  arm: at91: move board header to arch/arm/mach-at91
  arn: at91: move at91_tc.h to arch/arm/mach-at91
  arm: at91 move at91_aic.h to arch/arm/mach-at91
  arm: at91 move board.h to arch/arm/mach-at91
  arm: at91: move platfarm_data to include/linux/platform_data/atmel.h
  arm: at91: drop machine defconfig
  ARM: OMAP: Remove NEED_MACH_GPIO_H
  ARM: OMAP: Remove unnecessary mach and plat includes
  ...

54 files changed:
1  2 
arch/arm/Kconfig
arch/arm/mach-at91/at91rm9200.c
arch/arm/mach-at91/at91rm9200_devices.c
arch/arm/mach-at91/at91sam9260.c
arch/arm/mach-at91/at91sam9260_devices.c
arch/arm/mach-at91/at91sam9261.c
arch/arm/mach-at91/at91sam9261_devices.c
arch/arm/mach-at91/at91sam9263.c
arch/arm/mach-at91/at91sam9263_devices.c
arch/arm/mach-at91/at91sam9g45.c
arch/arm/mach-at91/at91sam9g45_devices.c
arch/arm/mach-at91/at91sam9n12.c
arch/arm/mach-at91/at91sam9rl.c
arch/arm/mach-at91/at91sam9x5.c
arch/arm/mach-at91/board-dt.c
arch/arm/mach-at91/board.h
arch/arm/mach-at91/setup.c
arch/arm/mach-omap2/board-igep0020.c
arch/arm/mach-omap2/board-overo.c
arch/arm/mach-omap2/common-board-devices.c
arch/arm/mach-omap2/common.h
arch/arm/mach-omap2/devices.c
arch/arm/mach-omap2/drm.c
arch/arm/mach-omap2/omap-mpuss-lowpower.c
arch/arm/mach-omap2/omap4-common.c
arch/arm/mach-omap2/omap_hwmod.c
arch/arm/mach-omap2/omap_hwmod.h
arch/arm/mach-omap2/omap_hwmod_44xx_data.c
arch/arm/mach-omap2/pmu.c
arch/arm/mach-omap2/twl-common.c
drivers/media/platform/omap3isp/ispccdc.c
drivers/media/platform/omap3isp/ispstat.c
drivers/media/platform/omap3isp/ispstat.h
drivers/media/platform/omap3isp/ispvideo.c
drivers/media/platform/soc_camera/omap1_camera.c
drivers/mfd/omap-usb-host.c
drivers/mfd/omap-usb-tll.c
drivers/mmc/host/atmel-mci.c
drivers/mmc/host/omap.c
drivers/mmc/host/omap_hsmmc.c
drivers/tty/serial/atmel_serial.c
drivers/usb/gadget/at91_udc.c
drivers/usb/gadget/omap_udc.c
drivers/usb/host/ehci-omap.c
drivers/usb/host/ohci-at91.c
drivers/usb/host/ohci-omap.c
drivers/usb/host/ohci-omap3.c
drivers/usb/musb/am35x.c
drivers/usb/musb/musb_dsps.c
drivers/usb/musb/tusb6010_omap.c
drivers/video/omap2/dss/dss.c
drivers/video/omap2/dss/hdmi.c
drivers/video/omap2/omapfb/omapfb-ioctl.c
include/linux/platform_data/mmc-omap.h

diff --combined arch/arm/Kconfig
@@@ -5,9 -5,8 +5,9 @@@ config AR
        select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
        select ARCH_HAVE_CUSTOM_GPIO_H
        select ARCH_WANT_IPC_PARSE_VERSION
 +      select BUILDTIME_EXTABLE_SORT if MMU
        select CPU_PM if (SUSPEND || CPU_IDLE)
 -      select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN
 +      select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN && MMU
        select GENERIC_ATOMIC64 if (CPU_V6 || !CPU_32v6K || !AEABI)
        select GENERIC_CLOCKEVENTS_BROADCAST if SMP
        select GENERIC_IRQ_PROBE
@@@ -22,7 -21,6 +22,7 @@@
        select HAVE_AOUT
        select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
        select HAVE_ARCH_KGDB
 +      select HAVE_ARCH_SECCOMP_FILTER
        select HAVE_ARCH_TRACEHOOK
        select HAVE_BPF_JIT
        select HAVE_C_RECORDMCOUNT
@@@ -332,8 -330,6 +332,8 @@@ config ARCH_AT9
        select IRQ_DOMAIN
        select NEED_MACH_GPIO_H
        select NEED_MACH_IO_H if PCCARD
 +      select PINCTRL
 +      select PINCTRL_AT91 if USE_OF
        help
          This enables support for systems based on Atmel
          AT91RM9200 and AT91SAM9* processors.
@@@ -368,7 -364,6 +368,7 @@@ config ARCH_CNS3XX
  
  config ARCH_CLPS711X
        bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"
 +      select ARCH_REQUIRE_GPIOLIB
        select ARCH_USES_GETTIMEOFFSET
        select CLKDEV_LOOKUP
        select COMMON_CLK
@@@ -552,7 -547,6 +552,7 @@@ config ARCH_KIRKWOO
        select CPU_FEROCEON
        select GENERIC_CLOCKEVENTS
        select PCI
 +      select PCI_QUIRKS
        select PLAT_ORION_LEGACY
        help
          Support for the following Marvell Kirkwood series SoCs:
@@@ -592,7 -586,6 +592,7 @@@ config ARCH_MM
        select GPIO_PXA
        select IRQ_DOMAIN
        select NEED_MACH_GPIO_H
 +      select PINCTRL
        select PLAT_PXA
        select SPARSE_IRQ
        help
@@@ -911,7 -904,6 +911,7 @@@ config ARCH_NOMADI
  
  config PLAT_SPEAR
        bool "ST SPEAr"
 +      select ARCH_HAS_CPUFREQ
        select ARCH_REQUIRE_GPIOLIB
        select ARM_AMBA
        select CLKDEV_LOOKUP
@@@ -945,7 -937,6 +945,6 @@@ config ARCH_OMA
        select CLKSRC_MMIO
        select GENERIC_CLOCKEVENTS
        select HAVE_CLK
-       select NEED_MACH_GPIO_H
        help
          Support for TI's OMAP platform (OMAP1/2/3/4).
  
  #include <asm/mach/map.h>
  #include <asm/system_misc.h>
  #include <mach/at91rm9200.h>
- #include <mach/at91_aic.h>
  #include <mach/at91_pmc.h>
  #include <mach/at91_st.h>
  #include <mach/cpu.h>
  
+ #include "at91_aic.h"
  #include "soc.h"
  #include "generic.h"
  #include "clock.h"
@@@ -194,24 -194,6 +194,24 @@@ static struct clk_lookup periph_clocks_
        CLKDEV_CON_ID("pioB", &pioB_clk),
        CLKDEV_CON_ID("pioC", &pioC_clk),
        CLKDEV_CON_ID("pioD", &pioD_clk),
 +      /* usart lookup table for DT entries */
 +      CLKDEV_CON_DEV_ID("usart", "fffff200.serial", &mck),
 +      CLKDEV_CON_DEV_ID("usart", "fffc0000.serial", &usart0_clk),
 +      CLKDEV_CON_DEV_ID("usart", "fffc4000.serial", &usart1_clk),
 +      CLKDEV_CON_DEV_ID("usart", "fffc8000.serial", &usart2_clk),
 +      CLKDEV_CON_DEV_ID("usart", "fffcc000.serial", &usart3_clk),
 +      /* tc lookup table for DT entries */
 +      CLKDEV_CON_DEV_ID("t0_clk", "fffa0000.timer", &tc0_clk),
 +      CLKDEV_CON_DEV_ID("t1_clk", "fffa0000.timer", &tc1_clk),
 +      CLKDEV_CON_DEV_ID("t2_clk", "fffa0000.timer", &tc2_clk),
 +      CLKDEV_CON_DEV_ID("t0_clk", "fffa4000.timer", &tc3_clk),
 +      CLKDEV_CON_DEV_ID("t1_clk", "fffa4000.timer", &tc4_clk),
 +      CLKDEV_CON_DEV_ID("t2_clk", "fffa4000.timer", &tc5_clk),
 +      CLKDEV_CON_DEV_ID("hclk", "300000.ohci", &ohci_clk),
 +      CLKDEV_CON_DEV_ID(NULL, "fffff400.gpio", &pioA_clk),
 +      CLKDEV_CON_DEV_ID(NULL, "fffff600.gpio", &pioB_clk),
 +      CLKDEV_CON_DEV_ID(NULL, "fffff800.gpio", &pioC_clk),
 +      CLKDEV_CON_DEV_ID(NULL, "fffffa00.gpio", &pioD_clk),
  };
  
  static struct clk_lookup usart_clocks_lookups[] = {
@@@ -379,10 -361,10 +379,10 @@@ static unsigned int at91rm9200_default_
        0       /* Advanced Interrupt Controller (IRQ6) */
  };
  
 -struct at91_init_soc __initdata at91rm9200_soc = {
 +AT91_SOC_START(rm9200)
        .map_io = at91rm9200_map_io,
        .default_irq_priority = at91rm9200_default_irq_priority,
        .ioremap_registers = at91rm9200_ioremap_registers,
        .register_clocks = at91rm9200_register_clocks,
        .init = at91rm9200_initialize,
 -};
 +AT91_SOC_END
  #include <linux/platform_device.h>
  #include <linux/i2c-gpio.h>
  
- #include <mach/board.h>
  #include <mach/at91rm9200.h>
  #include <mach/at91rm9200_mc.h>
  #include <mach/at91_ramc.h>
  
+ #include "board.h"
  #include "generic.h"
  
  
@@@ -68,7 -68,7 +68,7 @@@ void __init at91_add_device_usbh(struc
  
        /* Enable overcurrent notification */
        for (i = 0; i < data->ports; i++) {
 -              if (data->overcurrent_pin[i])
 +              if (gpio_is_valid(data->overcurrent_pin[i]))
                        at91_set_gpio_input(data->overcurrent_pin[i], 1);
        }
  
  #include <mach/cpu.h>
  #include <mach/at91_dbgu.h>
  #include <mach/at91sam9260.h>
- #include <mach/at91_aic.h>
  #include <mach/at91_pmc.h>
- #include <mach/at91_rstc.h>
  
+ #include "at91_aic.h"
+ #include "at91_rstc.h"
  #include "soc.h"
  #include "generic.h"
  #include "clock.h"
@@@ -230,15 -230,11 +230,15 @@@ static struct clk_lookup periph_clocks_
        CLKDEV_CON_DEV_ID("t1_clk", "fffdc000.timer", &tc4_clk),
        CLKDEV_CON_DEV_ID("t2_clk", "fffdc000.timer", &tc5_clk),
        CLKDEV_CON_DEV_ID("hclk", "500000.ohci", &ohci_clk),
 +      CLKDEV_CON_DEV_ID("mci_clk", "fffa8000.mmc", &mmc_clk),
        /* fake hclk clock */
        CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk),
        CLKDEV_CON_ID("pioA", &pioA_clk),
        CLKDEV_CON_ID("pioB", &pioB_clk),
        CLKDEV_CON_ID("pioC", &pioC_clk),
 +      CLKDEV_CON_DEV_ID(NULL, "fffff400.gpio", &pioA_clk),
 +      CLKDEV_CON_DEV_ID(NULL, "fffff600.gpio", &pioB_clk),
 +      CLKDEV_CON_DEV_ID(NULL, "fffff800.gpio", &pioC_clk),
  };
  
  static struct clk_lookup usart_clocks_lookups[] = {
@@@ -394,10 -390,10 +394,10 @@@ static unsigned int at91sam9260_default
        0,      /* Advanced Interrupt Controller */
  };
  
 -struct at91_init_soc __initdata at91sam9260_soc = {
 +AT91_SOC_START(sam9260)
        .map_io = at91sam9260_map_io,
        .default_irq_priority = at91sam9260_default_irq_priority,
        .ioremap_registers = at91sam9260_ioremap_registers,
        .register_clocks = at91sam9260_register_clocks,
        .init = at91sam9260_initialize,
 -};
 +AT91_SOC_END
@@@ -19,7 -19,6 +19,6 @@@
  
  #include <linux/platform_data/at91_adc.h>
  
- #include <mach/board.h>
  #include <mach/cpu.h>
  #include <mach/at91sam9260.h>
  #include <mach/at91sam9260_matrix.h>
@@@ -27,6 -26,7 +26,7 @@@
  #include <mach/at91sam9_smc.h>
  #include <mach/at91_adc.h>
  
+ #include "board.h"
  #include "generic.h"
  
  
@@@ -72,7 -72,7 +72,7 @@@ void __init at91_add_device_usbh(struc
  
        /* Enable overcurrent notification */
        for (i = 0; i < data->ports; i++) {
 -              if (data->overcurrent_pin[i])
 +              if (gpio_is_valid(data->overcurrent_pin[i]))
                        at91_set_gpio_input(data->overcurrent_pin[i], 1);
        }
  
  #include <asm/system_misc.h>
  #include <mach/cpu.h>
  #include <mach/at91sam9261.h>
- #include <mach/at91_aic.h>
  #include <mach/at91_pmc.h>
- #include <mach/at91_rstc.h>
  
+ #include "at91_aic.h"
+ #include "at91_rstc.h"
  #include "soc.h"
  #include "generic.h"
  #include "clock.h"
@@@ -334,10 -334,10 +334,10 @@@ static unsigned int at91sam9261_default
        0,      /* Advanced Interrupt Controller */
  };
  
 -struct at91_init_soc __initdata at91sam9261_soc = {
 +AT91_SOC_START(sam9261)
        .map_io = at91sam9261_map_io,
        .default_irq_priority = at91sam9261_default_irq_priority,
        .ioremap_registers = at91sam9261_ioremap_registers,
        .register_clocks = at91sam9261_register_clocks,
        .init = at91sam9261_initialize,
 -};
 +AT91_SOC_END
  #include <linux/fb.h>
  #include <video/atmel_lcdc.h>
  
- #include <mach/board.h>
  #include <mach/at91sam9261.h>
  #include <mach/at91sam9261_matrix.h>
  #include <mach/at91_matrix.h>
  #include <mach/at91sam9_smc.h>
  
+ #include "board.h"
  #include "generic.h"
  
  
@@@ -72,7 -72,7 +72,7 @@@ void __init at91_add_device_usbh(struc
  
        /* Enable overcurrent notification */
        for (i = 0; i < data->ports; i++) {
 -              if (data->overcurrent_pin[i])
 +              if (gpio_is_valid(data->overcurrent_pin[i]))
                        at91_set_gpio_input(data->overcurrent_pin[i], 1);
        }
  
  #include <asm/mach/map.h>
  #include <asm/system_misc.h>
  #include <mach/at91sam9263.h>
- #include <mach/at91_aic.h>
  #include <mach/at91_pmc.h>
- #include <mach/at91_rstc.h>
  
+ #include "at91_aic.h"
+ #include "at91_rstc.h"
  #include "soc.h"
  #include "generic.h"
  #include "clock.h"
@@@ -211,14 -211,7 +211,14 @@@ static struct clk_lookup periph_clocks_
        CLKDEV_CON_DEV_ID("hclk", "a00000.ohci", &ohci_clk),
        CLKDEV_CON_DEV_ID("spi_clk", "fffa4000.spi", &spi0_clk),
        CLKDEV_CON_DEV_ID("spi_clk", "fffa8000.spi", &spi1_clk),
 +      CLKDEV_CON_DEV_ID("mci_clk", "fff80000.mmc", &mmc0_clk),
 +      CLKDEV_CON_DEV_ID("mci_clk", "fff84000.mmc", &mmc1_clk),
        CLKDEV_CON_DEV_ID(NULL, "fff88000.i2c", &twi_clk),
 +      CLKDEV_CON_DEV_ID(NULL, "fffff200.gpio", &pioA_clk),
 +      CLKDEV_CON_DEV_ID(NULL, "fffff400.gpio", &pioB_clk),
 +      CLKDEV_CON_DEV_ID(NULL, "fffff600.gpio", &pioCDE_clk),
 +      CLKDEV_CON_DEV_ID(NULL, "fffff800.gpio", &pioCDE_clk),
 +      CLKDEV_CON_DEV_ID(NULL, "fffffa00.gpio", &pioCDE_clk),
  };
  
  static struct clk_lookup usart_clocks_lookups[] = {
@@@ -372,10 -365,10 +372,10 @@@ static unsigned int at91sam9263_default
        0,      /* Advanced Interrupt Controller (IRQ1) */
  };
  
 -struct at91_init_soc __initdata at91sam9263_soc = {
 +AT91_SOC_START(sam9263)
        .map_io = at91sam9263_map_io,
        .default_irq_priority = at91sam9263_default_irq_priority,
        .ioremap_registers = at91sam9263_ioremap_registers,
        .register_clocks = at91sam9263_register_clocks,
        .init = at91sam9263_initialize,
 -};
 +AT91_SOC_END
  #include <linux/fb.h>
  #include <video/atmel_lcdc.h>
  
- #include <mach/board.h>
  #include <mach/at91sam9263.h>
  #include <mach/at91sam9263_matrix.h>
  #include <mach/at91_matrix.h>
  #include <mach/at91sam9_smc.h>
  
+ #include "board.h"
  #include "generic.h"
  
  
@@@ -78,7 -78,7 +78,7 @@@ void __init at91_add_device_usbh(struc
  
        /* Enable overcurrent notification */
        for (i = 0; i < data->ports; i++) {
 -              if (data->overcurrent_pin[i])
 +              if (gpio_is_valid(data->overcurrent_pin[i]))
                        at91_set_gpio_input(data->overcurrent_pin[i], 1);
        }
  
  #include <asm/mach/map.h>
  #include <asm/system_misc.h>
  #include <mach/at91sam9g45.h>
- #include <mach/at91_aic.h>
  #include <mach/at91_pmc.h>
  #include <mach/cpu.h>
  
+ #include "at91_aic.h"
  #include "soc.h"
  #include "generic.h"
  #include "clock.h"
@@@ -256,18 -256,10 +256,18 @@@ static struct clk_lookup periph_clocks_
        CLKDEV_CON_DEV_ID("t0_clk", "fffd4000.timer", &tcb0_clk),
        CLKDEV_CON_DEV_ID("hclk", "700000.ohci", &uhphs_clk),
        CLKDEV_CON_DEV_ID("ehci_clk", "800000.ehci", &uhphs_clk),
 +      CLKDEV_CON_DEV_ID("mci_clk", "fff80000.mmc", &mmc0_clk),
 +      CLKDEV_CON_DEV_ID("mci_clk", "fffd0000.mmc", &mmc1_clk),
        CLKDEV_CON_DEV_ID(NULL, "fff84000.i2c", &twi0_clk),
        CLKDEV_CON_DEV_ID(NULL, "fff88000.i2c", &twi1_clk),
        /* fake hclk clock */
        CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &uhphs_clk),
 +      CLKDEV_CON_DEV_ID(NULL, "fffff200.gpio", &pioA_clk),
 +      CLKDEV_CON_DEV_ID(NULL, "fffff400.gpio", &pioB_clk),
 +      CLKDEV_CON_DEV_ID(NULL, "fffff600.gpio", &pioC_clk),
 +      CLKDEV_CON_DEV_ID(NULL, "fffff800.gpio", &pioDE_clk),
 +      CLKDEV_CON_DEV_ID(NULL, "fffffa00.gpio", &pioDE_clk),
 +
        CLKDEV_CON_ID("pioA", &pioA_clk),
        CLKDEV_CON_ID("pioB", &pioB_clk),
        CLKDEV_CON_ID("pioC", &pioC_clk),
@@@ -417,10 -409,10 +417,10 @@@ static unsigned int at91sam9g45_default
        0,      /* Advanced Interrupt Controller (IRQ0) */
  };
  
 -struct at91_init_soc __initdata at91sam9g45_soc = {
 +AT91_SOC_START(sam9g45)
        .map_io = at91sam9g45_map_io,
        .default_irq_priority = at91sam9g45_default_irq_priority,
        .ioremap_registers = at91sam9g45_ioremap_registers,
        .register_clocks = at91sam9g45_register_clocks,
        .init = at91sam9g45_initialize,
 -};
 +AT91_SOC_END
@@@ -26,7 -26,6 +26,6 @@@
  #include <video/atmel_lcdc.h>
  
  #include <mach/at91_adc.h>
- #include <mach/board.h>
  #include <mach/at91sam9g45.h>
  #include <mach/at91sam9g45_matrix.h>
  #include <mach/at91_matrix.h>
@@@ -36,6 -35,7 +35,7 @@@
  
  #include <media/atmel-isi.h>
  
+ #include "board.h"
  #include "generic.h"
  #include "clock.h"
  
@@@ -1841,8 -1841,8 +1841,8 @@@ static struct resource sha_resources[] 
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
 -              .start  = AT91SAM9G45_ID_AESTDESSHA,
 -              .end    = AT91SAM9G45_ID_AESTDESSHA,
 +              .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA,
 +              .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA,
                .flags  = IORESOURCE_IRQ,
        },
  };
@@@ -1874,8 -1874,8 +1874,8 @@@ static struct resource tdes_resources[
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
 -              .start  = AT91SAM9G45_ID_AESTDESSHA,
 -              .end    = AT91SAM9G45_ID_AESTDESSHA,
 +              .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA,
 +              .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA,
                .flags  = IORESOURCE_IRQ,
        },
  };
@@@ -1910,8 -1910,8 +1910,8 @@@ static struct resource aes_resources[] 
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
 -              .start  = AT91SAM9G45_ID_AESTDESSHA,
 -              .end    = AT91SAM9G45_ID_AESTDESSHA,
 +              .start  = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA,
 +              .end    = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA,
                .flags  = IORESOURCE_IRQ,
        },
  };
@@@ -15,8 -15,8 +15,8 @@@
  #include <mach/at91sam9n12.h>
  #include <mach/at91_pmc.h>
  #include <mach/cpu.h>
- #include <mach/board.h>
  
+ #include "board.h"
  #include "soc.h"
  #include "generic.h"
  #include "clock.h"
@@@ -168,14 -168,13 +168,14 @@@ static struct clk_lookup periph_clocks_
        CLKDEV_CON_DEV_ID("usart", "f8028000.serial", &usart3_clk),
        CLKDEV_CON_DEV_ID("t0_clk", "f8008000.timer", &tcb_clk),
        CLKDEV_CON_DEV_ID("t0_clk", "f800c000.timer", &tcb_clk),
 +      CLKDEV_CON_DEV_ID("mci_clk", "f0008000.mmc", &mmc_clk),
        CLKDEV_CON_DEV_ID("dma_clk", "ffffec00.dma-controller", &dma_clk),
        CLKDEV_CON_DEV_ID(NULL, "f8010000.i2c", &twi0_clk),
        CLKDEV_CON_DEV_ID(NULL, "f8014000.i2c", &twi1_clk),
 -      CLKDEV_CON_ID("pioA", &pioAB_clk),
 -      CLKDEV_CON_ID("pioB", &pioAB_clk),
 -      CLKDEV_CON_ID("pioC", &pioCD_clk),
 -      CLKDEV_CON_ID("pioD", &pioCD_clk),
 +      CLKDEV_CON_DEV_ID(NULL, "fffff400.gpio", &pioAB_clk),
 +      CLKDEV_CON_DEV_ID(NULL, "fffff600.gpio", &pioAB_clk),
 +      CLKDEV_CON_DEV_ID(NULL, "fffff800.gpio", &pioCD_clk),
 +      CLKDEV_CON_DEV_ID(NULL, "fffffa00.gpio", &pioCD_clk),
        /* additional fake clock for macb_hclk */
        CLKDEV_CON_DEV_ID("hclk", "500000.ohci", &uhp_clk),
        CLKDEV_CON_DEV_ID("ohci_clk", "500000.ohci", &uhp_clk),
@@@ -224,10 -223,13 +224,10 @@@ static void __init at91sam9n12_map_io(v
  void __init at91sam9n12_initialize(void)
  {
        at91_extern_irq = (1 << AT91SAM9N12_ID_IRQ0);
 -
 -      /* Register GPIO subsystem (using DT) */
 -      at91_gpio_init(NULL, 0);
  }
  
 -struct at91_init_soc __initdata at91sam9n12_soc = {
 +AT91_SOC_START(sam9n12)
        .map_io = at91sam9n12_map_io,
        .register_clocks = at91sam9n12_register_clocks,
        .init = at91sam9n12_initialize,
 -};
 +AT91_SOC_END
  #include <mach/cpu.h>
  #include <mach/at91_dbgu.h>
  #include <mach/at91sam9rl.h>
- #include <mach/at91_aic.h>
  #include <mach/at91_pmc.h>
- #include <mach/at91_rstc.h>
  
+ #include "at91_aic.h"
+ #include "at91_rstc.h"
  #include "soc.h"
  #include "generic.h"
  #include "clock.h"
@@@ -338,10 -338,10 +338,10 @@@ static unsigned int at91sam9rl_default_
        0,      /* Advanced Interrupt Controller */
  };
  
 -struct at91_init_soc __initdata at91sam9rl_soc = {
 +AT91_SOC_START(sam9rl)
        .map_io = at91sam9rl_map_io,
        .default_irq_priority = at91sam9rl_default_irq_priority,
        .ioremap_registers = at91sam9rl_ioremap_registers,
        .register_clocks = at91sam9rl_register_clocks,
        .init = at91sam9rl_initialize,
 -};
 +AT91_SOC_END
@@@ -15,8 -15,8 +15,8 @@@
  #include <mach/at91sam9x5.h>
  #include <mach/at91_pmc.h>
  #include <mach/cpu.h>
- #include <mach/board.h>
  
+ #include "board.h"
  #include "soc.h"
  #include "generic.h"
  #include "clock.h"
@@@ -229,17 -229,15 +229,17 @@@ static struct clk_lookup periph_clocks_
        CLKDEV_CON_DEV_ID("usart", "f8028000.serial", &usart3_clk),
        CLKDEV_CON_DEV_ID("t0_clk", "f8008000.timer", &tcb0_clk),
        CLKDEV_CON_DEV_ID("t0_clk", "f800c000.timer", &tcb0_clk),
 +      CLKDEV_CON_DEV_ID("mci_clk", "f0008000.mmc", &mmc0_clk),
 +      CLKDEV_CON_DEV_ID("mci_clk", "f000c000.mmc", &mmc1_clk),
        CLKDEV_CON_DEV_ID("dma_clk", "ffffec00.dma-controller", &dma0_clk),
        CLKDEV_CON_DEV_ID("dma_clk", "ffffee00.dma-controller", &dma1_clk),
        CLKDEV_CON_DEV_ID(NULL, "f8010000.i2c", &twi0_clk),
        CLKDEV_CON_DEV_ID(NULL, "f8014000.i2c", &twi1_clk),
        CLKDEV_CON_DEV_ID(NULL, "f8018000.i2c", &twi2_clk),
 -      CLKDEV_CON_ID("pioA", &pioAB_clk),
 -      CLKDEV_CON_ID("pioB", &pioAB_clk),
 -      CLKDEV_CON_ID("pioC", &pioCD_clk),
 -      CLKDEV_CON_ID("pioD", &pioCD_clk),
 +      CLKDEV_CON_DEV_ID(NULL, "fffff400.gpio", &pioAB_clk),
 +      CLKDEV_CON_DEV_ID(NULL, "fffff600.gpio", &pioAB_clk),
 +      CLKDEV_CON_DEV_ID(NULL, "fffff800.gpio", &pioCD_clk),
 +      CLKDEV_CON_DEV_ID(NULL, "fffffa00.gpio", &pioCD_clk),
        /* additional fake clock for macb_hclk */
        CLKDEV_CON_DEV_ID("hclk", "f802c000.ethernet", &macb0_clk),
        CLKDEV_CON_DEV_ID("hclk", "f8030000.ethernet", &macb1_clk),
@@@ -315,11 -313,18 +315,11 @@@ static void __init at91sam9x5_map_io(vo
        at91_init_sram(0, AT91SAM9X5_SRAM_BASE, AT91SAM9X5_SRAM_SIZE);
  }
  
 -void __init at91sam9x5_initialize(void)
 -{
 -      /* Register GPIO subsystem (using DT) */
 -      at91_gpio_init(NULL, 0);
 -}
 -
  /* --------------------------------------------------------------------
   *  Interrupt initialization
   * -------------------------------------------------------------------- */
  
 -struct at91_init_soc __initdata at91sam9x5_soc = {
 +AT91_SOC_START(sam9x5)
        .map_io = at91sam9x5_map_io,
        .register_clocks = at91sam9x5_register_clocks,
 -      .init = at91sam9x5_initialize,
 -};
 +AT91_SOC_END
  #include <linux/of_irq.h>
  #include <linux/of_platform.h>
  
- #include <mach/board.h>
- #include <mach/at91_aic.h>
  #include <asm/setup.h>
  #include <asm/irq.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/map.h>
  #include <asm/mach/irq.h>
  
+ #include "at91_aic.h"
+ #include "board.h"
  #include "generic.h"
  
  
  static const struct of_device_id irq_of_match[] __initconst = {
  
        { .compatible = "atmel,at91rm9200-aic", .data = at91_aic_of_init },
 -      { .compatible = "atmel,at91rm9200-gpio", .data = at91_gpio_of_irq_setup },
 -      { .compatible = "atmel,at91sam9x5-gpio", .data = at91_gpio_of_irq_setup },
        { /*sentinel*/ }
  };
  
index 0000000,662451d..4a234fb
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,141 +1,131 @@@
 -  /* at91_mci platform config */
 -struct at91_mmc_data {
 -      int             det_pin;        /* card detect IRQ */
 -      unsigned        slot_b:1;       /* uses Slot B */
 -      unsigned        wire4:1;        /* (SD) supports DAT0..DAT3 */
 -      int             wp_pin;         /* (SD) writeprotect detect */
 -      int             vcc_pin;        /* power switching (high == on) */
 -};
 -extern void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data);
 -
+ /*
+  * arch/arm/mach-at91/include/mach/board.h
+  *
+  *  Copyright (C) 2005 HP Labs
+  *
+  * This program is free software; you can redistribute it and/or modify
+  * it under the terms of the GNU General Public License as published by
+  * the Free Software Foundation; either version 2 of the License, or
+  * (at your option) any later version.
+  *
+  * This program is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  * GNU General Public License for more details.
+  *
+  * You should have received a copy of the GNU General Public License
+  * along with this program; if not, write to the Free Software
+  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+  */
+ /*
+  * These are data structures found in platform_device.dev.platform_data,
+  * and describing board-specific data needed by drivers.  For example,
+  * which pin is used for a given GPIO role.
+  *
+  * In 2.6, drivers should strongly avoid board-specific knowledge so
+  * that supporting new boards normally won't require driver patches.
+  * Most board-specific knowledge should be in arch/.../board-*.c files.
+  */
+ #ifndef __ASM_ARCH_BOARD_H
+ #define __ASM_ARCH_BOARD_H
+ #include <linux/platform_data/atmel.h>
+  /* USB Device */
+ extern void __init at91_add_device_udc(struct at91_udc_data *data);
+  /* USB High Speed Device */
+ extern void __init at91_add_device_usba(struct usba_platform_data *data);
+  /* Compact Flash */
+ extern void __init at91_add_device_cf(struct at91_cf_data *data);
+  /* MMC / SD */
+   /* atmel-mci platform config */
+ extern void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data);
+ extern void __init at91_add_device_eth(struct macb_platform_data *data);
+  /* USB Host */
+ extern void __init at91_add_device_usbh(struct at91_usbh_data *data);
+ extern void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data);
+ extern void __init at91_add_device_usbh_ehci(struct at91_usbh_data *data);
+ extern void __init at91_add_device_nand(struct atmel_nand_data *data);
+  /* I2C*/
+ #if defined(CONFIG_ARCH_AT91SAM9G45)
+ extern void __init at91_add_device_i2c(short i2c_id, struct i2c_board_info *devices, int nr_devices);
+ #else
+ extern void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices);
+ #endif
+  /* SPI */
+ extern void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices);
+  /* Serial */
+ #define ATMEL_UART_CTS        0x01
+ #define ATMEL_UART_RTS        0x02
+ #define ATMEL_UART_DSR        0x04
+ #define ATMEL_UART_DTR        0x08
+ #define ATMEL_UART_DCD        0x10
+ #define ATMEL_UART_RI 0x20
+ extern void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins);
+ extern struct platform_device *atmel_default_console_device;
+ extern void __init at91_add_device_serial(void);
+ /*
+  * PWM
+  */
+ #define AT91_PWM0     0
+ #define AT91_PWM1     1
+ #define AT91_PWM2     2
+ #define AT91_PWM3     3
+ extern void __init at91_add_device_pwm(u32 mask);
+ /*
+  * SSC -- accessed through ssc_request(id).  Drivers don't bind to SSC
+  * platform devices.  Their SSC ID is part of their configuration data,
+  * along with information about which SSC signals they should use.
+  */
+ #define ATMEL_SSC_TK  0x01
+ #define ATMEL_SSC_TF  0x02
+ #define ATMEL_SSC_TD  0x04
+ #define ATMEL_SSC_TX  (ATMEL_SSC_TK | ATMEL_SSC_TF | ATMEL_SSC_TD)
+ #define ATMEL_SSC_RK  0x10
+ #define ATMEL_SSC_RF  0x20
+ #define ATMEL_SSC_RD  0x40
+ #define ATMEL_SSC_RX  (ATMEL_SSC_RK | ATMEL_SSC_RF | ATMEL_SSC_RD)
+ extern void __init at91_add_device_ssc(unsigned id, unsigned pins);
+  /* LCD Controller */
+ struct atmel_lcdfb_info;
+ extern void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data);
+  /* AC97 */
+ extern void __init at91_add_device_ac97(struct ac97c_platform_data *data);
+  /* ISI */
+ struct isi_platform_data;
+ extern void __init at91_add_device_isi(struct isi_platform_data *data,
+               bool use_pck_as_mck);
+  /* Touchscreen Controller */
+ extern void __init at91_add_device_tsadcc(struct at91_tsadcc_data *data);
+ /* CAN */
+ extern void __init at91_add_device_can(struct at91_can_data *data);
+  /* LEDs */
+ extern void __init at91_gpio_leds(struct gpio_led *leds, int nr);
+ extern void __init at91_pwm_leds(struct gpio_led *leds, int nr);
+ #endif
@@@ -10,7 -10,6 +10,7 @@@
  #include <linux/mm.h>
  #include <linux/pm.h>
  #include <linux/of_address.h>
 +#include <linux/pinctrl/machine.h>
  
  #include <asm/system_misc.h>
  #include <asm/mach/map.h>
@@@ -19,8 -18,8 +19,8 @@@
  #include <mach/cpu.h>
  #include <mach/at91_dbgu.h>
  #include <mach/at91_pmc.h>
- #include <mach/at91_shdwc.h>
  
+ #include "at91_shdwc.h"
  #include "soc.h"
  #include "generic.h"
  
@@@ -339,7 -338,6 +339,7 @@@ static void at91_dt_rstc(void
  }
  
  static struct of_device_id ramc_ids[] = {
 +      { .compatible = "atmel,at91rm9200-sdramc" },
        { .compatible = "atmel,at91sam9260-sdramc" },
        { .compatible = "atmel,at91sam9g45-ddramc" },
        { /*sentinel*/ }
@@@ -438,19 -436,6 +438,19 @@@ end
        of_node_put(np);
  }
  
 +void __init at91rm9200_dt_initialize(void)
 +{
 +      at91_dt_ramc();
 +
 +      /* Init clock subsystem */
 +      at91_dt_clock_init();
 +
 +      /* Register the processor-specific clocks */
 +      at91_boot_soc.register_clocks();
 +
 +      at91_boot_soc.init();
 +}
 +
  void __init at91_dt_initialize(void)
  {
        at91_dt_rstc();
        /* Register the processor-specific clocks */
        at91_boot_soc.register_clocks();
  
 -      at91_boot_soc.init();
 +      if (at91_boot_soc.init)
 +              at91_boot_soc.init();
  }
  #endif
  
@@@ -479,6 -463,4 +479,6 @@@ void __init at91_initialize(unsigned lo
        at91_boot_soc.register_clocks();
  
        at91_boot_soc.init();
 +
 +      pinctrl_provide_dummies();
  }
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
  
- #include "common.h"
- #include <plat/gpmc.h>
- #include <plat/usb.h>
  #include <video/omapdss.h>
  #include <video/omap-panel-tfp410.h>
  #include <linux/platform_data/mtd-onenand-omap2.h>
  
+ #include "common.h"
+ #include "gpmc.h"
  #include "mux.h"
  #include "hsmmc.h"
  #include "sdram-numonyx-m65kxxxxam.h"
  #include "common-board-devices.h"
  #include "board-flash.h"
  #include "control.h"
+ #include "gpmc-onenand.h"
  
  #define IGEP2_SMSC911X_CS       5
  #define IGEP2_SMSC911X_GPIO     176
@@@ -175,7 -174,7 +174,7 @@@ static void __init igep_flash_init(void
                pr_info("IGEP: initializing NAND memory device\n");
                board_nand_init(igep_flash_partitions,
                                ARRAY_SIZE(igep_flash_partitions),
-                               0, NAND_BUSWIDTH_16);
+                               0, NAND_BUSWIDTH_16, nand_default_timings);
        } else if (mux == IGEP_SYSBOOT_ONENAND) {
                pr_info("IGEP: initializing OneNAND memory device\n");
                board_onenand_init(igep_flash_partitions,
@@@ -580,11 -579,6 +579,11 @@@ static void __init igep_wlan_bt_init(vo
        } else
                return;
  
 +      /* Make sure that the GPIO pins are muxed correctly */
 +      omap_mux_init_gpio(igep_wlan_bt_gpios[0].gpio, OMAP_PIN_OUTPUT);
 +      omap_mux_init_gpio(igep_wlan_bt_gpios[1].gpio, OMAP_PIN_OUTPUT);
 +      omap_mux_init_gpio(igep_wlan_bt_gpios[2].gpio, OMAP_PIN_OUTPUT);
 +
        err = gpio_request_array(igep_wlan_bt_gpios,
                                 ARRAY_SIZE(igep_wlan_bt_gpios));
        if (err) {
  #include <asm/mach/flash.h>
  #include <asm/mach/map.h>
  
 -#include "common.h"
  #include <video/omapdss.h>
  #include <video/omap-panel-generic-dpi.h>
  #include <video/omap-panel-tfp410.h>
- #include <plat/gpmc.h>
- #include <plat/usb.h>
  
+ #include "common.h"
  #include "mux.h"
  #include "sdram-micron-mt46h32m32lf-6.h"
+ #include "gpmc.h"
  #include "hsmmc.h"
+ #include "board-flash.h"
  #include "common-board-devices.h"
  
+ #define       NAND_CS                 0
  #define OVERO_GPIO_BT_XGATE   15
  #define OVERO_GPIO_W2W_NRESET 16
  #define OVERO_GPIO_PENDOWN    114
@@@ -494,8 -498,8 +497,8 @@@ static void __init overo_init(void
        omap_serial_init();
        omap_sdrc_init(mt46h32m32lf6_sdrc_params,
                                  mt46h32m32lf6_sdrc_params);
-       omap_nand_flash_init(0, overo_nand_partitions,
-                            ARRAY_SIZE(overo_nand_partitions));
+       board_nand_init(overo_nand_partitions,
+                       ARRAY_SIZE(overo_nand_partitions), NAND_CS, 0, NULL);
        usb_musb_init(NULL);
        usbhs_init(&usbhs_bdata);
        overo_spi_init();
@@@ -25,7 -25,6 +25,6 @@@
  #include <linux/spi/ads7846.h>
  
  #include <linux/platform_data/spi-omap2-mcspi.h>
- #include <linux/platform_data/mtd-nand-omap2.h>
  
  #include "common.h"
  #include "common-board-devices.h"
@@@ -64,36 -63,30 +63,36 @@@ void __init omap_ads7846_init(int bus_n
        struct spi_board_info *spi_bi = &ads7846_spi_board_info;
        int err;
  
 -      err = gpio_request_one(gpio_pendown, GPIOF_IN, "TSPenDown");
 -      if (err) {
 -              pr_err("Couldn't obtain gpio for TSPenDown: %d\n", err);
 -              return;
 -      }
 +      /*
 +       * If a board defines get_pendown_state() function, request the pendown
 +       * GPIO and set the GPIO debounce time.
 +       * If a board does not define the get_pendown_state() function, then
 +       * the ads7846 driver will setup the pendown GPIO itself.
 +       */
 +      if (board_pdata && board_pdata->get_pendown_state) {
 +              err = gpio_request_one(gpio_pendown, GPIOF_IN, "TSPenDown");
 +              if (err) {
 +                      pr_err("Couldn't obtain gpio for TSPenDown: %d\n", err);
 +                      return;
 +              }
 +
 +              if (gpio_debounce)
 +                      gpio_set_debounce(gpio_pendown, gpio_debounce);
  
 -      if (gpio_debounce)
 -              gpio_set_debounce(gpio_pendown, gpio_debounce);
 +              gpio_export(gpio_pendown, 0);
 +      }
  
        spi_bi->bus_num = bus_num;
        spi_bi->irq     = gpio_to_irq(gpio_pendown);
  
 +      ads7846_config.gpio_pendown = gpio_pendown;
 +
        if (board_pdata) {
                board_pdata->gpio_pendown = gpio_pendown;
 +              board_pdata->gpio_pendown_debounce = gpio_debounce;
                spi_bi->platform_data = board_pdata;
 -              if (board_pdata->get_pendown_state)
 -                      gpio_export(gpio_pendown, 0);
 -      } else {
 -              ads7846_config.gpio_pendown = gpio_pendown;
        }
  
 -      if (!board_pdata || (board_pdata && !board_pdata->get_pendown_state))
 -              gpio_free(gpio_pendown);
 -
        spi_register_board_info(&ads7846_spi_board_info, 1);
  }
  #else
@@@ -102,48 -95,3 +101,3 @@@ void __init omap_ads7846_init(int bus_n
  {
  }
  #endif
- #if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE)
- static struct omap_nand_platform_data nand_data;
- void __init omap_nand_flash_init(int options, struct mtd_partition *parts,
-                                int nr_parts)
- {
-       u8 cs = 0;
-       u8 nandcs = GPMC_CS_NUM + 1;
-       /* find out the chip-select on which NAND exists */
-       while (cs < GPMC_CS_NUM) {
-               u32 ret = 0;
-               ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
-               if ((ret & 0xC00) == 0x800) {
-                       printk(KERN_INFO "Found NAND on CS%d\n", cs);
-                       if (nandcs > GPMC_CS_NUM)
-                               nandcs = cs;
-               }
-               cs++;
-       }
-       if (nandcs > GPMC_CS_NUM) {
-               pr_info("NAND: Unable to find configuration in GPMC\n");
-               return;
-       }
-       if (nandcs < GPMC_CS_NUM) {
-               nand_data.cs = nandcs;
-               nand_data.parts = parts;
-               nand_data.nr_parts = nr_parts;
-               nand_data.devsize = options;
-               printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
-               if (gpmc_nand_init(&nand_data) < 0)
-                       printk(KERN_ERR "Unable to register NAND device\n");
-       }
- }
- #else
- void __init omap_nand_flash_init(int options, struct mtd_partition *parts,
-                                int nr_parts)
- {
- }
- #endif
  
  #include <linux/irq.h>
  #include <linux/delay.h>
+ #include <linux/i2c.h>
  #include <linux/i2c/twl.h>
+ #include <linux/i2c-omap.h>
  
  #include <asm/proc-fns.h>
  
- #include <plat/cpu.h>
- #include <plat/serial.h>
- #include <plat/common.h>
+ #include "i2c.h"
+ #include "serial.h"
+ #include "usb.h"
  
  #define OMAP_INTC_START               NR_IRQS
  
@@@ -275,9 -278,6 +278,9 @@@ static inline void __iomem *omap4_get_s
  #endif
  
  extern void __init gic_init_irq(void);
 +extern void gic_dist_disable(void);
 +extern bool gic_dist_disabled(void);
 +extern void gic_timer_retrigger(void);
  extern void omap_smc1(u32 fn, u32 arg);
  extern void __iomem *omap4_get_sar_ram_base(void);
  extern void omap_do_wfi(void);
  #ifdef CONFIG_SMP
  /* Needed for secondary core boot */
  extern void omap_secondary_startup(void);
 +extern void omap_secondary_startup_4460(void);
  extern u32 omap_modify_auxcoreboot0(u32 set_mask, u32 clear_mask);
  extern void omap_auxcoreboot_addr(u32 cpu_addr);
  extern u32 omap_read_auxcoreboot0(void);
@@@ -342,6 -341,10 +345,10 @@@ extern void omap_sdrc_init(struct omap_
                                      struct omap_sdrc_params *sdrc_cs1);
  struct omap2_hsmmc_info;
  extern int omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers);
+ extern void omap_reserve(void);
+ struct omap_hwmod;
+ extern int omap_dss_reset(struct omap_hwmod *);
  
  #endif /* __ASSEMBLER__ */
  #endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */
  #include <linux/of.h>
  #include <linux/pinctrl/machine.h>
  #include <linux/platform_data/omap4-keypad.h>
 +#include <linux/platform_data/omap_ocp2scp.h>
  
  #include <asm/mach-types.h>
  #include <asm/mach/map.h>
  
+ #include <plat-omap/dma-omap.h>
  #include "iomap.h"
- #include <plat/dma.h>
- #include <plat/omap_hwmod.h>
- #include <plat/omap_device.h>
+ #include "omap_hwmod.h"
+ #include "omap_device.h"
  #include "omap4-keypad.h"
  
  #include "soc.h"
@@@ -35,6 -35,7 +36,7 @@@
  #include "mux.h"
  #include "control.h"
  #include "devices.h"
+ #include "dma.h"
  
  #define L3_MODULES_MAX_LEN 12
  #define L3_MODULES 3
@@@ -127,7 -128,7 +129,7 @@@ static struct platform_device omap2cam_
  
  #if defined(CONFIG_IOMMU_API)
  
- #include <plat/iommu.h>
+ #include <linux/platform_data/iommu-omap.h>
  
  static struct resource omap3isp_resources[] = {
        {
@@@ -614,83 -615,6 +616,83 @@@ static void omap_init_vout(void
  static inline void omap_init_vout(void) {}
  #endif
  
 +#if defined(CONFIG_OMAP_OCP2SCP) || defined(CONFIG_OMAP_OCP2SCP_MODULE)
 +static int count_ocp2scp_devices(struct omap_ocp2scp_dev *ocp2scp_dev)
 +{
 +      int cnt = 0;
 +
 +      while (ocp2scp_dev->drv_name != NULL) {
 +              cnt++;
 +              ocp2scp_dev++;
 +      }
 +
 +      return cnt;
 +}
 +
 +static void omap_init_ocp2scp(void)
 +{
 +      struct omap_hwmod       *oh;
 +      struct platform_device  *pdev;
 +      int                     bus_id = -1, dev_cnt = 0, i;
 +      struct omap_ocp2scp_dev *ocp2scp_dev;
 +      const char              *oh_name, *name;
 +      struct omap_ocp2scp_platform_data *pdata;
 +
 +      if (!cpu_is_omap44xx())
 +              return;
 +
 +      oh_name = "ocp2scp_usb_phy";
 +      name    = "omap-ocp2scp";
 +
 +      oh = omap_hwmod_lookup(oh_name);
 +      if (!oh) {
 +              pr_err("%s: could not find omap_hwmod for %s\n", __func__,
 +                                                              oh_name);
 +              return;
 +      }
 +
 +      pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
 +      if (!pdata) {
 +              pr_err("%s: No memory for ocp2scp pdata\n", __func__);
 +              return;
 +      }
 +
 +      ocp2scp_dev = oh->dev_attr;
 +      dev_cnt = count_ocp2scp_devices(ocp2scp_dev);
 +
 +      if (!dev_cnt) {
 +              pr_err("%s: No devices connected to ocp2scp\n", __func__);
 +              kfree(pdata);
 +              return;
 +      }
 +
 +      pdata->devices = kzalloc(sizeof(struct omap_ocp2scp_dev *)
 +                                      * dev_cnt, GFP_KERNEL);
 +      if (!pdata->devices) {
 +              pr_err("%s: No memory for ocp2scp pdata devices\n", __func__);
 +              kfree(pdata);
 +              return;
 +      }
 +
 +      for (i = 0; i < dev_cnt; i++, ocp2scp_dev++)
 +              pdata->devices[i] = ocp2scp_dev;
 +
 +      pdata->dev_cnt  = dev_cnt;
 +
 +      pdev = omap_device_build(name, bus_id, oh, pdata, sizeof(*pdata), NULL,
 +                                                              0, false);
 +      if (IS_ERR(pdev)) {
 +              pr_err("Could not build omap_device for %s %s\n",
 +                                              name, oh_name);
 +              kfree(pdata->devices);
 +              kfree(pdata);
 +              return;
 +      }
 +}
 +#else
 +static inline void omap_init_ocp2scp(void) { }
 +#endif
 +
  /*-------------------------------------------------------------------------*/
  
  static int __init omap2_init_devices(void)
        omap_init_sham();
        omap_init_aes();
        omap_init_vout();
 +      omap_init_ocp2scp();
  
        return 0;
  }
  #include <linux/init.h>
  #include <linux/platform_device.h>
  #include <linux/dma-mapping.h>
 +#include <linux/platform_data/omap_drm.h>
  
- #include <plat/omap_device.h>
- #include <plat/omap_hwmod.h>
+ #include "omap_device.h"
+ #include "omap_hwmod.h"
 +#include <plat/cpu.h>
  
  #if defined(CONFIG_DRM_OMAP) || (CONFIG_DRM_OMAP_MODULE)
  
 +static struct omap_drm_platform_data platform_data;
 +
  static struct platform_device omap_drm_device = {
        .dev = {
                .coherent_dma_mask = DMA_BIT_MASK(32),
 +              .platform_data = &platform_data,
        },
        .name = "omapdrm",
        .id = 0,
@@@ -57,8 -52,6 +57,8 @@@ static int __init omap_init_drm(void
                        oh->name);
        }
  
 +      platform_data.omaprev = GET_OMAP_REVISION();
 +
        return platform_device_register(&omap_drm_device);
  
  }
@@@ -50,6 -50,7 +50,7 @@@
  #include <asm/suspend.h>
  #include <asm/hardware/cache-l2x0.h>
  
+ #include "soc.h"
  #include "common.h"
  #include "omap44xx.h"
  #include "omap4-sar-layout.h"
@@@ -67,7 -68,6 +68,7 @@@ struct omap4_cpu_pm_info 
        void __iomem *scu_sar_addr;
        void __iomem *wkup_sar_addr;
        void __iomem *l2x0_sar_addr;
 +      void (*secondary_startup)(void);
  };
  
  static DEFINE_PER_CPU(struct omap4_cpu_pm_info, omap4_pm_info);
@@@ -300,7 -300,6 +301,7 @@@ int omap4_enter_lowpower(unsigned int c
  int __cpuinit omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state)
  {
        unsigned int cpu_state = 0;
 +      struct omap4_cpu_pm_info *pm_info = &per_cpu(omap4_pm_info, cpu);
  
        if (omap_rev() == OMAP4430_REV_ES1_0)
                return -ENXIO;
  
        clear_cpu_prev_pwrst(cpu);
        set_cpu_next_pwrst(cpu, power_state);
 -      set_cpu_wakeup_addr(cpu, virt_to_phys(omap_secondary_startup));
 +      set_cpu_wakeup_addr(cpu, virt_to_phys(pm_info->secondary_startup));
        scu_pwrst_prepare(cpu, power_state);
  
        /*
@@@ -361,11 -360,6 +362,11 @@@ int __init omap4_mpuss_init(void
        pm_info->scu_sar_addr = sar_base + SCU_OFFSET1;
        pm_info->wkup_sar_addr = sar_base + CPU1_WAKEUP_NS_PA_ADDR_OFFSET;
        pm_info->l2x0_sar_addr = sar_base + L2X0_SAVE_OFFSET1;
 +      if (cpu_is_omap446x())
 +              pm_info->secondary_startup = omap_secondary_startup_4460;
 +      else
 +              pm_info->secondary_startup = omap_secondary_startup;
 +
        pm_info->pwrdm = pwrdm_lookup("cpu1_pwrdm");
        if (!pm_info->pwrdm) {
                pr_err("Lookup failed for CPU1 pwrdm\n");
@@@ -14,7 -14,6 +14,7 @@@
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/io.h>
 +#include <linux/irq.h>
  #include <linux/platform_device.h>
  #include <linux/memblock.h>
  #include <linux/of_irq.h>
  #include <asm/hardware/cache-l2x0.h>
  #include <asm/mach/map.h>
  #include <asm/memblock.h>
 +#include <asm/smp_twd.h>
  
- #include <plat/sram.h>
- #include <plat/omap-secure.h>
- #include <plat/mmc.h>
  #include "omap-wakeupgen.h"
  #include "soc.h"
  #include "common.h"
+ #include "mmc.h"
  #include "hsmmc.h"
  #include "omap4-sar-layout.h"
+ #include "omap-secure.h"
+ #include "sram.h"
  
  #ifdef CONFIG_CACHE_L2X0
  static void __iomem *l2cache_base;
  #endif
  
  static void __iomem *sar_ram_base;
 +static void __iomem *gic_dist_base_addr;
 +static void __iomem *twd_base;
 +
 +#define IRQ_LOCALTIMER                29
  
  #ifdef CONFIG_OMAP4_ERRATA_I688
  /* Used to implement memory barrier on DRAM path */
@@@ -101,14 -93,12 +99,14 @@@ void __init omap_barriers_init(void
  void __init gic_init_irq(void)
  {
        void __iomem *omap_irq_base;
 -      void __iomem *gic_dist_base_addr;
  
        /* Static mapping, never released */
        gic_dist_base_addr = ioremap(OMAP44XX_GIC_DIST_BASE, SZ_4K);
        BUG_ON(!gic_dist_base_addr);
  
 +      twd_base = ioremap(OMAP44XX_LOCAL_TWD_BASE, SZ_4K);
 +      BUG_ON(!twd_base);
 +
        /* Static mapping, never released */
        omap_irq_base = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_512);
        BUG_ON(!omap_irq_base);
        gic_init(0, 29, gic_dist_base_addr, omap_irq_base);
  }
  
 +void gic_dist_disable(void)
 +{
 +      if (gic_dist_base_addr)
 +              __raw_writel(0x0, gic_dist_base_addr + GIC_DIST_CTRL);
 +}
 +
 +bool gic_dist_disabled(void)
 +{
 +      return !(__raw_readl(gic_dist_base_addr + GIC_DIST_CTRL) & 0x1);
 +}
 +
 +void gic_timer_retrigger(void)
 +{
 +      u32 twd_int = __raw_readl(twd_base + TWD_TIMER_INTSTAT);
 +      u32 gic_int = __raw_readl(gic_dist_base_addr + GIC_DIST_PENDING_SET);
 +      u32 twd_ctrl = __raw_readl(twd_base + TWD_TIMER_CONTROL);
 +
 +      if (twd_int && !(gic_int & BIT(IRQ_LOCALTIMER))) {
 +              /*
 +               * The local timer interrupt got lost while the distributor was
 +               * disabled.  Ack the pending interrupt, and retrigger it.
 +               */
 +              pr_warn("%s: lost localtimer interrupt\n", __func__);
 +              __raw_writel(1, twd_base + TWD_TIMER_INTSTAT);
 +              if (!(twd_ctrl & TWD_TIMER_CONTROL_PERIODIC)) {
 +                      __raw_writel(1, twd_base + TWD_TIMER_COUNTER);
 +                      twd_ctrl |= TWD_TIMER_CONTROL_ENABLE;
 +                      __raw_writel(twd_ctrl, twd_base + TWD_TIMER_CONTROL);
 +              }
 +      }
 +}
 +
  #ifdef CONFIG_CACHE_L2X0
  
  void __iomem *omap4_get_l2cache_base(void)
  #include <linux/slab.h>
  #include <linux/bootmem.h>
  
- #include <plat/clock.h>
- #include <plat/omap_hwmod.h>
+ #include "clock.h"
+ #include "omap_hwmod.h"
  #include <plat/prcm.h>
  
  #include "soc.h"
  #include "common.h"
  #include "clockdomain.h"
  #include "powerdomain.h"
- #include "cm2xxx_3xxx.h"
+ #include "cm2xxx.h"
+ #include "cm3xxx.h"
  #include "cminst44xx.h"
  #include "cm33xx.h"
- #include "prm2xxx_3xxx.h"
+ #include "prm3xxx.h"
  #include "prm44xx.h"
  #include "prm33xx.h"
  #include "prminst44xx.h"
@@@ -421,38 -422,6 +422,38 @@@ static int _set_softreset(struct omap_h
        return 0;
  }
  
 +/**
 + * _wait_softreset_complete - wait for an OCP softreset to complete
 + * @oh: struct omap_hwmod * to wait on
 + *
 + * Wait until the IP block represented by @oh reports that its OCP
 + * softreset is complete.  This can be triggered by software (see
 + * _ocp_softreset()) or by hardware upon returning from off-mode (one
 + * example is HSMMC).  Waits for up to MAX_MODULE_SOFTRESET_WAIT
 + * microseconds.  Returns the number of microseconds waited.
 + */
 +static int _wait_softreset_complete(struct omap_hwmod *oh)
 +{
 +      struct omap_hwmod_class_sysconfig *sysc;
 +      u32 softrst_mask;
 +      int c = 0;
 +
 +      sysc = oh->class->sysc;
 +
 +      if (sysc->sysc_flags & SYSS_HAS_RESET_STATUS)
 +              omap_test_timeout((omap_hwmod_read(oh, sysc->syss_offs)
 +                                 & SYSS_RESETDONE_MASK),
 +                                MAX_MODULE_SOFTRESET_WAIT, c);
 +      else if (sysc->sysc_flags & SYSC_HAS_RESET_STATUS) {
 +              softrst_mask = (0x1 << sysc->sysc_fields->srst_shift);
 +              omap_test_timeout(!(omap_hwmod_read(oh, sysc->sysc_offs)
 +                                  & softrst_mask),
 +                                MAX_MODULE_SOFTRESET_WAIT, c);
 +      }
 +
 +      return c;
 +}
 +
  /**
   * _set_dmadisable: set OCP_SYSCONFIG.DMADISABLE bit in @v
   * @oh: struct omap_hwmod *
@@@ -1314,18 -1283,6 +1315,18 @@@ static void _enable_sysc(struct omap_hw
        if (!oh->class->sysc)
                return;
  
 +      /*
 +       * Wait until reset has completed, this is needed as the IP
 +       * block is reset automatically by hardware in some cases
 +       * (off-mode for example), and the drivers require the
 +       * IP to be ready when they access it
 +       */
 +      if (oh->flags & HWMOD_CONTROL_OPT_CLKS_IN_RESET)
 +              _enable_optional_clocks(oh);
 +      _wait_softreset_complete(oh);
 +      if (oh->flags & HWMOD_CONTROL_OPT_CLKS_IN_RESET)
 +              _disable_optional_clocks(oh);
 +
        v = oh->_sysc_cache;
        sf = oh->class->sysc->sysc_flags;
  
@@@ -1848,7 -1805,7 +1849,7 @@@ static int _am33xx_disable_module(struc
   */
  static int _ocp_softreset(struct omap_hwmod *oh)
  {
 -      u32 v, softrst_mask;
 +      u32 v;
        int c = 0;
        int ret = 0;
  
        if (oh->class->sysc->srst_udelay)
                udelay(oh->class->sysc->srst_udelay);
  
 -      if (oh->class->sysc->sysc_flags & SYSS_HAS_RESET_STATUS)
 -              omap_test_timeout((omap_hwmod_read(oh,
 -                                                  oh->class->sysc->syss_offs)
 -                                 & SYSS_RESETDONE_MASK),
 -                                MAX_MODULE_SOFTRESET_WAIT, c);
 -      else if (oh->class->sysc->sysc_flags & SYSC_HAS_RESET_STATUS) {
 -              softrst_mask = (0x1 << oh->class->sysc->sysc_fields->srst_shift);
 -              omap_test_timeout(!(omap_hwmod_read(oh,
 -                                                   oh->class->sysc->sysc_offs)
 -                                 & softrst_mask),
 -                                MAX_MODULE_SOFTRESET_WAIT, c);
 -      }
 -
 +      c = _wait_softreset_complete(oh);
        if (c == MAX_MODULE_SOFTRESET_WAIT)
                pr_warning("omap_hwmod: %s: softreset failed (waited %d usec)\n",
                           oh->name, MAX_MODULE_SOFTRESET_WAIT);
@@@ -2384,9 -2353,6 +2385,9 @@@ static int __init _setup_reset(struct o
        if (oh->_state != _HWMOD_STATE_INITIALIZED)
                return -EINVAL;
  
 +      if (oh->flags & HWMOD_EXT_OPT_MAIN_CLK)
 +              return -EPERM;
 +
        if (oh->rst_lines_cnt == 0) {
                r = _enable(oh);
                if (r) {
@@@ -2703,7 -2669,7 +2704,7 @@@ static int __init _alloc_linkspace(stru
  /* Static functions intended only for use in soc_ops field function pointers */
  
  /**
-  * _omap2_wait_target_ready - wait for a module to leave slave idle
+  * _omap2xxx_wait_target_ready - wait for a module to leave slave idle
   * @oh: struct omap_hwmod *
   *
   * Wait for a module @oh to leave slave idle.  Returns 0 if the module
   * slave idle; otherwise, pass along the return value of the
   * appropriate *_cm*_wait_module_ready() function.
   */
- static int _omap2_wait_target_ready(struct omap_hwmod *oh)
+ static int _omap2xxx_wait_target_ready(struct omap_hwmod *oh)
  {
        if (!oh)
                return -EINVAL;
  
        /* XXX check module SIDLEMODE, hardreset status, enabled clocks */
  
-       return omap2_cm_wait_module_ready(oh->prcm.omap2.module_offs,
-                                         oh->prcm.omap2.idlest_reg_id,
-                                         oh->prcm.omap2.idlest_idle_bit);
+       return omap2xxx_cm_wait_module_ready(oh->prcm.omap2.module_offs,
+                                            oh->prcm.omap2.idlest_reg_id,
+                                            oh->prcm.omap2.idlest_idle_bit);
+ }
+ /**
+  * _omap3xxx_wait_target_ready - wait for a module to leave slave idle
+  * @oh: struct omap_hwmod *
+  *
+  * Wait for a module @oh to leave slave idle.  Returns 0 if the module
+  * does not have an IDLEST bit or if the module successfully leaves
+  * slave idle; otherwise, pass along the return value of the
+  * appropriate *_cm*_wait_module_ready() function.
+  */
+ static int _omap3xxx_wait_target_ready(struct omap_hwmod *oh)
+ {
+       if (!oh)
+               return -EINVAL;
+       if (oh->flags & HWMOD_NO_IDLEST)
+               return 0;
+       if (!_find_mpu_rt_port(oh))
+               return 0;
+       /* XXX check module SIDLEMODE, hardreset status, enabled clocks */
+       return omap3xxx_cm_wait_module_ready(oh->prcm.omap2.module_offs,
+                                            oh->prcm.omap2.idlest_reg_id,
+                                            oh->prcm.omap2.idlest_idle_bit);
  }
  
  /**
@@@ -3994,8 -3987,13 +4022,13 @@@ int omap_hwmod_pad_route_irq(struct oma
   */
  void __init omap_hwmod_init(void)
  {
-       if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
-               soc_ops.wait_target_ready = _omap2_wait_target_ready;
+       if (cpu_is_omap24xx()) {
+               soc_ops.wait_target_ready = _omap2xxx_wait_target_ready;
+               soc_ops.assert_hardreset = _omap2_assert_hardreset;
+               soc_ops.deassert_hardreset = _omap2_deassert_hardreset;
+               soc_ops.is_hardreset_asserted = _omap2_is_hardreset_asserted;
+       } else if (cpu_is_omap34xx()) {
+               soc_ops.wait_target_ready = _omap3xxx_wait_target_ready;
                soc_ops.assert_hardreset = _omap2_assert_hardreset;
                soc_ops.deassert_hardreset = _omap2_deassert_hardreset;
                soc_ops.is_hardreset_asserted = _omap2_is_hardreset_asserted;
index 0000000,87b59b4..87a3c5b
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,675 +1,681 @@@
+ /*
+  * omap_hwmod macros, structures
+  *
+  * Copyright (C) 2009-2011 Nokia Corporation
+  * Copyright (C) 2012 Texas Instruments, Inc.
+  * Paul Walmsley
+  *
+  * Created in collaboration with (alphabetical order): Benoît Cousson,
+  * Kevin Hilman, Tony Lindgren, Rajendra Nayak, Vikram Pandita, Sakari
+  * Poussa, Anand Sawant, Santosh Shilimkar, Richard Woodruff
+  *
+  * This program is free software; you can redistribute it and/or modify
+  * it under the terms of the GNU General Public License version 2 as
+  * published by the Free Software Foundation.
+  *
+  * These headers and macros are used to define OMAP on-chip module
+  * data and their integration with other OMAP modules and Linux.
+  * Copious documentation and references can also be found in the
+  * omap_hwmod code, in arch/arm/mach-omap2/omap_hwmod.c (as of this
+  * writing).
+  *
+  * To do:
+  * - add interconnect error log structures
+  * - add pinmuxing
+  * - init_conn_id_bit (CONNID_BIT_VECTOR)
+  * - implement default hwmod SMS/SDRC flags?
+  * - move Linux-specific data ("non-ROM data") out
+  *
+  */
+ #ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD_H
+ #define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD_H
+ #include <linux/kernel.h>
+ #include <linux/init.h>
+ #include <linux/list.h>
+ #include <linux/ioport.h>
+ #include <linux/spinlock.h>
+ struct omap_device;
+ extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type1;
+ extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type2;
+ extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type3;
+ /*
+  * OCP SYSCONFIG bit shifts/masks TYPE1. These are for IPs compliant
+  * with the original PRCM protocol defined for OMAP2420
+  */
+ #define SYSC_TYPE1_MIDLEMODE_SHIFT    12
+ #define SYSC_TYPE1_MIDLEMODE_MASK     (0x3 << SYSC_TYPE1_MIDLEMODE_SHIFT)
+ #define SYSC_TYPE1_CLOCKACTIVITY_SHIFT        8
+ #define SYSC_TYPE1_CLOCKACTIVITY_MASK (0x3 << SYSC_TYPE1_CLOCKACTIVITY_SHIFT)
+ #define SYSC_TYPE1_SIDLEMODE_SHIFT    3
+ #define SYSC_TYPE1_SIDLEMODE_MASK     (0x3 << SYSC_TYPE1_SIDLEMODE_SHIFT)
+ #define SYSC_TYPE1_ENAWAKEUP_SHIFT    2
+ #define SYSC_TYPE1_ENAWAKEUP_MASK     (1 << SYSC_TYPE1_ENAWAKEUP_SHIFT)
+ #define SYSC_TYPE1_SOFTRESET_SHIFT    1
+ #define SYSC_TYPE1_SOFTRESET_MASK     (1 << SYSC_TYPE1_SOFTRESET_SHIFT)
+ #define SYSC_TYPE1_AUTOIDLE_SHIFT     0
+ #define SYSC_TYPE1_AUTOIDLE_MASK      (1 << SYSC_TYPE1_AUTOIDLE_SHIFT)
+ /*
+  * OCP SYSCONFIG bit shifts/masks TYPE2. These are for IPs compliant
+  * with the new PRCM protocol defined for new OMAP4 IPs.
+  */
+ #define SYSC_TYPE2_SOFTRESET_SHIFT    0
+ #define SYSC_TYPE2_SOFTRESET_MASK     (1 << SYSC_TYPE2_SOFTRESET_SHIFT)
+ #define SYSC_TYPE2_SIDLEMODE_SHIFT    2
+ #define SYSC_TYPE2_SIDLEMODE_MASK     (0x3 << SYSC_TYPE2_SIDLEMODE_SHIFT)
+ #define SYSC_TYPE2_MIDLEMODE_SHIFT    4
+ #define SYSC_TYPE2_MIDLEMODE_MASK     (0x3 << SYSC_TYPE2_MIDLEMODE_SHIFT)
+ #define SYSC_TYPE2_DMADISABLE_SHIFT   16
+ #define SYSC_TYPE2_DMADISABLE_MASK    (0x1 << SYSC_TYPE2_DMADISABLE_SHIFT)
+ /*
+  * OCP SYSCONFIG bit shifts/masks TYPE3.
+  * This is applicable for some IPs present in AM33XX
+  */
+ #define SYSC_TYPE3_SIDLEMODE_SHIFT    0
+ #define SYSC_TYPE3_SIDLEMODE_MASK     (0x3 << SYSC_TYPE3_SIDLEMODE_SHIFT)
+ #define SYSC_TYPE3_MIDLEMODE_SHIFT    2
+ #define SYSC_TYPE3_MIDLEMODE_MASK     (0x3 << SYSC_TYPE3_MIDLEMODE_SHIFT)
+ /* OCP SYSSTATUS bit shifts/masks */
+ #define SYSS_RESETDONE_SHIFT          0
+ #define SYSS_RESETDONE_MASK           (1 << SYSS_RESETDONE_SHIFT)
+ /* Master standby/slave idle mode flags */
+ #define HWMOD_IDLEMODE_FORCE          (1 << 0)
+ #define HWMOD_IDLEMODE_NO             (1 << 1)
+ #define HWMOD_IDLEMODE_SMART          (1 << 2)
+ #define HWMOD_IDLEMODE_SMART_WKUP     (1 << 3)
+ /* modulemode control type (SW or HW) */
+ #define MODULEMODE_HWCTRL             1
+ #define MODULEMODE_SWCTRL             2
+ /**
+  * struct omap_hwmod_mux_info - hwmod specific mux configuration
+  * @pads:              array of omap_device_pad entries
+  * @nr_pads:           number of omap_device_pad entries
+  *
+  * Note that this is currently built during init as needed.
+  */
+ struct omap_hwmod_mux_info {
+       int                             nr_pads;
+       struct omap_device_pad          *pads;
+       int                             nr_pads_dynamic;
+       struct omap_device_pad          **pads_dynamic;
+       int                             *irqs;
+       bool                            enabled;
+ };
+ /**
+  * struct omap_hwmod_irq_info - MPU IRQs used by the hwmod
+  * @name: name of the IRQ channel (module local name)
+  * @irq: IRQ channel ID (should be non-negative except -1 = terminator)
+  *
+  * @name should be something short, e.g., "tx" or "rx".  It is for use
+  * by platform_get_resource_byname().  It is defined locally to the
+  * hwmod.
+  */
+ struct omap_hwmod_irq_info {
+       const char      *name;
+       s16             irq;
+ };
+ /**
+  * struct omap_hwmod_dma_info - DMA channels used by the hwmod
+  * @name: name of the DMA channel (module local name)
+  * @dma_req: DMA request ID (should be non-negative except -1 = terminator)
+  *
+  * @name should be something short, e.g., "tx" or "rx".  It is for use
+  * by platform_get_resource_byname().  It is defined locally to the
+  * hwmod.
+  */
+ struct omap_hwmod_dma_info {
+       const char      *name;
+       s16             dma_req;
+ };
+ /**
+  * struct omap_hwmod_rst_info - IPs reset lines use by hwmod
+  * @name: name of the reset line (module local name)
+  * @rst_shift: Offset of the reset bit
+  * @st_shift: Offset of the reset status bit (OMAP2/3 only)
+  *
+  * @name should be something short, e.g., "cpu0" or "rst". It is defined
+  * locally to the hwmod.
+  */
+ struct omap_hwmod_rst_info {
+       const char      *name;
+       u8              rst_shift;
+       u8              st_shift;
+ };
+ /**
+  * struct omap_hwmod_opt_clk - optional clocks used by this hwmod
+  * @role: "sys", "32k", "tv", etc -- for use in clk_get()
+  * @clk: opt clock: OMAP clock name
+  * @_clk: pointer to the struct clk (filled in at runtime)
+  *
+  * The module's interface clock and main functional clock should not
+  * be added as optional clocks.
+  */
+ struct omap_hwmod_opt_clk {
+       const char      *role;
+       const char      *clk;
+       struct clk      *_clk;
+ };
+ /* omap_hwmod_omap2_firewall.flags bits */
+ #define OMAP_FIREWALL_L3              (1 << 0)
+ #define OMAP_FIREWALL_L4              (1 << 1)
+ /**
+  * struct omap_hwmod_omap2_firewall - OMAP2/3 device firewall data
+  * @l3_perm_bit: bit shift for L3_PM_*_PERMISSION_*
+  * @l4_fw_region: L4 firewall region ID
+  * @l4_prot_group: L4 protection group ID
+  * @flags: (see omap_hwmod_omap2_firewall.flags macros above)
+  */
+ struct omap_hwmod_omap2_firewall {
+       u8 l3_perm_bit;
+       u8 l4_fw_region;
+       u8 l4_prot_group;
+       u8 flags;
+ };
+ /*
+  * omap_hwmod_addr_space.flags bits
+  *
+  * ADDR_MAP_ON_INIT: Map this address space during omap_hwmod init.
+  * ADDR_TYPE_RT: Address space contains module register target data.
+  */
+ #define ADDR_MAP_ON_INIT      (1 << 0)        /* XXX does not belong */
+ #define ADDR_TYPE_RT          (1 << 1)
+ /**
+  * struct omap_hwmod_addr_space - address space handled by the hwmod
+  * @name: name of the address space
+  * @pa_start: starting physical address
+  * @pa_end: ending physical address
+  * @flags: (see omap_hwmod_addr_space.flags macros above)
+  *
+  * Address space doesn't necessarily follow physical interconnect
+  * structure.  GPMC is one example.
+  */
+ struct omap_hwmod_addr_space {
+       const char *name;
+       u32 pa_start;
+       u32 pa_end;
+       u8 flags;
+ };
+ /*
+  * omap_hwmod_ocp_if.user bits: these indicate the initiators that use this
+  * interface to interact with the hwmod.  Used to add sleep dependencies
+  * when the module is enabled or disabled.
+  */
+ #define OCP_USER_MPU                  (1 << 0)
+ #define OCP_USER_SDMA                 (1 << 1)
+ #define OCP_USER_DSP                  (1 << 2)
+ #define OCP_USER_IVA                  (1 << 3)
+ /* omap_hwmod_ocp_if.flags bits */
+ #define OCPIF_SWSUP_IDLE              (1 << 0)
+ #define OCPIF_CAN_BURST                       (1 << 1)
+ /* omap_hwmod_ocp_if._int_flags possibilities */
+ #define _OCPIF_INT_FLAGS_REGISTERED   (1 << 0)
+ /**
+  * struct omap_hwmod_ocp_if - OCP interface data
+  * @master: struct omap_hwmod that initiates OCP transactions on this link
+  * @slave: struct omap_hwmod that responds to OCP transactions on this link
+  * @addr: address space associated with this link
+  * @clk: interface clock: OMAP clock name
+  * @_clk: pointer to the interface struct clk (filled in at runtime)
+  * @fw: interface firewall data
+  * @width: OCP data width
+  * @user: initiators using this interface (see OCP_USER_* macros above)
+  * @flags: OCP interface flags (see OCPIF_* macros above)
+  * @_int_flags: internal flags (see _OCPIF_INT_FLAGS* macros above)
+  *
+  * It may also be useful to add a tag_cnt field for OCP2.x devices.
+  *
+  * Parameter names beginning with an underscore are managed internally by
+  * the omap_hwmod code and should not be set during initialization.
+  */
+ struct omap_hwmod_ocp_if {
+       struct omap_hwmod               *master;
+       struct omap_hwmod               *slave;
+       struct omap_hwmod_addr_space    *addr;
+       const char                      *clk;
+       struct clk                      *_clk;
+       union {
+               struct omap_hwmod_omap2_firewall omap2;
+       }                               fw;
+       u8                              width;
+       u8                              user;
+       u8                              flags;
+       u8                              _int_flags;
+ };
+ /* Macros for use in struct omap_hwmod_sysconfig */
+ /* Flags for use in omap_hwmod_sysconfig.idlemodes */
+ #define MASTER_STANDBY_SHIFT  4
+ #define SLAVE_IDLE_SHIFT      0
+ #define SIDLE_FORCE           (HWMOD_IDLEMODE_FORCE << SLAVE_IDLE_SHIFT)
+ #define SIDLE_NO              (HWMOD_IDLEMODE_NO << SLAVE_IDLE_SHIFT)
+ #define SIDLE_SMART           (HWMOD_IDLEMODE_SMART << SLAVE_IDLE_SHIFT)
+ #define SIDLE_SMART_WKUP      (HWMOD_IDLEMODE_SMART_WKUP << SLAVE_IDLE_SHIFT)
+ #define MSTANDBY_FORCE                (HWMOD_IDLEMODE_FORCE << MASTER_STANDBY_SHIFT)
+ #define MSTANDBY_NO           (HWMOD_IDLEMODE_NO << MASTER_STANDBY_SHIFT)
+ #define MSTANDBY_SMART                (HWMOD_IDLEMODE_SMART << MASTER_STANDBY_SHIFT)
+ #define MSTANDBY_SMART_WKUP   (HWMOD_IDLEMODE_SMART_WKUP << MASTER_STANDBY_SHIFT)
+ /* omap_hwmod_sysconfig.sysc_flags capability flags */
+ #define SYSC_HAS_AUTOIDLE     (1 << 0)
+ #define SYSC_HAS_SOFTRESET    (1 << 1)
+ #define SYSC_HAS_ENAWAKEUP    (1 << 2)
+ #define SYSC_HAS_EMUFREE      (1 << 3)
+ #define SYSC_HAS_CLOCKACTIVITY        (1 << 4)
+ #define SYSC_HAS_SIDLEMODE    (1 << 5)
+ #define SYSC_HAS_MIDLEMODE    (1 << 6)
+ #define SYSS_HAS_RESET_STATUS (1 << 7)
+ #define SYSC_NO_CACHE         (1 << 8)  /* XXX SW flag, belongs elsewhere */
+ #define SYSC_HAS_RESET_STATUS (1 << 9)
+ #define SYSC_HAS_DMADISABLE   (1 << 10)
+ /* omap_hwmod_sysconfig.clockact flags */
+ #define CLOCKACT_TEST_BOTH    0x0
+ #define CLOCKACT_TEST_MAIN    0x1
+ #define CLOCKACT_TEST_ICLK    0x2
+ #define CLOCKACT_TEST_NONE    0x3
+ /**
+  * struct omap_hwmod_sysc_fields - hwmod OCP_SYSCONFIG register field offsets.
+  * @midle_shift: Offset of the midle bit
+  * @clkact_shift: Offset of the clockactivity bit
+  * @sidle_shift: Offset of the sidle bit
+  * @enwkup_shift: Offset of the enawakeup bit
+  * @srst_shift: Offset of the softreset bit
+  * @autoidle_shift: Offset of the autoidle bit
+  * @dmadisable_shift: Offset of the dmadisable bit
+  */
+ struct omap_hwmod_sysc_fields {
+       u8 midle_shift;
+       u8 clkact_shift;
+       u8 sidle_shift;
+       u8 enwkup_shift;
+       u8 srst_shift;
+       u8 autoidle_shift;
+       u8 dmadisable_shift;
+ };
+ /**
+  * struct omap_hwmod_class_sysconfig - hwmod class OCP_SYS* data
+  * @rev_offs: IP block revision register offset (from module base addr)
+  * @sysc_offs: OCP_SYSCONFIG register offset (from module base addr)
+  * @syss_offs: OCP_SYSSTATUS register offset (from module base addr)
+  * @srst_udelay: Delay needed after doing a softreset in usecs
+  * @idlemodes: One or more of {SIDLE,MSTANDBY}_{OFF,FORCE,SMART}
+  * @sysc_flags: SYS{C,S}_HAS* flags indicating SYSCONFIG bits supported
+  * @clockact: the default value of the module CLOCKACTIVITY bits
+  *
+  * @clockact describes to the module which clocks are likely to be
+  * disabled when the PRCM issues its idle request to the module.  Some
+  * modules have separate clockdomains for the interface clock and main
+  * functional clock, and can check whether they should acknowledge the
+  * idle request based on the internal module functionality that has
+  * been associated with the clocks marked in @clockact.  This field is
+  * only used if HWMOD_SET_DEFAULT_CLOCKACT is set (see below)
+  *
+  * @sysc_fields: structure containing the offset positions of various bits in
+  * SYSCONFIG register. This can be populated using omap_hwmod_sysc_type1 or
+  * omap_hwmod_sysc_type2 defined in omap_hwmod_common_data.c depending on
+  * whether the device ip is compliant with the original PRCM protocol
+  * defined for OMAP2420 or the new PRCM protocol for new OMAP4 IPs.
+  * If the device follows a different scheme for the sysconfig register ,
+  * then this field has to be populated with the correct offset structure.
+  */
+ struct omap_hwmod_class_sysconfig {
+       u32 rev_offs;
+       u32 sysc_offs;
+       u32 syss_offs;
+       u16 sysc_flags;
+       struct omap_hwmod_sysc_fields *sysc_fields;
+       u8 srst_udelay;
+       u8 idlemodes;
+       u8 clockact;
+ };
+ /**
+  * struct omap_hwmod_omap2_prcm - OMAP2/3-specific PRCM data
+  * @module_offs: PRCM submodule offset from the start of the PRM/CM
+  * @prcm_reg_id: PRCM register ID (e.g., 3 for CM_AUTOIDLE3)
+  * @module_bit: register bit shift for AUTOIDLE, WKST, WKEN, GRPSEL regs
+  * @idlest_reg_id: IDLEST register ID (e.g., 3 for CM_IDLEST3)
+  * @idlest_idle_bit: register bit shift for CM_IDLEST slave idle bit
+  * @idlest_stdby_bit: register bit shift for CM_IDLEST master standby bit
+  *
+  * @prcm_reg_id and @module_bit are specific to the AUTOIDLE, WKST,
+  * WKEN, GRPSEL registers.  In an ideal world, no extra information
+  * would be needed for IDLEST information, but alas, there are some
+  * exceptions, so @idlest_reg_id, @idlest_idle_bit, @idlest_stdby_bit
+  * are needed for the IDLEST registers (c.f. 2430 I2CHS, 3430 USBHOST)
+  */
+ struct omap_hwmod_omap2_prcm {
+       s16 module_offs;
+       u8 prcm_reg_id;
+       u8 module_bit;
+       u8 idlest_reg_id;
+       u8 idlest_idle_bit;
+       u8 idlest_stdby_bit;
+ };
+ /*
+  * Possible values for struct omap_hwmod_omap4_prcm.flags
+  *
+  * HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT: Some IP blocks don't have a PRCM
+  *     module-level context loss register associated with them; this
+  *     flag bit should be set in those cases
+  */
+ #define HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT               (1 << 0)
+ /**
+  * struct omap_hwmod_omap4_prcm - OMAP4-specific PRCM data
+  * @clkctrl_reg: PRCM address of the clock control register
+  * @rstctrl_reg: address of the XXX_RSTCTRL register located in the PRM
+  * @lostcontext_mask: bitmask for selecting bits from RM_*_CONTEXT register
+  * @rstst_reg: (AM33XX only) address of the XXX_RSTST register in the PRM
+  * @submodule_wkdep_bit: bit shift of the WKDEP range
+  * @flags: PRCM register capabilities for this IP block
+  *
+  * If @lostcontext_mask is not defined, context loss check code uses
+  * whole register without masking. @lostcontext_mask should only be
+  * defined in cases where @context_offs register is shared by two or
+  * more hwmods.
+  */
+ struct omap_hwmod_omap4_prcm {
+       u16             clkctrl_offs;
+       u16             rstctrl_offs;
+       u16             rstst_offs;
+       u16             context_offs;
+       u32             lostcontext_mask;
+       u8              submodule_wkdep_bit;
+       u8              modulemode;
+       u8              flags;
+ };
+ /*
+  * omap_hwmod.flags definitions
+  *
+  * HWMOD_SWSUP_SIDLE: omap_hwmod code should manually bring module in and out
+  *     of idle, rather than relying on module smart-idle
+  * HWMOD_SWSUP_MSTDBY: omap_hwmod code should manually bring module in and out
+  *     of standby, rather than relying on module smart-standby
+  * HWMOD_INIT_NO_RESET: don't reset this module at boot - important for
+  *     SDRAM controller, etc. XXX probably belongs outside the main hwmod file
+  *     XXX Should be HWMOD_SETUP_NO_RESET
+  * HWMOD_INIT_NO_IDLE: don't idle this module at boot - important for SDRAM
+  *     controller, etc. XXX probably belongs outside the main hwmod file
+  *     XXX Should be HWMOD_SETUP_NO_IDLE
+  * HWMOD_NO_OCP_AUTOIDLE: disable module autoidle (OCP_SYSCONFIG.AUTOIDLE)
+  *     when module is enabled, rather than the default, which is to
+  *     enable autoidle
+  * HWMOD_SET_DEFAULT_CLOCKACT: program CLOCKACTIVITY bits at startup
+  * HWMOD_NO_IDLEST: this module does not have idle status - this is the case
+  *     only for few initiator modules on OMAP2 & 3.
+  * HWMOD_CONTROL_OPT_CLKS_IN_RESET: Enable all optional clocks during reset.
+  *     This is needed for devices like DSS that require optional clocks enabled
+  *     in order to complete the reset. Optional clocks will be disabled
+  *     again after the reset.
+  * HWMOD_16BIT_REG: Module has 16bit registers
++ * HWMOD_EXT_OPT_MAIN_CLK: The only main functional clock source for
++ *     this IP block comes from an off-chip source and is not always
++ *     enabled.  This prevents the hwmod code from being able to
++ *     enable and reset the IP block early.  XXX Eventually it should
++ *     be possible to query the clock framework for this information.
+  */
+ #define HWMOD_SWSUP_SIDLE                     (1 << 0)
+ #define HWMOD_SWSUP_MSTANDBY                  (1 << 1)
+ #define HWMOD_INIT_NO_RESET                   (1 << 2)
+ #define HWMOD_INIT_NO_IDLE                    (1 << 3)
+ #define HWMOD_NO_OCP_AUTOIDLE                 (1 << 4)
+ #define HWMOD_SET_DEFAULT_CLOCKACT            (1 << 5)
+ #define HWMOD_NO_IDLEST                               (1 << 6)
+ #define HWMOD_CONTROL_OPT_CLKS_IN_RESET               (1 << 7)
+ #define HWMOD_16BIT_REG                               (1 << 8)
++#define HWMOD_EXT_OPT_MAIN_CLK                        (1 << 9)
+ /*
+  * omap_hwmod._int_flags definitions
+  * These are for internal use only and are managed by the omap_hwmod code.
+  *
+  * _HWMOD_NO_MPU_PORT: no path exists for the MPU to write to this module
+  * _HWMOD_WAKEUP_ENABLED: set when the omap_hwmod code has enabled ENAWAKEUP
+  * _HWMOD_SYSCONFIG_LOADED: set when the OCP_SYSCONFIG value has been cached
+  * _HWMOD_SKIP_ENABLE: set if hwmod enabled during init (HWMOD_INIT_NO_IDLE) -
+  *     causes the first call to _enable() to only update the pinmux
+  */
+ #define _HWMOD_NO_MPU_PORT                    (1 << 0)
+ #define _HWMOD_WAKEUP_ENABLED                 (1 << 1)
+ #define _HWMOD_SYSCONFIG_LOADED                       (1 << 2)
+ #define _HWMOD_SKIP_ENABLE                    (1 << 3)
+ /*
+  * omap_hwmod._state definitions
+  *
+  * INITIALIZED: reset (optionally), initialized, enabled, disabled
+  *              (optionally)
+  *
+  *
+  */
+ #define _HWMOD_STATE_UNKNOWN                  0
+ #define _HWMOD_STATE_REGISTERED                       1
+ #define _HWMOD_STATE_CLKS_INITED              2
+ #define _HWMOD_STATE_INITIALIZED              3
+ #define _HWMOD_STATE_ENABLED                  4
+ #define _HWMOD_STATE_IDLE                     5
+ #define _HWMOD_STATE_DISABLED                 6
+ /**
+  * struct omap_hwmod_class - the type of an IP block
+  * @name: name of the hwmod_class
+  * @sysc: device SYSCONFIG/SYSSTATUS register data
+  * @rev: revision of the IP class
+  * @pre_shutdown: ptr to fn to be executed immediately prior to device shutdown
+  * @reset: ptr to fn to be executed in place of the standard hwmod reset fn
+  *
+  * Represent the class of a OMAP hardware "modules" (e.g. timer,
+  * smartreflex, gpio, uart...)
+  *
+  * @pre_shutdown is a function that will be run immediately before
+  * hwmod clocks are disabled, etc.  It is intended for use for hwmods
+  * like the MPU watchdog, which cannot be disabled with the standard
+  * omap_hwmod_shutdown().  The function should return 0 upon success,
+  * or some negative error upon failure.  Returning an error will cause
+  * omap_hwmod_shutdown() to abort the device shutdown and return an
+  * error.
+  *
+  * If @reset is defined, then the function it points to will be
+  * executed in place of the standard hwmod _reset() code in
+  * mach-omap2/omap_hwmod.c.  This is needed for IP blocks which have
+  * unusual reset sequences - usually processor IP blocks like the IVA.
+  */
+ struct omap_hwmod_class {
+       const char                              *name;
+       struct omap_hwmod_class_sysconfig       *sysc;
+       u32                                     rev;
+       int                                     (*pre_shutdown)(struct omap_hwmod *oh);
+       int                                     (*reset)(struct omap_hwmod *oh);
+ };
+ /**
+  * struct omap_hwmod_link - internal structure linking hwmods with ocp_ifs
+  * @ocp_if: OCP interface structure record pointer
+  * @node: list_head pointing to next struct omap_hwmod_link in a list
+  */
+ struct omap_hwmod_link {
+       struct omap_hwmod_ocp_if        *ocp_if;
+       struct list_head                node;
+ };
+ /**
+  * struct omap_hwmod - integration data for OMAP hardware "modules" (IP blocks)
+  * @name: name of the hwmod
+  * @class: struct omap_hwmod_class * to the class of this hwmod
+  * @od: struct omap_device currently associated with this hwmod (internal use)
+  * @mpu_irqs: ptr to an array of MPU IRQs
+  * @sdma_reqs: ptr to an array of System DMA request IDs
+  * @prcm: PRCM data pertaining to this hwmod
+  * @main_clk: main clock: OMAP clock name
+  * @_clk: pointer to the main struct clk (filled in at runtime)
+  * @opt_clks: other device clocks that drivers can request (0..*)
+  * @voltdm: pointer to voltage domain (filled in at runtime)
+  * @dev_attr: arbitrary device attributes that can be passed to the driver
+  * @_sysc_cache: internal-use hwmod flags
+  * @_mpu_rt_va: cached register target start address (internal use)
+  * @_mpu_port: cached MPU register target slave (internal use)
+  * @opt_clks_cnt: number of @opt_clks
+  * @master_cnt: number of @master entries
+  * @slaves_cnt: number of @slave entries
+  * @response_lat: device OCP response latency (in interface clock cycles)
+  * @_int_flags: internal-use hwmod flags
+  * @_state: internal-use hwmod state
+  * @_postsetup_state: internal-use state to leave the hwmod in after _setup()
+  * @flags: hwmod flags (documented below)
+  * @_lock: spinlock serializing operations on this hwmod
+  * @node: list node for hwmod list (internal use)
+  *
+  * @main_clk refers to this module's "main clock," which for our
+  * purposes is defined as "the functional clock needed for register
+  * accesses to complete."  Modules may not have a main clock if the
+  * interface clock also serves as a main clock.
+  *
+  * Parameter names beginning with an underscore are managed internally by
+  * the omap_hwmod code and should not be set during initialization.
+  *
+  * @masters and @slaves are now deprecated.
+  */
+ struct omap_hwmod {
+       const char                      *name;
+       struct omap_hwmod_class         *class;
+       struct omap_device              *od;
+       struct omap_hwmod_mux_info      *mux;
+       struct omap_hwmod_irq_info      *mpu_irqs;
+       struct omap_hwmod_dma_info      *sdma_reqs;
+       struct omap_hwmod_rst_info      *rst_lines;
+       union {
+               struct omap_hwmod_omap2_prcm omap2;
+               struct omap_hwmod_omap4_prcm omap4;
+       }                               prcm;
+       const char                      *main_clk;
+       struct clk                      *_clk;
+       struct omap_hwmod_opt_clk       *opt_clks;
+       char                            *clkdm_name;
+       struct clockdomain              *clkdm;
+       struct list_head                master_ports; /* connect to *_IA */
+       struct list_head                slave_ports; /* connect to *_TA */
+       void                            *dev_attr;
+       u32                             _sysc_cache;
+       void __iomem                    *_mpu_rt_va;
+       spinlock_t                      _lock;
+       struct list_head                node;
+       struct omap_hwmod_ocp_if        *_mpu_port;
+       u16                             flags;
+       u8                              response_lat;
+       u8                              rst_lines_cnt;
+       u8                              opt_clks_cnt;
+       u8                              masters_cnt;
+       u8                              slaves_cnt;
+       u8                              hwmods_cnt;
+       u8                              _int_flags;
+       u8                              _state;
+       u8                              _postsetup_state;
+ };
+ struct omap_hwmod *omap_hwmod_lookup(const char *name);
+ int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
+                       void *data);
+ int __init omap_hwmod_setup_one(const char *name);
+ int omap_hwmod_enable(struct omap_hwmod *oh);
+ int omap_hwmod_idle(struct omap_hwmod *oh);
+ int omap_hwmod_shutdown(struct omap_hwmod *oh);
+ int omap_hwmod_assert_hardreset(struct omap_hwmod *oh, const char *name);
+ int omap_hwmod_deassert_hardreset(struct omap_hwmod *oh, const char *name);
+ int omap_hwmod_read_hardreset(struct omap_hwmod *oh, const char *name);
+ int omap_hwmod_enable_clocks(struct omap_hwmod *oh);
+ int omap_hwmod_disable_clocks(struct omap_hwmod *oh);
+ int omap_hwmod_set_slave_idlemode(struct omap_hwmod *oh, u8 idlemode);
+ int omap_hwmod_set_ocp_autoidle(struct omap_hwmod *oh, u8 autoidle);
+ int omap_hwmod_reset(struct omap_hwmod *oh);
+ void omap_hwmod_ocp_barrier(struct omap_hwmod *oh);
+ void omap_hwmod_write(u32 v, struct omap_hwmod *oh, u16 reg_offs);
+ u32 omap_hwmod_read(struct omap_hwmod *oh, u16 reg_offs);
+ int omap_hwmod_softreset(struct omap_hwmod *oh);
+ int omap_hwmod_count_resources(struct omap_hwmod *oh);
+ int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res);
+ int omap_hwmod_fill_dma_resources(struct omap_hwmod *oh, struct resource *res);
+ int omap_hwmod_get_resource_byname(struct omap_hwmod *oh, unsigned int type,
+                                  const char *name, struct resource *res);
+ struct powerdomain *omap_hwmod_get_pwrdm(struct omap_hwmod *oh);
+ void __iomem *omap_hwmod_get_mpu_rt_va(struct omap_hwmod *oh);
+ int omap_hwmod_add_initiator_dep(struct omap_hwmod *oh,
+                                struct omap_hwmod *init_oh);
+ int omap_hwmod_del_initiator_dep(struct omap_hwmod *oh,
+                                struct omap_hwmod *init_oh);
+ int omap_hwmod_enable_wakeup(struct omap_hwmod *oh);
+ int omap_hwmod_disable_wakeup(struct omap_hwmod *oh);
+ int omap_hwmod_for_each_by_class(const char *classname,
+                                int (*fn)(struct omap_hwmod *oh,
+                                          void *user),
+                                void *user);
+ int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state);
+ int omap_hwmod_get_context_loss_count(struct omap_hwmod *oh);
+ int omap_hwmod_no_setup_reset(struct omap_hwmod *oh);
+ int omap_hwmod_pad_route_irq(struct omap_hwmod *oh, int pad_idx, int irq_idx);
+ extern void __init omap_hwmod_init(void);
+ const char *omap_hwmod_get_main_clk(struct omap_hwmod *oh);
+ /*
+  * Chip variant-specific hwmod init routines - XXX should be converted
+  * to use initcalls once the initial boot ordering is straightened out
+  */
+ extern int omap2420_hwmod_init(void);
+ extern int omap2430_hwmod_init(void);
+ extern int omap3xxx_hwmod_init(void);
+ extern int omap44xx_hwmod_init(void);
+ extern int am33xx_hwmod_init(void);
+ extern int __init omap_hwmod_register_links(struct omap_hwmod_ocp_if **ois);
+ #endif
  #include <linux/io.h>
  #include <linux/platform_data/gpio-omap.h>
  #include <linux/power/smartreflex.h>
 +#include <linux/platform_data/omap_ocp2scp.h>
+ #include <linux/i2c-omap.h>
+ #include <plat-omap/dma-omap.h>
  
- #include <plat/omap_hwmod.h>
- #include <plat/i2c.h>
- #include <plat/dma.h>
  #include <linux/platform_data/spi-omap2-mcspi.h>
  #include <linux/platform_data/asoc-ti-mcbsp.h>
- #include <plat/mmc.h>
+ #include <linux/platform_data/iommu-omap.h>
  #include <plat/dmtimer.h>
- #include <plat/common.h>
- #include <plat/iommu.h>
  
+ #include "omap_hwmod.h"
  #include "omap_hwmod_common_data.h"
  #include "cm1_44xx.h"
  #include "cm2_44xx.h"
  #include "prm44xx.h"
  #include "prm-regbits-44xx.h"
+ #include "i2c.h"
+ #include "mmc.h"
  #include "wd_timer.h"
  
  /* Base offset for all OMAP4 interrupts external to MPUSS */
@@@ -2126,14 -2126,6 +2127,14 @@@ static struct omap_hwmod omap44xx_mcpdm
        .name           = "mcpdm",
        .class          = &omap44xx_mcpdm_hwmod_class,
        .clkdm_name     = "abe_clkdm",
 +      /*
 +       * It's suspected that the McPDM requires an off-chip main
 +       * functional clock, controlled via I2C.  This IP block is
 +       * currently reset very early during boot, before I2C is
 +       * available, so it doesn't seem that we have any choice in
 +       * the kernel other than to avoid resetting it.
 +       */
 +      .flags          = HWMOD_EXT_OPT_MAIN_CLK,
        .mpu_irqs       = omap44xx_mcpdm_irqs,
        .sdma_reqs      = omap44xx_mcpdm_sdma_reqs,
        .main_clk       = "mcpdm_fck",
@@@ -2690,32 -2682,6 +2691,32 @@@ static struct omap_hwmod_class omap44xx
        .sysc   = &omap44xx_ocp2scp_sysc,
  };
  
 +/* ocp2scp dev_attr */
 +static struct resource omap44xx_usb_phy_and_pll_addrs[] = {
 +      {
 +              .name           = "usb_phy",
 +              .start          = 0x4a0ad080,
 +              .end            = 0x4a0ae000,
 +              .flags          = IORESOURCE_MEM,
 +      },
 +      {
 +              /* XXX: Remove this once control module driver is in place */
 +              .name           = "ctrl_dev",
 +              .start          = 0x4a002300,
 +              .end            = 0x4a002303,
 +              .flags          = IORESOURCE_MEM,
 +      },
 +      { }
 +};
 +
 +static struct omap_ocp2scp_dev ocp2scp_dev_attr[] = {
 +      {
 +              .drv_name       = "omap-usb2",
 +              .res            = omap44xx_usb_phy_and_pll_addrs,
 +      },
 +      { }
 +};
 +
  /* ocp2scp_usb_phy */
  static struct omap_hwmod omap44xx_ocp2scp_usb_phy_hwmod = {
        .name           = "ocp2scp_usb_phy",
                        .modulemode   = MODULEMODE_HWCTRL,
                },
        },
 +      .dev_attr       = ocp2scp_dev_attr,
  };
  
  /*
@@@ -15,8 -15,9 +15,9 @@@
  
  #include <asm/pmu.h>
  
- #include <plat/omap_hwmod.h>
- #include <plat/omap_device.h>
+ #include "soc.h"
+ #include "omap_hwmod.h"
+ #include "omap_device.h"
  
  static char *omap2_pmu_oh_names[] = {"mpu"};
  static char *omap3_pmu_oh_names[] = {"mpu", "debugss"};
@@@ -57,6 -58,8 +58,6 @@@ static int __init omap2_init_pmu(unsign
        if (IS_ERR(omap_pmu_dev))
                return PTR_ERR(omap_pmu_dev);
  
 -      pm_runtime_enable(&omap_pmu_dev->dev);
 -
        return 0;
  }
  
@@@ -26,9 -26,6 +26,6 @@@
  #include <linux/regulator/machine.h>
  #include <linux/regulator/fixed.h>
  
- #include <plat/i2c.h>
- #include <plat/usb.h>
  #include "soc.h"
  #include "twl-common.h"
  #include "pm.h"
@@@ -73,7 -70,6 +70,7 @@@ void __init omap4_pmic_init(const char 
  {
        /* PMIC part*/
        omap_mux_init_signal("sys_nirq1", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE);
 +      omap_mux_init_signal("fref_clk0_out.sys_drm_msecure", OMAP_PIN_OUTPUT);
        omap_pmic_init(1, 400, pmic_type, 7 + OMAP44XX_IRQ_GIC_START, pmic_data);
  
        /* Register additional devices on i2c1 bus if needed */
@@@ -367,7 -363,7 +364,7 @@@ static struct regulator_init_data omap4
  };
  
  static struct regulator_consumer_supply omap4_vdd1_supply[] = {
 -      REGULATOR_SUPPLY("vcc", "mpu.0"),
 +      REGULATOR_SUPPLY("vcc", "cpu0"),
  };
  
  static struct regulator_consumer_supply omap4_vdd2_supply[] = {
@@@ -30,6 -30,7 +30,7 @@@
  #include <linux/device.h>
  #include <linux/dma-mapping.h>
  #include <linux/mm.h>
+ #include <linux/omap-iommu.h>
  #include <linux/sched.h>
  #include <linux/slab.h>
  #include <media/v4l2-event.h>
@@@ -1706,7 -1707,7 +1707,7 @@@ static long ccdc_ioctl(struct v4l2_subd
  }
  
  static int ccdc_subscribe_event(struct v4l2_subdev *sd, struct v4l2_fh *fh,
 -                              const struct v4l2_event_subscription *sub)
 +                              struct v4l2_event_subscription *sub)
  {
        if (sub->type != V4L2_EVENT_FRAME_SYNC)
                return -EINVAL;
  }
  
  static int ccdc_unsubscribe_event(struct v4l2_subdev *sd, struct v4l2_fh *fh,
 -                                const struct v4l2_event_subscription *sub)
 +                                struct v4l2_event_subscription *sub)
  {
        return v4l2_event_unsubscribe(fh, sub);
  }
@@@ -26,6 -26,7 +26,7 @@@
   */
  
  #include <linux/dma-mapping.h>
+ #include <linux/omap-iommu.h>
  #include <linux/slab.h>
  #include <linux/uaccess.h>
  
@@@ -1025,7 -1026,7 +1026,7 @@@ void omap3isp_stat_dma_isr(struct ispst
  
  int omap3isp_stat_subscribe_event(struct v4l2_subdev *subdev,
                                  struct v4l2_fh *fh,
 -                                const struct v4l2_event_subscription *sub)
 +                                struct v4l2_event_subscription *sub)
  {
        struct ispstat *stat = v4l2_get_subdevdata(subdev);
  
  
  int omap3isp_stat_unsubscribe_event(struct v4l2_subdev *subdev,
                                    struct v4l2_fh *fh,
 -                                  const struct v4l2_event_subscription *sub)
 +                                  struct v4l2_event_subscription *sub)
  {
        return v4l2_event_unsubscribe(fh, sub);
  }
@@@ -30,7 -30,7 +30,7 @@@
  
  #include <linux/types.h>
  #include <linux/omap3isp.h>
- #include <plat/dma.h>
+ #include <plat-omap/dma-omap.h>
  #include <media/v4l2-event.h>
  
  #include "isp.h"
@@@ -147,10 -147,10 +147,10 @@@ int omap3isp_stat_init(struct ispstat *
  void omap3isp_stat_cleanup(struct ispstat *stat);
  int omap3isp_stat_subscribe_event(struct v4l2_subdev *subdev,
                                  struct v4l2_fh *fh,
 -                                const struct v4l2_event_subscription *sub);
 +                                struct v4l2_event_subscription *sub);
  int omap3isp_stat_unsubscribe_event(struct v4l2_subdev *subdev,
                                    struct v4l2_fh *fh,
 -                                  const struct v4l2_event_subscription *sub);
 +                                  struct v4l2_event_subscription *sub);
  int omap3isp_stat_s_stream(struct v4l2_subdev *subdev, int enable);
  
  int omap3isp_stat_busy(struct ispstat *stat);
@@@ -27,6 -27,7 +27,7 @@@
  #include <linux/clk.h>
  #include <linux/mm.h>
  #include <linux/module.h>
+ #include <linux/omap-iommu.h>
  #include <linux/pagemap.h>
  #include <linux/scatterlist.h>
  #include <linux/sched.h>
@@@ -792,7 -793,7 +793,7 @@@ isp_video_get_crop(struct file *file, v
  }
  
  static int
 -isp_video_set_crop(struct file *file, void *fh, struct v4l2_crop *crop)
 +isp_video_set_crop(struct file *file, void *fh, const struct v4l2_crop *crop)
  {
        struct isp_video *video = video_drvdata(file);
        struct v4l2_subdev *subdev;
  #include <media/videobuf-dma-contig.h>
  #include <media/videobuf-dma-sg.h>
  
- #include <plat/dma.h>
+ #include <plat-omap/dma-omap.h>
  
  
  #define DRIVER_NAME           "omap1-camera"
  #define DRIVER_VERSION                "0.0.2"
  
+ #define OMAP_DMA_CAMERA_IF_RX         20
  
  /*
   * ---------------------------------------------------------------------------
@@@ -1215,9 -1216,9 +1216,9 @@@ static int set_mbus_format(struct omap1
  }
  
  static int omap1_cam_set_crop(struct soc_camera_device *icd,
 -                             struct v4l2_crop *crop)
 +                             const struct v4l2_crop *crop)
  {
 -      struct v4l2_rect *rect = &crop->c;
 +      const struct v4l2_rect *rect = &crop->c;
        const struct soc_camera_format_xlate *xlate = icd->current_fmt;
        struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
        struct device *dev = icd->parent;
  #include <linux/spinlock.h>
  #include <linux/gpio.h>
  #include <plat/cpu.h>
- #include <plat/usb.h>
+ #include <linux/platform_device.h>
+ #include <linux/platform_data/usb-omap.h>
  #include <linux/pm_runtime.h>
  
+ #include "omap-usb.h"
  #define USBHS_DRIVER_NAME     "usbhs_omap"
  #define OMAP_EHCI_DEVICE      "ehci-omap"
  #define OMAP_OHCI_DEVICE      "ohci-omap3"
@@@ -464,7 -467,7 +467,7 @@@ static void omap_usbhs_deinit(struct de
   *
   * Allocates basic resources for this USB host controller.
   */
 -static int __devinit usbhs_omap_probe(struct platform_device *pdev)
 +static int usbhs_omap_probe(struct platform_device *pdev)
  {
        struct device                   *dev =  &pdev->dev;
        struct usbhs_omap_platform_data *pdata = dev->platform_data;
@@@ -652,7 -655,7 +655,7 @@@ end_probe
   *
   * Reverses the effect of usbhs_omap_probe().
   */
 -static int __devexit usbhs_omap_remove(struct platform_device *pdev)
 +static int usbhs_omap_remove(struct platform_device *pdev)
  {
        struct usbhs_hcd_omap *omap = platform_get_drvdata(pdev);
  
@@@ -25,8 -25,8 +25,8 @@@
  #include <linux/clk.h>
  #include <linux/io.h>
  #include <linux/err.h>
- #include <plat/usb.h>
  #include <linux/pm_runtime.h>
+ #include <linux/platform_data/usb-omap.h>
  
  #define USBTLL_DRIVER_NAME    "usbhs_tll"
  
@@@ -200,7 -200,7 +200,7 @@@ static unsigned ohci_omap3_fslsmode(enu
   *
   * Allocates basic resources for this USB host controller.
   */
 -static int __devinit usbtll_omap_probe(struct platform_device *pdev)
 +static int usbtll_omap_probe(struct platform_device *pdev)
  {
        struct device                           *dev =  &pdev->dev;
        struct usbtll_omap_platform_data        *pdata = dev->platform_data;
@@@ -348,7 -348,7 +348,7 @@@ end
   *
   * Reverses the effect of usbtll_omap_probe().
   */
 -static int __devexit usbtll_omap_remove(struct platform_device *pdev)
 +static int usbtll_omap_remove(struct platform_device *pdev)
  {
        struct usbtll_omap *tll = platform_get_drvdata(pdev);
  
@@@ -424,7 -424,7 +424,7 @@@ static struct platform_driver usbtll_om
                .pm             = &usbtllomap_dev_pm_ops,
        },
        .probe          = usbtll_omap_probe,
 -      .remove         = __devexit_p(usbtll_omap_remove),
 +      .remove         = usbtll_omap_remove,
  };
  
  int omap_tll_enable(void)
@@@ -28,6 -28,7 +28,7 @@@
  #include <linux/slab.h>
  #include <linux/stat.h>
  #include <linux/types.h>
+ #include <linux/platform_data/atmel.h>
  
  #include <linux/mmc/host.h>
  #include <linux/mmc/sdio.h>
@@@ -40,7 -41,6 +41,6 @@@
  #include <asm/unaligned.h>
  
  #include <mach/cpu.h>
- #include <mach/board.h>
  
  #include "atmel-mci-regs.h"
  
@@@ -511,7 -511,7 +511,7 @@@ static const struct of_device_id atmci_
  
  MODULE_DEVICE_TABLE(of, atmci_dt_ids);
  
 -static struct mci_platform_data __devinit*
 +static struct mci_platform_data*
  atmci_of_init(struct platform_device *pdev)
  {
        struct device_node *np = pdev->dev.of_node;
diff --combined drivers/mmc/host/omap.c
@@@ -28,9 -28,8 +28,8 @@@
  #include <linux/clk.h>
  #include <linux/scatterlist.h>
  #include <linux/slab.h>
+ #include <linux/platform_data/mmc-omap.h>
  
- #include <plat/mmc.h>
- #include <plat/dma.h>
  
  #define       OMAP_MMC_REG_CMD        0x00
  #define       OMAP_MMC_REG_ARGL       0x01
  #define       OMAP_MMC_STAT_CARD_BUSY         (1 <<  2)
  #define       OMAP_MMC_STAT_END_OF_CMD        (1 <<  0)
  
+ #define mmc_omap7xx() (host->features & MMC_OMAP7XX)
+ #define mmc_omap15xx()        (host->features & MMC_OMAP15XX)
+ #define mmc_omap16xx()        (host->features & MMC_OMAP16XX)
+ #define MMC_OMAP1_MASK        (MMC_OMAP7XX | MMC_OMAP15XX | MMC_OMAP16XX)
+ #define mmc_omap1()   (host->features & MMC_OMAP1_MASK)
+ #define mmc_omap2()   (!mmc_omap1())
  #define OMAP_MMC_REG(host, reg)               (OMAP_MMC_REG_##reg << (host)->reg_shift)
  #define OMAP_MMC_READ(host, reg)      __raw_readw((host)->virt_base + OMAP_MMC_REG(host, reg))
  #define OMAP_MMC_WRITE(host, reg, val)        __raw_writew((val), (host)->virt_base + OMAP_MMC_REG(host, reg))
  #define OMAP_MMC_CMDTYPE_AC   2
  #define OMAP_MMC_CMDTYPE_ADTC 3
  
+ #define OMAP_DMA_MMC_TX               21
+ #define OMAP_DMA_MMC_RX               22
+ #define OMAP_DMA_MMC2_TX      54
+ #define OMAP_DMA_MMC2_RX      55
+ #define OMAP24XX_DMA_MMC2_TX  47
+ #define OMAP24XX_DMA_MMC2_RX  48
+ #define OMAP24XX_DMA_MMC1_TX  61
+ #define OMAP24XX_DMA_MMC1_RX  62
  
  #define DRIVER_NAME "mmci-omap"
  
@@@ -147,6 -163,7 +163,7 @@@ struct mmc_omap_host 
        u32                     buffer_bytes_left;
        u32                     total_bytes_left;
  
+       unsigned                features;
        unsigned                use_dma:1;
        unsigned                brs_received:1, dma_done:1;
        unsigned                dma_in_use:1;
@@@ -988,7 -1005,7 +1005,7 @@@ mmc_omap_prepare_data(struct mmc_omap_h
                 * blocksize is at least that large. Blocksize is
                 * usually 512 bytes; but not for some SD reads.
                 */
-               burst = cpu_is_omap15xx() ? 32 : 64;
+               burst = mmc_omap15xx() ? 32 : 64;
                if (burst > data->blksz)
                        burst = data->blksz;
  
@@@ -1104,8 -1121,7 +1121,7 @@@ static void mmc_omap_set_power(struct m
        if (slot->pdata->set_power != NULL)
                slot->pdata->set_power(mmc_dev(slot->mmc), slot->id, power_on,
                                        vdd);
-       if (cpu_is_omap24xx()) {
+       if (mmc_omap2()) {
                u16 w;
  
                if (power_on) {
@@@ -1214,7 -1230,7 +1230,7 @@@ static const struct mmc_host_ops mmc_om
        .set_ios        = mmc_omap_set_ios,
  };
  
 -static int __devinit mmc_omap_new_slot(struct mmc_omap_host *host, int id)
 +static int mmc_omap_new_slot(struct mmc_omap_host *host, int id)
  {
        struct mmc_omap_slot *slot = NULL;
        struct mmc_host *mmc;
        mmc->ops = &mmc_omap_ops;
        mmc->f_min = 400000;
  
-       if (cpu_class_is_omap2())
+       if (mmc_omap2())
                mmc->f_max = 48000000;
        else
                mmc->f_max = 24000000;
@@@ -1309,7 -1325,7 +1325,7 @@@ static void mmc_omap_remove_slot(struc
        mmc_free_host(mmc);
  }
  
 -static int __devinit mmc_omap_probe(struct platform_device *pdev)
 +static int mmc_omap_probe(struct platform_device *pdev)
  {
        struct omap_mmc_platform_data *pdata = pdev->dev.platform_data;
        struct mmc_omap_host *host = NULL;
        init_waitqueue_head(&host->slot_wq);
  
        host->pdata = pdata;
+       host->features = host->pdata->slots[0].features;
        host->dev = &pdev->dev;
        platform_set_drvdata(pdev, host);
  
        host->dma_tx_burst = -1;
        host->dma_rx_burst = -1;
  
-       if (cpu_is_omap24xx())
+       if (mmc_omap2())
                sig = host->id == 0 ? OMAP24XX_DMA_MMC1_TX : OMAP24XX_DMA_MMC2_TX;
        else
                sig = host->id == 0 ? OMAP_DMA_MMC_TX : OMAP_DMA_MMC2_TX;
                dev_warn(host->dev, "unable to obtain TX DMA engine channel %u\n",
                        sig);
  #endif
-       if (cpu_is_omap24xx())
+       if (mmc_omap2())
                sig = host->id == 0 ? OMAP24XX_DMA_MMC1_RX : OMAP24XX_DMA_MMC2_RX;
        else
                sig = host->id == 0 ? OMAP_DMA_MMC_RX : OMAP_DMA_MMC2_RX;
        }
  
        host->nr_slots = pdata->nr_slots;
-       host->reg_shift = (cpu_is_omap7xx() ? 1 : 2);
+       host->reg_shift = (mmc_omap7xx() ? 1 : 2);
  
        host->mmc_omap_wq = alloc_workqueue("mmc_omap", 0, 0);
        if (!host->mmc_omap_wq)
@@@ -1478,7 -1495,7 +1495,7 @@@ err_free_mem_region
        return ret;
  }
  
 -static int __devexit mmc_omap_remove(struct platform_device *pdev)
 +static int mmc_omap_remove(struct platform_device *pdev)
  {
        struct mmc_omap_host *host = platform_get_drvdata(pdev);
        int i;
@@@ -1566,7 -1583,7 +1583,7 @@@ static int mmc_omap_resume(struct platf
  
  static struct platform_driver mmc_omap_driver = {
        .probe          = mmc_omap_probe,
 -      .remove         = __devexit_p(mmc_omap_remove),
 +      .remove         = mmc_omap_remove,
        .suspend        = mmc_omap_suspend,
        .resume         = mmc_omap_resume,
        .driver         = {
  #include <linux/io.h>
  #include <linux/gpio.h>
  #include <linux/regulator/consumer.h>
 +#include <linux/pinctrl/consumer.h>
  #include <linux/pm_runtime.h>
- #include <mach/hardware.h>
- #include <plat/mmc.h>
- #include <plat/cpu.h>
+ #include <linux/platform_data/mmc-omap.h>
  
  /* OMAP HSMMC Host Controller Registers */
  #define OMAP_HSMMC_SYSSTATUS  0x0014
@@@ -63,7 -60,6 +61,7 @@@
  
  #define VS18                  (1 << 26)
  #define VS30                  (1 << 25)
 +#define HSS                   (1 << 21)
  #define SDVS18                        (0x5 << 9)
  #define SDVS30                        (0x6 << 9)
  #define SDVS33                        (0x7 << 9)
  #define CLKD_SHIFT            6
  #define DTO_MASK              0x000F0000
  #define DTO_SHIFT             16
 -#define INT_EN_MASK           0x307F0033
 -#define BWR_ENABLE            (1 << 4)
 -#define BRR_ENABLE            (1 << 5)
 -#define DTO_ENABLE            (1 << 20)
  #define INIT_STREAM           (1 << 1)
  #define DP_SELECT             (1 << 21)
  #define DDIR                  (1 << 4)
 -#define DMA_EN                        0x1
 +#define DMAE                  0x1
  #define MSBS                  (1 << 5)
  #define BCE                   (1 << 1)
  #define FOUR_BIT              (1 << 1)
 +#define HSPE                  (1 << 2)
  #define DDR                   (1 << 19)
  #define DW8                   (1 << 5)
 -#define CC                    0x1
 -#define TC                    0x02
  #define OD                    0x1
 -#define ERR                   (1 << 15)
 -#define CMD_TIMEOUT           (1 << 16)
 -#define DATA_TIMEOUT          (1 << 20)
 -#define CMD_CRC                       (1 << 17)
 -#define DATA_CRC              (1 << 21)
 -#define CARD_ERR              (1 << 28)
  #define STAT_CLEAR            0xFFFFFFFF
  #define INIT_STREAM_CMD               0x00000000
  #define DUAL_VOLT_OCR_BIT     7
  #define SOFTRESET             (1 << 1)
  #define RESETDONE             (1 << 0)
  
 +/* Interrupt masks for IE and ISE register */
 +#define CC_EN                 (1 << 0)
 +#define TC_EN                 (1 << 1)
 +#define BWR_EN                        (1 << 4)
 +#define BRR_EN                        (1 << 5)
 +#define ERR_EN                        (1 << 15)
 +#define CTO_EN                        (1 << 16)
 +#define CCRC_EN                       (1 << 17)
 +#define CEB_EN                        (1 << 18)
 +#define CIE_EN                        (1 << 19)
 +#define DTO_EN                        (1 << 20)
 +#define DCRC_EN                       (1 << 21)
 +#define DEB_EN                        (1 << 22)
 +#define CERR_EN                       (1 << 28)
 +#define BADA_EN                       (1 << 29)
 +
 +#define INT_EN_MASK           (BADA_EN | CERR_EN | DEB_EN | DCRC_EN |\
 +              DTO_EN | CIE_EN | CEB_EN | CCRC_EN | CTO_EN | \
 +              BRR_EN | BWR_EN | TC_EN | CC_EN)
 +
  #define MMC_AUTOSUSPEND_DELAY 100
  #define MMC_TIMEOUT_MS                20
  #define OMAP_MMC_MIN_CLOCK    400000
@@@ -189,8 -176,7 +187,8 @@@ struct omap_hsmmc_host 
  
  static int omap_hsmmc_card_detect(struct device *dev, int slot)
  {
 -      struct omap_mmc_platform_data *mmc = dev->platform_data;
 +      struct omap_hsmmc_host *host = dev_get_drvdata(dev);
 +      struct omap_mmc_platform_data *mmc = host->pdata;
  
        /* NOTE: assumes card detect signal is active-low */
        return !gpio_get_value_cansleep(mmc->slots[0].switch_pin);
  
  static int omap_hsmmc_get_wp(struct device *dev, int slot)
  {
 -      struct omap_mmc_platform_data *mmc = dev->platform_data;
 +      struct omap_hsmmc_host *host = dev_get_drvdata(dev);
 +      struct omap_mmc_platform_data *mmc = host->pdata;
  
        /* NOTE: assumes write protect signal is active-high */
        return gpio_get_value_cansleep(mmc->slots[0].gpio_wp);
  
  static int omap_hsmmc_get_cover_state(struct device *dev, int slot)
  {
 -      struct omap_mmc_platform_data *mmc = dev->platform_data;
 +      struct omap_hsmmc_host *host = dev_get_drvdata(dev);
 +      struct omap_mmc_platform_data *mmc = host->pdata;
  
        /* NOTE: assumes card detect signal is active-low */
        return !gpio_get_value_cansleep(mmc->slots[0].switch_pin);
  
  static int omap_hsmmc_suspend_cdirq(struct device *dev, int slot)
  {
 -      struct omap_mmc_platform_data *mmc = dev->platform_data;
 +      struct omap_hsmmc_host *host = dev_get_drvdata(dev);
 +      struct omap_mmc_platform_data *mmc = host->pdata;
  
        disable_irq(mmc->slots[0].card_detect_irq);
        return 0;
  
  static int omap_hsmmc_resume_cdirq(struct device *dev, int slot)
  {
 -      struct omap_mmc_platform_data *mmc = dev->platform_data;
 +      struct omap_hsmmc_host *host = dev_get_drvdata(dev);
 +      struct omap_mmc_platform_data *mmc = host->pdata;
  
        enable_irq(mmc->slots[0].card_detect_irq);
        return 0;
@@@ -313,7 -295,7 +311,7 @@@ static int omap_hsmmc_reg_get(struct om
  
        reg = regulator_get(host->dev, "vmmc");
        if (IS_ERR(reg)) {
 -              dev_dbg(host->dev, "vmmc regulator missing\n");
 +              dev_err(host->dev, "vmmc regulator missing\n");
                return PTR_ERR(reg);
        } else {
                mmc_slot(host).set_power = omap_hsmmc_set_power;
@@@ -466,13 -448,13 +464,13 @@@ static void omap_hsmmc_enable_irq(struc
        unsigned int irq_mask;
  
        if (host->use_dma)
 -              irq_mask = INT_EN_MASK & ~(BRR_ENABLE | BWR_ENABLE);
 +              irq_mask = INT_EN_MASK & ~(BRR_EN | BWR_EN);
        else
                irq_mask = INT_EN_MASK;
  
        /* Disable timeout for erases */
        if (cmd->opcode == MMC_ERASE)
 -              irq_mask &= ~DTO_ENABLE;
 +              irq_mask &= ~DTO_EN;
  
        OMAP_HSMMC_WRITE(host->base, STAT, STAT_CLEAR);
        OMAP_HSMMC_WRITE(host->base, ISE, irq_mask);
@@@ -505,7 -487,6 +503,7 @@@ static void omap_hsmmc_set_clock(struc
        struct mmc_ios *ios = &host->mmc->ios;
        unsigned long regval;
        unsigned long timeout;
 +      unsigned long clkdiv;
  
        dev_vdbg(mmc_dev(host->mmc), "Set clock to %uHz\n", ios->clock);
  
  
        regval = OMAP_HSMMC_READ(host->base, SYSCTL);
        regval = regval & ~(CLKD_MASK | DTO_MASK);
 -      regval = regval | (calc_divisor(host, ios) << 6) | (DTO << 16);
 +      clkdiv = calc_divisor(host, ios);
 +      regval = regval | (clkdiv << 6) | (DTO << 16);
        OMAP_HSMMC_WRITE(host->base, SYSCTL, regval);
        OMAP_HSMMC_WRITE(host->base, SYSCTL,
                OMAP_HSMMC_READ(host->base, SYSCTL) | ICE);
                && time_before(jiffies, timeout))
                cpu_relax();
  
 +      /*
 +       * Enable High-Speed Support
 +       * Pre-Requisites
 +       *      - Controller should support High-Speed-Enable Bit
 +       *      - Controller should not be using DDR Mode
 +       *      - Controller should advertise that it supports High Speed
 +       *        in capabilities register
 +       *      - MMC/SD clock coming out of controller > 25MHz
 +       */
 +      if ((mmc_slot(host).features & HSMMC_HAS_HSPE_SUPPORT) &&
 +          (ios->timing != MMC_TIMING_UHS_DDR50) &&
 +          ((OMAP_HSMMC_READ(host->base, CAPA) & HSS) == HSS)) {
 +              regval = OMAP_HSMMC_READ(host->base, HCTL);
 +              if (clkdiv && (clk_get_rate(host->fclk)/clkdiv) > 25000000)
 +                      regval |= HSPE;
 +              else
 +                      regval &= ~HSPE;
 +
 +              OMAP_HSMMC_WRITE(host->base, HCTL, regval);
 +      }
 +
        omap_hsmmc_start_clock(host);
  }
  
@@@ -710,8 -669,8 +708,8 @@@ static void send_init_stream(struct oma
        OMAP_HSMMC_WRITE(host->base, CMD, INIT_STREAM_CMD);
  
        timeout = jiffies + msecs_to_jiffies(MMC_TIMEOUT_MS);
 -      while ((reg != CC) && time_before(jiffies, timeout))
 -              reg = OMAP_HSMMC_READ(host->base, STAT) & CC;
 +      while ((reg != CC_EN) && time_before(jiffies, timeout))
 +              reg = OMAP_HSMMC_READ(host->base, STAT) & CC_EN;
  
        OMAP_HSMMC_WRITE(host->base, CON,
                OMAP_HSMMC_READ(host->base, CON) & ~INIT_STREAM);
@@@ -802,7 -761,7 +800,7 @@@ omap_hsmmc_start_command(struct omap_hs
        }
  
        if (host->use_dma)
 -              cmdreg |= DMA_EN;
 +              cmdreg |= DMAE;
  
        host->req_in_progress = 1;
  
@@@ -1002,20 -961,16 +1000,20 @@@ static inline void omap_hsmmc_reset_con
                        __func__);
  }
  
 -static void hsmmc_command_incomplete(struct omap_hsmmc_host *host, int err)
 +static void hsmmc_command_incomplete(struct omap_hsmmc_host *host,
 +                                      int err, int end_cmd)
  {
 -      omap_hsmmc_reset_controller_fsm(host, SRC);
 -      host->cmd->error = err;
 +      if (end_cmd) {
 +              omap_hsmmc_reset_controller_fsm(host, SRC);
 +              if (host->cmd)
 +                      host->cmd->error = err;
 +      }
  
        if (host->data) {
                omap_hsmmc_reset_controller_fsm(host, SRD);
                omap_hsmmc_dma_cleanup(host, err);
 -      }
 -
 +      } else if (host->mrq && host->mrq->cmd)
 +              host->mrq->cmd->error = err;
  }
  
  static void omap_hsmmc_do_irq(struct omap_hsmmc_host *host, int status)
        data = host->data;
        dev_vdbg(mmc_dev(host->mmc), "IRQ Status is %x\n", status);
  
 -      if (status & ERR) {
 +      if (status & ERR_EN) {
                omap_hsmmc_dbg_report_irq(host, status);
 -              if (status & (CMD_TIMEOUT | DATA_TIMEOUT))
 -                      hsmmc_command_incomplete(host, -ETIMEDOUT);
 -              else if (status & (CMD_CRC | DATA_CRC))
 -                      hsmmc_command_incomplete(host, -EILSEQ);
  
 -              end_cmd = 1;
 +              if (status & (CTO_EN | CCRC_EN))
 +                      end_cmd = 1;
 +              if (status & (CTO_EN | DTO_EN))
 +                      hsmmc_command_incomplete(host, -ETIMEDOUT, end_cmd);
 +              else if (status & (CCRC_EN | DCRC_EN))
 +                      hsmmc_command_incomplete(host, -EILSEQ, end_cmd);
 +
                if (host->data || host->response_busy) {
 -                      end_trans = 1;
 +                      end_trans = !end_cmd;
                        host->response_busy = 0;
                }
        }
  
 -      if (end_cmd || ((status & CC) && host->cmd))
 +      if (end_cmd || ((status & CC_EN) && host->cmd))
                omap_hsmmc_cmd_done(host, host->cmd);
 -      if ((end_trans || (status & TC)) && host->mrq)
 +      if ((end_trans || (status & TC_EN)) && host->mrq)
                omap_hsmmc_xfer_done(host, data);
  }
  
@@@ -1141,7 -1094,7 +1139,7 @@@ static int omap_hsmmc_switch_opcond(str
  
        return 0;
  err:
 -      dev_dbg(mmc_dev(host->mmc), "Unable to switch operating voltage\n");
 +      dev_err(mmc_dev(host->mmc), "Unable to switch operating voltage\n");
        return ret;
  }
  
@@@ -1400,7 -1353,7 +1398,7 @@@ omap_hsmmc_prepare_data(struct omap_hsm
        if (host->use_dma) {
                ret = omap_hsmmc_start_dma_transfer(host, req);
                if (ret != 0) {
 -                      dev_dbg(mmc_dev(host->mmc), "MMC start dma failure\n");
 +                      dev_err(mmc_dev(host->mmc), "MMC start dma failure\n");
                        return ret;
                }
        }
@@@ -1718,7 -1671,7 +1716,7 @@@ static struct omap_mmc_platform_data *o
  {
        struct omap_mmc_platform_data *pdata;
        struct device_node *np = dev->of_node;
 -      u32 bus_width;
 +      u32 bus_width, max_freq;
  
        pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
        if (!pdata)
        if (of_find_property(np, "ti,needs-special-reset", NULL))
                pdata->slots[0].features |= HSMMC_HAS_UPDATED_RESET;
  
 +      if (!of_property_read_u32(np, "max-frequency", &max_freq))
 +              pdata->max_freq = max_freq;
 +
 +      if (of_find_property(np, "ti,needs-special-hs-handling", NULL))
 +              pdata->slots[0].features |= HSMMC_HAS_HSPE_SUPPORT;
 +
        return pdata;
  }
  #else
@@@ -1761,7 -1708,7 +1759,7 @@@ static inline struct omap_mmc_platform_
  }
  #endif
  
 -static int __devinit omap_hsmmc_probe(struct platform_device *pdev)
 +static int omap_hsmmc_probe(struct platform_device *pdev)
  {
        struct omap_mmc_platform_data *pdata = pdev->dev.platform_data;
        struct mmc_host *mmc;
        const struct of_device_id *match;
        dma_cap_mask_t mask;
        unsigned tx_req, rx_req;
 +      struct pinctrl *pinctrl;
  
        match = of_match_device(of_match_ptr(omap_mmc_of_match), &pdev->dev);
        if (match) {
         * MMC can still work without debounce clock.
         */
        if (IS_ERR(host->dbclk)) {
 -              dev_warn(mmc_dev(host->mmc), "Failed to get debounce clk\n");
                host->dbclk = NULL;
        } else if (clk_prepare_enable(host->dbclk) != 0) {
                dev_warn(mmc_dev(host->mmc), "Failed to enable debounce clk\n");
        ret = request_irq(host->irq, omap_hsmmc_irq, 0,
                        mmc_hostname(mmc), host);
        if (ret) {
 -              dev_dbg(mmc_dev(host->mmc), "Unable to grab HSMMC IRQ\n");
 +              dev_err(mmc_dev(host->mmc), "Unable to grab HSMMC IRQ\n");
                goto err_irq;
        }
  
        if (pdata->init != NULL) {
                if (pdata->init(&pdev->dev) != 0) {
 -                      dev_dbg(mmc_dev(host->mmc),
 +                      dev_err(mmc_dev(host->mmc),
                                "Unable to configure MMC IRQs\n");
                        goto err_irq_cd_init;
                }
                                           IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
                                           mmc_hostname(mmc), host);
                if (ret) {
 -                      dev_dbg(mmc_dev(host->mmc),
 +                      dev_err(mmc_dev(host->mmc),
                                "Unable to grab MMC CD IRQ\n");
                        goto err_irq_cd;
                }
  
        omap_hsmmc_disable_irq(host);
  
 +      pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
 +      if (IS_ERR(pinctrl))
 +              dev_warn(&pdev->dev,
 +                      "pins are not configured from the driver\n");
 +
        omap_hsmmc_protect_card(host);
  
        mmc_add_host(mmc);
@@@ -2037,7 -1979,7 +2035,7 @@@ err
        return ret;
  }
  
 -static int __devexit omap_hsmmc_remove(struct platform_device *pdev)
 +static int omap_hsmmc_remove(struct platform_device *pdev)
  {
        struct omap_hsmmc_host *host = platform_get_drvdata(pdev);
        struct resource *res;
                clk_put(host->dbclk);
        }
  
 -      mmc_free_host(host->mmc);
 +      omap_hsmmc_gpio_free(host->pdata);
        iounmap(host->base);
 -      omap_hsmmc_gpio_free(pdev->dev.platform_data);
 +      mmc_free_host(host->mmc);
  
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (res)
  }
  
  #ifdef CONFIG_PM
 +static int omap_hsmmc_prepare(struct device *dev)
 +{
 +      struct omap_hsmmc_host *host = dev_get_drvdata(dev);
 +
 +      if (host->pdata->suspend)
 +              return host->pdata->suspend(dev, host->slot_id);
 +
 +      return 0;
 +}
 +
 +static void omap_hsmmc_complete(struct device *dev)
 +{
 +      struct omap_hsmmc_host *host = dev_get_drvdata(dev);
 +
 +      if (host->pdata->resume)
 +              host->pdata->resume(dev, host->slot_id);
 +
 +}
 +
  static int omap_hsmmc_suspend(struct device *dev)
  {
        int ret = 0;
  
        pm_runtime_get_sync(host->dev);
        host->suspended = 1;
 -      if (host->pdata->suspend) {
 -              ret = host->pdata->suspend(dev, host->slot_id);
 -              if (ret) {
 -                      dev_dbg(dev, "Unable to handle MMC board"
 -                                      " level suspend\n");
 -                      host->suspended = 0;
 -                      return ret;
 -              }
 -      }
        ret = mmc_suspend_host(host->mmc);
  
        if (ret) {
                host->suspended = 0;
 -              if (host->pdata->resume) {
 -                      if (host->pdata->resume(dev, host->slot_id))
 -                              dev_dbg(dev, "Unmask interrupt failed\n");
 -              }
                goto err;
        }
  
@@@ -2150,6 -2086,12 +2148,6 @@@ static int omap_hsmmc_resume(struct dev
        if (!(host->mmc->pm_flags & MMC_PM_KEEP_POWER))
                omap_hsmmc_conf_bus_power(host);
  
 -      if (host->pdata->resume) {
 -              ret = host->pdata->resume(dev, host->slot_id);
 -              if (ret)
 -                      dev_dbg(dev, "Unmask interrupt failed\n");
 -      }
 -
        omap_hsmmc_protect_card(host);
  
        /* Notify the core to resume the host */
  }
  
  #else
 +#define omap_hsmmc_prepare    NULL
 +#define omap_hsmmc_complete   NULL
  #define omap_hsmmc_suspend    NULL
 -#define omap_hsmmc_resume             NULL
 +#define omap_hsmmc_resume     NULL
  #endif
  
  static int omap_hsmmc_runtime_suspend(struct device *dev)
@@@ -2196,15 -2136,13 +2194,15 @@@ static int omap_hsmmc_runtime_resume(st
  static struct dev_pm_ops omap_hsmmc_dev_pm_ops = {
        .suspend        = omap_hsmmc_suspend,
        .resume         = omap_hsmmc_resume,
 +      .prepare        = omap_hsmmc_prepare,
 +      .complete       = omap_hsmmc_complete,
        .runtime_suspend = omap_hsmmc_runtime_suspend,
        .runtime_resume = omap_hsmmc_runtime_resume,
  };
  
  static struct platform_driver omap_hsmmc_driver = {
        .probe          = omap_hsmmc_probe,
 -      .remove         = __devexit_p(omap_hsmmc_remove),
 +      .remove         = omap_hsmmc_remove,
        .driver         = {
                .name = DRIVER_NAME,
                .owner = THIS_MODULE,
  #include <linux/atmel_pdc.h>
  #include <linux/atmel_serial.h>
  #include <linux/uaccess.h>
 +#include <linux/pinctrl/consumer.h>
+ #include <linux/platform_data/atmel.h>
  
  #include <asm/io.h>
  #include <asm/ioctls.h>
  
- #include <mach/board.h>
 -#include <asm/mach/serial_at91.h>
--
  #ifdef CONFIG_ARM
  #include <mach/cpu.h>
  #include <asm/gpio.h>
@@@ -1423,7 -1423,7 +1422,7 @@@ static struct uart_ops atmel_pops = 
  #endif
  };
  
 -static void __devinit atmel_of_init_port(struct atmel_uart_port *atmel_port,
 +static void atmel_of_init_port(struct atmel_uart_port *atmel_port,
                                         struct device_node *np)
  {
        u32 rs485_delay[2];
  /*
   * Configure the port from the platform device resource info.
   */
 -static void __devinit atmel_init_port(struct atmel_uart_port *atmel_port,
 +static void atmel_init_port(struct atmel_uart_port *atmel_port,
                                      struct platform_device *pdev)
  {
        struct uart_port *port = &atmel_port->uart;
        }
  }
  
 -/*
 - * Register board-specific modem-control line handlers.
 - */
 -void __init atmel_register_uart_fns(struct atmel_port_fns *fns)
 -{
 -      if (fns->enable_ms)
 -              atmel_pops.enable_ms = fns->enable_ms;
 -      if (fns->get_mctrl)
 -              atmel_pops.get_mctrl = fns->get_mctrl;
 -      if (fns->set_mctrl)
 -              atmel_pops.set_mctrl = fns->set_mctrl;
 -      atmel_open_hook         = fns->open;
 -      atmel_close_hook        = fns->close;
 -      atmel_pops.pm           = fns->pm;
 -      atmel_pops.set_wake     = fns->set_wake;
 -}
 -
  struct platform_device *atmel_default_console_device; /* the serial console device */
  
  #ifdef CONFIG_SERIAL_ATMEL_CONSOLE
@@@ -1749,14 -1766,13 +1748,14 @@@ static int atmel_serial_resume(struct p
  #define atmel_serial_resume NULL
  #endif
  
 -static int __devinit atmel_serial_probe(struct platform_device *pdev)
 +static int atmel_serial_probe(struct platform_device *pdev)
  {
        struct atmel_uart_port *port;
        struct device_node *np = pdev->dev.of_node;
        struct atmel_uart_data *pdata = pdev->dev.platform_data;
        void *data;
        int ret = -ENODEV;
 +      struct pinctrl *pinctrl;
  
        BUILD_BUG_ON(ATMEL_SERIAL_RINGSIZE & (ATMEL_SERIAL_RINGSIZE - 1));
  
  
        atmel_init_port(port, pdev);
  
 +      pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
 +      if (IS_ERR(pinctrl)) {
 +              ret = PTR_ERR(pinctrl);
 +              goto err;
 +      }
 +
        if (!atmel_use_dma_rx(&port->uart)) {
                ret = -ENOMEM;
                data = kmalloc(sizeof(struct atmel_uart_char)
@@@ -1841,7 -1851,7 +1840,7 @@@ err
        return ret;
  }
  
 -static int __devexit atmel_serial_remove(struct platform_device *pdev)
 +static int atmel_serial_remove(struct platform_device *pdev)
  {
        struct uart_port *port = platform_get_drvdata(pdev);
        struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
  
  static struct platform_driver atmel_serial_driver = {
        .probe          = atmel_serial_probe,
 -      .remove         = __devexit_p(atmel_serial_remove),
 +      .remove         = atmel_serial_remove,
        .suspend        = atmel_serial_suspend,
        .resume         = atmel_serial_resume,
        .driver         = {
@@@ -31,6 -31,7 +31,7 @@@
  #include <linux/usb/gadget.h>
  #include <linux/of.h>
  #include <linux/of_gpio.h>
+ #include <linux/platform_data/atmel.h>
  
  #include <asm/byteorder.h>
  #include <mach/hardware.h>
@@@ -38,7 -39,6 +39,6 @@@
  #include <asm/irq.h>
  #include <asm/gpio.h>
  
- #include <mach/board.h>
  #include <mach/cpu.h>
  #include <mach/at91sam9261_matrix.h>
  #include <mach/at91_matrix.h>
@@@ -1673,7 -1673,7 +1673,7 @@@ static void at91udc_shutdown(struct pla
        spin_unlock_irqrestore(&udc->lock, flags);
  }
  
 -static void __devinit at91udc_of_init(struct at91_udc *udc,
 +static void at91udc_of_init(struct at91_udc *udc,
                                     struct device_node *np)
  {
        struct at91_udc_data *board = &udc->board;
        board->pullup_active_low = (flags & OF_GPIO_ACTIVE_LOW) ? 1 : 0;
  }
  
 -static int __devinit at91udc_probe(struct platform_device *pdev)
 +static int at91udc_probe(struct platform_device *pdev)
  {
        struct device   *dev = &pdev->dev;
        struct at91_udc *udc;
@@@ -44,7 -44,7 +44,7 @@@
  #include <asm/unaligned.h>
  #include <asm/mach-types.h>
  
- #include <plat/dma.h>
+ #include <plat-omap/dma-omap.h>
  
  #include <mach/usb.h>
  
@@@ -61,6 -61,8 +61,8 @@@
  #define       DRIVER_DESC     "OMAP UDC driver"
  #define       DRIVER_VERSION  "4 October 2004"
  
+ #define OMAP_DMA_USB_W2FC_TX0         29
  /*
   * The OMAP UDC needs _very_ early endpoint setup:  before enabling the
   * D+ pullup to allow enumeration.  That's too early for the gadget
@@@ -2506,7 -2508,7 +2508,7 @@@ static inline void remove_proc_file(voi
   * UDC_SYSCON_1.CFG_LOCK is set can now work.  We won't use that
   * capability yet though.
   */
 -static unsigned __devinit
 +static unsigned
  omap_ep_setup(char *name, u8 addr, u8 type,
                unsigned buf, unsigned maxp, int dbuf)
  {
@@@ -2624,7 -2626,7 +2626,7 @@@ static void omap_udc_release(struct dev
        udc = NULL;
  }
  
 -static int __devinit
 +static int
  omap_udc_setup(struct platform_device *odev, struct usb_phy *xceiv)
  {
        unsigned        tmp, buf;
        return 0;
  }
  
 -static int __devinit omap_udc_probe(struct platform_device *pdev)
 +static int omap_udc_probe(struct platform_device *pdev)
  {
        int                     status = -ENODEV;
        int                     hmc;
@@@ -2974,7 -2976,7 +2976,7 @@@ cleanup0
        return status;
  }
  
 -static int __devexit omap_udc_remove(struct platform_device *pdev)
 +static int omap_udc_remove(struct platform_device *pdev)
  {
        DECLARE_COMPLETION_ONSTACK(done);
  
@@@ -3060,7 -3062,7 +3062,7 @@@ static int omap_udc_resume(struct platf
  
  static struct platform_driver udc_driver = {
        .probe          = omap_udc_probe,
 -      .remove         = __devexit_p(omap_udc_remove),
 +      .remove         = omap_udc_remove,
        .suspend        = omap_udc_suspend,
        .resume         = omap_udc_resume,
        .driver         = {
  #include <linux/platform_device.h>
  #include <linux/slab.h>
  #include <linux/usb/ulpi.h>
- #include <plat/usb.h>
  #include <linux/regulator/consumer.h>
  #include <linux/pm_runtime.h>
  #include <linux/gpio.h>
  #include <linux/clk.h>
  
+ #include <linux/platform_data/usb-omap.h>
  /* EHCI Register Set */
  #define EHCI_INSNREG04                                        (0xA0)
  #define EHCI_INSNREG04_DISABLE_UNSUSPEND              (1 << 5)
@@@ -146,6 -147,9 +147,6 @@@ static int omap_ehci_init(struct usb_hc
                        gpio_set_value_cansleep(pdata->reset_gpio_port[1], 1);
        }
  
 -      /* root ports should always stay powered */
 -      ehci_port_power(ehci, 1);
 -
        return rc;
  }
  
  #include <linux/platform_device.h>
  #include <linux/of_platform.h>
  #include <linux/of_gpio.h>
+ #include <linux/platform_data/atmel.h>
  
  #include <mach/hardware.h>
  #include <asm/gpio.h>
  
- #include <mach/board.h>
  #include <mach/cpu.h>
  
  #ifndef CONFIG_ARCH_AT91
@@@ -94,7 -94,7 +94,7 @@@ static void at91_stop_hc(struct platfor
  
  /*-------------------------------------------------------------------------*/
  
 -static void __devexit usb_hcd_at91_remove (struct usb_hcd *, struct platform_device *);
 +static void usb_hcd_at91_remove (struct usb_hcd *, struct platform_device *);
  
  /* configure so an HC device and id are always provided */
  /* always called with process context; sleeping is OK */
   * then invokes the start() method for the HCD associated with it
   * through the hotplug entry's driver_data.
   */
 -static int __devinit usb_hcd_at91_probe(const struct hc_driver *driver,
 +static int usb_hcd_at91_probe(const struct hc_driver *driver,
                        struct platform_device *pdev)
  {
        int retval;
   * context, "rmmod" or something similar.
   *
   */
 -static void __devexit usb_hcd_at91_remove(struct usb_hcd *hcd,
 +static void usb_hcd_at91_remove(struct usb_hcd *hcd,
                                struct platform_device *pdev)
  {
        usb_remove_hcd(hcd);
  
  /*-------------------------------------------------------------------------*/
  
 -static int __devinit
 +static int
  ohci_at91_reset (struct usb_hcd *hcd)
  {
        struct at91_usbh_data   *board = hcd->self.controller->platform_data;
        return 0;
  }
  
 -static int __devinit
 +static int
  ohci_at91_start (struct usb_hcd *hcd)
  {
        struct ohci_hcd         *ohci = hcd_to_ohci (hcd);
@@@ -506,7 -506,7 +506,7 @@@ MODULE_DEVICE_TABLE(of, at91_ohci_dt_id
  
  static u64 at91_ohci_dma_mask = DMA_BIT_MASK(32);
  
 -static int __devinit ohci_at91_of_init(struct platform_device *pdev)
 +static int ohci_at91_of_init(struct platform_device *pdev)
  {
        struct device_node *np = pdev->dev.of_node;
        int i, gpio;
        return 0;
  }
  #else
 -static int __devinit ohci_at91_of_init(struct platform_device *pdev)
 +static int ohci_at91_of_init(struct platform_device *pdev)
  {
        return 0;
  }
  
  /*-------------------------------------------------------------------------*/
  
 -static int __devinit ohci_hcd_at91_drv_probe(struct platform_device *pdev)
 +static int ohci_hcd_at91_drv_probe(struct platform_device *pdev)
  {
        struct at91_usbh_data   *pdata;
        int                     i;
        return usb_hcd_at91_probe(&ohci_at91_hc_driver, pdev);
  }
  
 -static int __devexit ohci_hcd_at91_drv_remove(struct platform_device *pdev)
 +static int ohci_hcd_at91_drv_remove(struct platform_device *pdev)
  {
        struct at91_usbh_data   *pdata = pdev->dev.platform_data;
        int                     i;
@@@ -705,7 -705,7 +705,7 @@@ static int ohci_hcd_at91_drv_resume(str
        if (!clocked)
                at91_start_clock();
  
 -      ohci_finish_controller_resume(hcd);
 +      ohci_resume(hcd, false);
        return 0;
  }
  #else
@@@ -717,7 -717,7 +717,7 @@@ MODULE_ALIAS("platform:at91_ohci")
  
  static struct platform_driver ohci_hcd_at91_driver = {
        .probe          = ohci_hcd_at91_drv_probe,
 -      .remove         = __devexit_p(ohci_hcd_at91_drv_remove),
 +      .remove         = ohci_hcd_at91_drv_remove,
        .shutdown       = usb_hcd_platform_shutdown,
        .suspend        = ohci_hcd_at91_drv_suspend,
        .resume         = ohci_hcd_at91_drv_resume,
@@@ -25,7 -25,6 +25,6 @@@
  #include <asm/mach-types.h>
  
  #include <mach/mux.h>
- #include <plat/fpga.h>
  
  #include <mach/hardware.h>
  #include <mach/irqs.h>
@@@ -93,14 -92,14 +92,14 @@@ static int omap_ohci_transceiver_power(
  {
        if (on) {
                if (machine_is_omap_innovator() && cpu_is_omap1510())
-                       fpga_write(fpga_read(INNOVATOR_FPGA_CAM_USB_CONTROL)
+                       __raw_writeb(__raw_readb(INNOVATOR_FPGA_CAM_USB_CONTROL)
                                | ((1 << 5/*usb1*/) | (1 << 3/*usb2*/)),
                               INNOVATOR_FPGA_CAM_USB_CONTROL);
                else if (machine_is_omap_osk())
                        tps65010_set_gpio_out_value(GPIO1, LOW);
        } else {
                if (machine_is_omap_innovator() && cpu_is_omap1510())
-                       fpga_write(fpga_read(INNOVATOR_FPGA_CAM_USB_CONTROL)
+                       __raw_writeb(__raw_readb(INNOVATOR_FPGA_CAM_USB_CONTROL)
                                & ~((1 << 5/*usb1*/) | (1 << 3/*usb2*/)),
                               INNOVATOR_FPGA_CAM_USB_CONTROL);
                else if (machine_is_omap_osk())
@@@ -530,7 -529,7 +529,7 @@@ static int ohci_omap_resume(struct plat
        ohci->next_statechange = jiffies;
  
        omap_ohci_clock_power(1);
 -      ohci_finish_controller_resume(hcd);
 +      ohci_resume(hcd, false);
        return 0;
  }
  
@@@ -30,7 -30,6 +30,6 @@@
   */
  
  #include <linux/platform_device.h>
- #include <plat/usb.h>
  #include <linux/pm_runtime.h>
  
  /*-------------------------------------------------------------------------*/
@@@ -125,7 -124,7 +124,7 @@@ static const struct hc_driver ohci_omap
   * then invokes the start() method for the HCD associated with it
   * through the hotplug entry's driver_data.
   */
 -static int __devinit ohci_hcd_omap3_probe(struct platform_device *pdev)
 +static int ohci_hcd_omap3_probe(struct platform_device *pdev)
  {
        struct device           *dev = &pdev->dev;
        struct usb_hcd          *hcd = NULL;
@@@ -209,7 -208,7 +208,7 @@@ err_io
   * the HCD's stop() method.  It is always called from a thread
   * context, normally "rmmod", "apmd", or something similar.
   */
 -static int __devexit ohci_hcd_omap3_remove(struct platform_device *pdev)
 +static int ohci_hcd_omap3_remove(struct platform_device *pdev)
  {
        struct device *dev      = &pdev->dev;
        struct usb_hcd *hcd     = dev_get_drvdata(dev);
@@@ -232,7 -231,7 +231,7 @@@ static void ohci_hcd_omap3_shutdown(str
  
  static struct platform_driver ohci_hcd_omap3_driver = {
        .probe          = ohci_hcd_omap3_probe,
 -      .remove         = __devexit_p(ohci_hcd_omap3_remove),
 +      .remove         = ohci_hcd_omap3_remove,
        .shutdown       = ohci_hcd_omap3_shutdown,
        .driver         = {
                .name   = "ohci-omap3",
diff --combined drivers/usb/musb/am35x.c
@@@ -34,8 -34,7 +34,7 @@@
  #include <linux/platform_device.h>
  #include <linux/dma-mapping.h>
  #include <linux/usb/nop-usb-xceiv.h>
- #include <plat/usb.h>
+ #include <linux/platform_data/usb-omap.h>
  
  #include "musb_core.h"
  
@@@ -455,7 -454,7 +454,7 @@@ static const struct musb_platform_ops a
  
  static u64 am35x_dmamask = DMA_BIT_MASK(32);
  
 -static int __devinit am35x_probe(struct platform_device *pdev)
 +static int am35x_probe(struct platform_device *pdev)
  {
        struct musb_hdrc_platform_data  *pdata = pdev->dev.platform_data;
        struct platform_device          *musb;
        struct clk                      *clk;
  
        int                             ret = -ENOMEM;
 -      int                             musbid;
  
        glue = kzalloc(sizeof(*glue), GFP_KERNEL);
        if (!glue) {
                goto err0;
        }
  
 -      /* get the musb id */
 -      musbid = musb_get_id(&pdev->dev, GFP_KERNEL);
 -      if (musbid < 0) {
 -              dev_err(&pdev->dev, "failed to allocate musb id\n");
 -              ret = -ENOMEM;
 -              goto err1;
 -      }
 -
 -      musb = platform_device_alloc("musb-hdrc", musbid);
 +      musb = platform_device_alloc("musb-hdrc", PLATFORM_DEVID_AUTO);
        if (!musb) {
                dev_err(&pdev->dev, "failed to allocate musb device\n");
 -              goto err2;
 +              goto err1;
        }
  
        phy_clk = clk_get(&pdev->dev, "fck");
                goto err6;
        }
  
 -      musb->id                        = musbid;
        musb->dev.parent                = &pdev->dev;
        musb->dev.dma_mask              = &am35x_dmamask;
        musb->dev.coherent_dma_mask     = am35x_dmamask;
@@@ -553,6 -562,9 +552,6 @@@ err4
  err3:
        platform_device_put(musb);
  
 -err2:
 -      musb_put_id(&pdev->dev, musbid);
 -
  err1:
        kfree(glue);
  
@@@ -560,11 -572,13 +559,11 @@@ err0
        return ret;
  }
  
 -static int __devexit am35x_remove(struct platform_device *pdev)
 +static int am35x_remove(struct platform_device *pdev)
  {
        struct am35x_glue       *glue = platform_get_drvdata(pdev);
  
 -      musb_put_id(&pdev->dev, glue->musb->id);
 -      platform_device_del(glue->musb);
 -      platform_device_put(glue->musb);
 +      platform_device_unregister(glue->musb);
        clk_disable(glue->clk);
        clk_disable(glue->phy_clk);
        clk_put(glue->clk);
@@@ -629,7 -643,7 +628,7 @@@ static struct dev_pm_ops am35x_pm_ops 
  
  static struct platform_driver am35x_driver = {
        .probe          = am35x_probe,
 -      .remove         = __devexit_p(am35x_remove),
 +      .remove         = am35x_remove,
        .driver         = {
                .name   = "musb-am35x",
                .pm     = DEV_PM_OPS,
  MODULE_DESCRIPTION("AM35x MUSB Glue Layer");
  MODULE_AUTHOR("Ajay Kumar Gupta <ajay.gupta@ti.com>");
  MODULE_LICENSE("GPL v2");
 -
 -static int __init am35x_init(void)
 -{
 -      return platform_driver_register(&am35x_driver);
 -}
 -module_init(am35x_init);
 -
 -static void __exit am35x_exit(void)
 -{
 -      platform_driver_unregister(&am35x_driver);
 -}
 -module_exit(am35x_exit);
 +module_platform_driver(am35x_driver);
  #include <linux/pm_runtime.h>
  #include <linux/module.h>
  #include <linux/usb/nop-usb-xceiv.h>
+ #include <linux/platform_data/usb-omap.h>
  
  #include <linux/of.h>
  #include <linux/of_device.h>
  #include <linux/of_address.h>
  
- #include <plat/usb.h>
  #include "musb_core.h"
  
  #ifdef CONFIG_OF
@@@ -124,44 -123,8 +123,44 @@@ struct dsps_glue 
        const struct dsps_musb_wrapper *wrp; /* wrapper register offsets */
        struct timer_list timer[2];     /* otg_workaround timer */
        unsigned long last_timer[2];    /* last timer data for each instance */
 +      u32 __iomem *usb_ctrl[2];
  };
  
 +#define       DSPS_AM33XX_CONTROL_MODULE_PHYS_0       0x44e10620
 +#define       DSPS_AM33XX_CONTROL_MODULE_PHYS_1       0x44e10628
 +
 +static const resource_size_t dsps_control_module_phys[] = {
 +      DSPS_AM33XX_CONTROL_MODULE_PHYS_0,
 +      DSPS_AM33XX_CONTROL_MODULE_PHYS_1,
 +};
 +
 +/**
 + * musb_dsps_phy_control - phy on/off
 + * @glue: struct dsps_glue *
 + * @id: musb instance
 + * @on: flag for phy to be switched on or off
 + *
 + * This is to enable the PHY using usb_ctrl register in system control
 + * module space.
 + *
 + * XXX: This function will be removed once we have a seperate driver for
 + * control module
 + */
 +static void musb_dsps_phy_control(struct dsps_glue *glue, u8 id, u8 on)
 +{
 +      u32 usbphycfg;
 +
 +      usbphycfg = readl(glue->usb_ctrl[id]);
 +
 +      if (on) {
 +              usbphycfg &= ~(USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN);
 +              usbphycfg |= USBPHY_OTGVDET_EN | USBPHY_OTGSESSEND_EN;
 +      } else {
 +              usbphycfg |= USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN;
 +      }
 +
 +      writel(usbphycfg, glue->usb_ctrl[id]);
 +}
  /**
   * dsps_musb_enable - enable interrupts
   */
@@@ -332,7 -295,7 +331,7 @@@ static irqreturn_t dsps_interrupt(int i
         * Also, DRVVBUS pulses for SRP (but not at 5V) ...
         */
        if (usbintr & MUSB_INTR_BABBLE)
 -              pr_info("CAUTION: musb: Babble Interrupt Occured\n");
 +              pr_info("CAUTION: musb: Babble Interrupt Occurred\n");
  
        if (usbintr & ((1 << wrp->drvvbus) << wrp->usb_shift)) {
                int drvvbus = dsps_readl(reg_base, wrp->status);
  static int dsps_musb_init(struct musb *musb)
  {
        struct device *dev = musb->controller;
 -      struct musb_hdrc_platform_data *plat = dev->platform_data;
        struct platform_device *pdev = to_platform_device(dev);
        struct dsps_glue *glue = dev_get_drvdata(dev->parent);
        const struct dsps_musb_wrapper *wrp = glue->wrp;
 -      struct omap_musb_board_data *data = plat->board_data;
        void __iomem *reg_base = musb->ctrl_base;
        u32 rev, val;
        int status;
        /* mentor core register starts at offset of 0x400 from musb base */
        musb->mregs += wrp->musb_core_offset;
  
 -      /* Get the NOP PHY */
 +      /* NOP driver needs change if supporting dual instance */
 +      usb_nop_xceiv_register();
        musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
        if (IS_ERR_OR_NULL(musb->xceiv))
                return -ENODEV;
        dsps_writel(reg_base, wrp->control, (1 << wrp->reset));
  
        /* Start the on-chip PHY and its PLL. */
 -      if (data->set_phy_power)
 -              data->set_phy_power(1);
 +      musb_dsps_phy_control(glue, pdev->id, 1);
  
        musb->isr = dsps_interrupt;
  
@@@ -452,13 -417,16 +451,13 @@@ err0
  static int dsps_musb_exit(struct musb *musb)
  {
        struct device *dev = musb->controller;
 -      struct musb_hdrc_platform_data *plat = dev->platform_data;
 -      struct omap_musb_board_data *data = plat->board_data;
        struct platform_device *pdev = to_platform_device(dev);
        struct dsps_glue *glue = dev_get_drvdata(dev->parent);
  
        del_timer_sync(&glue->timer[pdev->id]);
  
        /* Shutdown the on-chip PHY and its PLL. */
 -      if (data->set_phy_power)
 -              data->set_phy_power(0);
 +      musb_dsps_phy_control(glue, pdev->id, 0);
  
        /* NOP driver needs change if supporting dual instance */
        usb_put_phy(musb->xceiv);
@@@ -479,7 -447,7 +478,7 @@@ static struct musb_platform_ops dsps_op
  
  static u64 musb_dmamask = DMA_BIT_MASK(32);
  
 -static int __devinit dsps_create_musb_pdev(struct dsps_glue *glue, u8 id)
 +static int dsps_create_musb_pdev(struct dsps_glue *glue, u8 id)
  {
        struct device *dev = glue->dev;
        struct platform_device *pdev = to_platform_device(dev);
        struct resource *res;
        struct resource resources[2];
        char res_name[11];
 -      int ret, musbid;
 +      int ret;
  
 -      /* get memory resource */
 -      snprintf(res_name, sizeof(res_name), "musb%d", id);
 -      res = platform_get_resource_byname(pdev, IORESOURCE_MEM, res_name);
 +      resources[0].start = dsps_control_module_phys[id];
 +      resources[0].end = resources[0].start + SZ_4 - 1;
 +      resources[0].flags = IORESOURCE_MEM;
 +
 +      glue->usb_ctrl[id] = devm_request_and_ioremap(&pdev->dev, resources);
 +      if (glue->usb_ctrl[id] == NULL) {
 +              dev_err(dev, "Failed to obtain usb_ctrl%d memory\n", id);
 +              ret = -ENODEV;
 +              goto err0;
 +      }
 +
 +      /* first resource is for usbss, so start index from 1 */
 +      res = platform_get_resource(pdev, IORESOURCE_MEM, id + 1);
        if (!res) {
 -              dev_err(dev, "%s get mem resource failed\n", res_name);
 +              dev_err(dev, "failed to get memory for instance %d\n", id);
                ret = -ENODEV;
                goto err0;
        }
        res->parent = NULL;
        resources[0] = *res;
  
 -      /* get irq resource */
 -      snprintf(res_name, sizeof(res_name), "musb%d-irq", id);
 -      res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, res_name);
 +      /* first resource is for usbss, so start index from 1 */
 +      res = platform_get_resource(pdev, IORESOURCE_IRQ, id + 1);
        if (!res) {
 -              dev_err(dev, "%s get irq resource failed\n", res_name);
 +              dev_err(dev, "failed to get irq for instance %d\n", id);
                ret = -ENODEV;
                goto err0;
        }
        resources[1] = *res;
        resources[1].name = "mc";
  
 -      /* get the musb id */
 -      musbid = musb_get_id(dev, GFP_KERNEL);
 -      if (musbid < 0) {
 -              dev_err(dev, "failed to allocate musb id\n");
 -              ret = -ENOMEM;
 -              goto err0;
 -      }
        /* allocate the child platform device */
 -      musb = platform_device_alloc("musb-hdrc", musbid);
 +      musb = platform_device_alloc("musb-hdrc", PLATFORM_DEVID_AUTO);
        if (!musb) {
                dev_err(dev, "failed to allocate musb device\n");
                ret = -ENOMEM;
 -              goto err1;
 +              goto err0;
        }
  
 -      musb->id                        = musbid;
        musb->dev.parent                = dev;
        musb->dev.dma_mask              = &musb_dmamask;
        musb->dev.coherent_dma_mask     = musb_dmamask;
  
  err2:
        platform_device_put(musb);
 -err1:
 -      musb_put_id(dev, musbid);
  err0:
        return ret;
  }
  
 -static void dsps_delete_musb_pdev(struct dsps_glue *glue, u8 id)
 -{
 -      musb_put_id(glue->dev, glue->musb[id]->id);
 -      platform_device_del(glue->musb[id]);
 -      platform_device_put(glue->musb[id]);
 -}
 -
 -static int __devinit dsps_probe(struct platform_device *pdev)
 +static int dsps_probe(struct platform_device *pdev)
  {
        struct device_node *np = pdev->dev.of_node;
        const struct of_device_id *match;
                        dev_err(&pdev->dev, "failed to create child pdev\n");
                        /* release resources of previously created instances */
                        for (i--; i >= 0 ; i--)
 -                              dsps_delete_musb_pdev(glue, i);
 +                              platform_device_unregister(glue->musb[i]);
                        goto err3;
                }
        }
@@@ -668,7 -644,7 +667,7 @@@ err1
  err0:
        return ret;
  }
 -static int __devexit dsps_remove(struct platform_device *pdev)
 +static int dsps_remove(struct platform_device *pdev)
  {
        struct dsps_glue *glue = platform_get_drvdata(pdev);
        const struct dsps_musb_wrapper *wrp = glue->wrp;
  
        /* delete the child platform device */
        for (i = 0; i < wrp->instances ; i++)
 -              dsps_delete_musb_pdev(glue, i);
 +              platform_device_unregister(glue->musb[i]);
  
        /* disable usbss clocks */
        pm_runtime_put(&pdev->dev);
  #ifdef CONFIG_PM_SLEEP
  static int dsps_suspend(struct device *dev)
  {
 -      struct musb_hdrc_platform_data *plat = dev->platform_data;
 -      struct omap_musb_board_data *data = plat->board_data;
 +      struct platform_device *pdev = to_platform_device(dev->parent);
 +      struct dsps_glue *glue = platform_get_drvdata(pdev);
 +      const struct dsps_musb_wrapper *wrp = glue->wrp;
 +      int i;
  
 -      /* Shutdown the on-chip PHY and its PLL. */
 -      if (data->set_phy_power)
 -              data->set_phy_power(0);
 +      for (i = 0; i < wrp->instances; i++)
 +              musb_dsps_phy_control(glue, i, 0);
  
        return 0;
  }
  
  static int dsps_resume(struct device *dev)
  {
 -      struct musb_hdrc_platform_data *plat = dev->platform_data;
 -      struct omap_musb_board_data *data = plat->board_data;
 +      struct platform_device *pdev = to_platform_device(dev->parent);
 +      struct dsps_glue *glue = platform_get_drvdata(pdev);
 +      const struct dsps_musb_wrapper *wrp = glue->wrp;
 +      int i;
  
 -      /* Start the on-chip PHY and its PLL. */
 -      if (data->set_phy_power)
 -              data->set_phy_power(1);
 +      for (i = 0; i < wrp->instances; i++)
 +              musb_dsps_phy_control(glue, i, 1);
  
        return 0;
  }
  
  static SIMPLE_DEV_PM_OPS(dsps_pm_ops, dsps_suspend, dsps_resume);
  
 -static const struct dsps_musb_wrapper ti81xx_driver_data __devinitconst = {
 +static const struct dsps_musb_wrapper ti81xx_driver_data = {
        .revision               = 0x00,
        .control                = 0x14,
        .status                 = 0x18,
        .rxep_bitmap            = (0xfffe << 16),
        .musb_core_offset       = 0x400,
        .poll_seconds           = 2,
 -      .instances              = 2,
 +      .instances              = 1,
  };
  
 -static const struct platform_device_id musb_dsps_id_table[] __devinitconst = {
 +static const struct platform_device_id musb_dsps_id_table[] = {
        {
                .name   = "musb-ti81xx",
                .driver_data    = (kernel_ulong_t) &ti81xx_driver_data,
  MODULE_DEVICE_TABLE(platform, musb_dsps_id_table);
  
  #ifdef CONFIG_OF
 -static const struct of_device_id musb_dsps_of_match[] __devinitconst = {
 +static const struct of_device_id musb_dsps_of_match[] = {
        { .compatible = "ti,musb-am33xx",
                .data = (void *) &ti81xx_driver_data, },
        {  },
@@@ -767,7 -741,7 +766,7 @@@ MODULE_DEVICE_TABLE(of, musb_dsps_of_ma
  
  static struct platform_driver dsps_usbss_driver = {
        .probe          = dsps_probe,
 -      .remove         = __devexit_p(dsps_remove),
 +      .remove         = dsps_remove,
        .driver         = {
                .name   = "musb-dsps",
                .pm     = &dsps_pm_ops,
@@@ -16,7 -16,7 +16,7 @@@
  #include <linux/platform_device.h>
  #include <linux/dma-mapping.h>
  #include <linux/slab.h>
- #include <plat/dma.h>
+ #include <plat-omap/dma-omap.h>
  
  #include "musb_core.h"
  #include "tusb6010.h"
  
  #define MAX_DMAREQ            5       /* REVISIT: Really 6, but req5 not OK */
  
+ #define OMAP24XX_DMA_EXT_DMAREQ0      2
+ #define OMAP24XX_DMA_EXT_DMAREQ1      3
+ #define OMAP242X_DMA_EXT_DMAREQ2      14
+ #define OMAP242X_DMA_EXT_DMAREQ3      15
+ #define OMAP242X_DMA_EXT_DMAREQ4      16
+ #define OMAP242X_DMA_EXT_DMAREQ5      64
  struct tusb_omap_dma_ch {
        struct musb             *musb;
        void __iomem            *tbase;
@@@ -661,7 -668,8 +668,7 @@@ void dma_controller_destroy(struct dma_
        kfree(tusb_dma);
  }
  
 -struct dma_controller *__devinit
 -dma_controller_create(struct musb *musb, void __iomem *base)
 +struct dma_controller *dma_controller_create(struct musb *musb, void __iomem *base)
  {
        void __iomem            *tbase = musb->ctrl_base;
        struct tusb_omap_dma    *tusb_dma;
@@@ -35,8 -35,6 +35,6 @@@
  
  #include <video/omapdss.h>
  
- #include <plat/cpu.h>
  #include "dss.h"
  #include "dss_features.h"
  
@@@ -697,15 -695,11 +695,15 @@@ static int dss_get_clocks(void
  
        dss.dss_clk = clk;
  
 -      clk = clk_get(NULL, dss.feat->clk_name);
 -      if (IS_ERR(clk)) {
 -              DSSERR("Failed to get %s\n", dss.feat->clk_name);
 -              r = PTR_ERR(clk);
 -              goto err;
 +      if (dss.feat->clk_name) {
 +              clk = clk_get(NULL, dss.feat->clk_name);
 +              if (IS_ERR(clk)) {
 +                      DSSERR("Failed to get %s\n", dss.feat->clk_name);
 +                      r = PTR_ERR(clk);
 +                      goto err;
 +              }
 +      } else {
 +              clk = NULL;
        }
  
        dss.dpll4_m4_ck = clk;
@@@ -796,29 -790,46 +794,46 @@@ static const struct dss_features omap54
        .dpi_select_source      =       &dss_dpi_select_source_omap5,
  };
  
- static int __init dss_init_features(struct device *dev)
+ static int __init dss_init_features(struct platform_device *pdev)
  {
+       struct omap_dss_board_info *pdata = pdev->dev.platform_data;
        const struct dss_features *src;
        struct dss_features *dst;
  
-       dst = devm_kzalloc(dev, sizeof(*dst), GFP_KERNEL);
+       dst = devm_kzalloc(&pdev->dev, sizeof(*dst), GFP_KERNEL);
        if (!dst) {
-               dev_err(dev, "Failed to allocate local DSS Features\n");
+               dev_err(&pdev->dev, "Failed to allocate local DSS Features\n");
                return -ENOMEM;
        }
  
-       if (cpu_is_omap24xx())
+       switch (pdata->version) {
+       case OMAPDSS_VER_OMAP24xx:
                src = &omap24xx_dss_feats;
-       else if (cpu_is_omap3630())
-               src = &omap3630_dss_feats;
-       else if (cpu_is_omap34xx())
+               break;
+       case OMAPDSS_VER_OMAP34xx_ES1:
+       case OMAPDSS_VER_OMAP34xx_ES3:
+       case OMAPDSS_VER_AM35xx:
                src = &omap34xx_dss_feats;
-       else if (cpu_is_omap44xx())
+               break;
+       case OMAPDSS_VER_OMAP3630:
+               src = &omap3630_dss_feats;
+               break;
+       case OMAPDSS_VER_OMAP4430_ES1:
+       case OMAPDSS_VER_OMAP4430_ES2:
+       case OMAPDSS_VER_OMAP4:
                src = &omap44xx_dss_feats;
-       else if (soc_is_omap54xx())
+               break;
+       case OMAPDSS_VER_OMAP5:
                src = &omap54xx_dss_feats;
-       else
+               break;
+       default:
                return -ENODEV;
+       }
  
        memcpy(dst, src, sizeof(*dst));
        dss.feat = dst;
@@@ -835,7 -846,7 +850,7 @@@ static int __init omap_dsshw_probe(stru
  
        dss.pdev = pdev;
  
-       r = dss_init_features(&dss.pdev->dev);
+       r = dss_init_features(dss.pdev);
        if (r)
                return r;
  
@@@ -323,6 -323,7 +323,7 @@@ static void hdmi_runtime_put(void
  
  static int __init hdmi_init_display(struct omap_dss_device *dssdev)
  {
+       struct omap_dss_board_info *pdata = hdmi.pdev->dev.platform_data;
        int r;
  
        struct gpio gpios[] = {
  
        DSSDBG("init_display\n");
  
-       dss_init_hdmi_ip_ops(&hdmi.ip_data);
+       dss_init_hdmi_ip_ops(&hdmi.ip_data, pdata->version);
  
        if (hdmi.vdda_hdmi_dac_reg == NULL) {
                struct regulator *reg;
@@@ -644,10 -645,8 +645,10 @@@ static void hdmi_dump_regs(struct seq_f
  {
        mutex_lock(&hdmi.lock);
  
 -      if (hdmi_runtime_get())
 +      if (hdmi_runtime_get()) {
 +              mutex_unlock(&hdmi.lock);
                return;
 +      }
  
        hdmi.ip_data.ops->dump_wrapper(&hdmi.ip_data, s);
        hdmi.ip_data.ops->dump_pll(&hdmi.ip_data, s);
@@@ -30,7 -30,7 +30,7 @@@
  #include <linux/export.h>
  
  #include <video/omapdss.h>
- #include <plat/vrfb.h>
+ #include <video/omapvrfb.h>
  #include <plat/vram.h>
  
  #include "omapfb.h"
@@@ -787,7 -787,7 +787,7 @@@ int omapfb_ioctl(struct fb_info *fbi, u
  
        case OMAPFB_WAITFORVSYNC:
                DBG("ioctl WAITFORVSYNC\n");
 -              if (!display && !display->output && !display->output->manager) {
 +              if (!display || !display->output || !display->output->manager) {
                        r = -EINVAL;
                        break;
                }
index 0000000,2bf6ea8..2bf1b30
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,150 +1,151 @@@
 -#define MMC_OMAP7XX           (1 << 2)
 -#define MMC_OMAP15XX          (1 << 3)
 -#define MMC_OMAP16XX          (1 << 4)
+ /*
+  * MMC definitions for OMAP2
+  *
+  * Copyright (C) 2006 Nokia Corporation
+  *
+  * This program is free software; you can redistribute it and/or modify
+  * it under the terms of the GNU General Public License version 2 as
+  * published by the Free Software Foundation.
+  */
+ #define OMAP_MMC_MAX_SLOTS    2
+ /*
+  * struct omap_mmc_dev_attr.flags possibilities
+  *
+  * OMAP_HSMMC_SUPPORTS_DUAL_VOLT: Some HSMMC controller instances can
+  *    operate with either 1.8Vdc or 3.0Vdc card voltages; this flag
+  *    should be set if this is the case.  See for example Section 22.5.3
+  *    "MMC/SD/SDIO1 Bus Voltage Selection" of the OMAP34xx Multimedia
+  *    Device Silicon Revision 3.1.x Revision ZR (July 2011) (SWPU223R).
+  *
+  * OMAP_HSMMC_BROKEN_MULTIBLOCK_READ: Multiple-block read transfers
+  *    don't work correctly on some MMC controller instances on some
+  *    OMAP3 SoCs; this flag should be set if this is the case.  See
+  *    for example Advisory 2.1.1.128 "MMC: Multiple Block Read
+  *    Operation Issue" in _OMAP3530/3525/3515/3503 Silicon Errata_
+  *    Revision F (October 2010) (SPRZ278F).
+  */
+ #define OMAP_HSMMC_SUPPORTS_DUAL_VOLT         BIT(0)
+ #define OMAP_HSMMC_BROKEN_MULTIBLOCK_READ     BIT(1)
+ struct mmc_card;
+ struct omap_mmc_dev_attr {
+       u8 flags;
+ };
+ struct omap_mmc_platform_data {
+       /* back-link to device */
+       struct device *dev;
+       /* number of slots per controller */
+       unsigned nr_slots:2;
+       /* set if your board has components or wiring that limits the
+        * maximum frequency on the MMC bus */
+       unsigned int max_freq;
+       /* switch the bus to a new slot */
+       int (*switch_slot)(struct device *dev, int slot);
+       /* initialize board-specific MMC functionality, can be NULL if
+        * not supported */
+       int (*init)(struct device *dev);
+       void (*cleanup)(struct device *dev);
+       void (*shutdown)(struct device *dev);
+       /* To handle board related suspend/resume functionality for MMC */
+       int (*suspend)(struct device *dev, int slot);
+       int (*resume)(struct device *dev, int slot);
+       /* Return context loss count due to PM states changing */
+       int (*get_context_loss_count)(struct device *dev);
+       /* Integrating attributes from the omap_hwmod layer */
+       u8 controller_flags;
+       /* Register offset deviation */
+       u16 reg_offset;
+       struct omap_mmc_slot_data {
+               /*
+                * 4/8 wires and any additional host capabilities
+                * need to OR'd all capabilities (ref. linux/mmc/host.h)
+                */
+               u8  wires;      /* Used for the MMC driver on omap1 and 2420 */
+               u32 caps;       /* Used for the MMC driver on 2430 and later */
+               u32 pm_caps;    /* PM capabilities of the mmc */
+               /*
+                * nomux means "standard" muxing is wrong on this board, and
+                * that board-specific code handled it before common init logic.
+                */
+               unsigned nomux:1;
+               /* switch pin can be for card detect (default) or card cover */
+               unsigned cover:1;
+               /* use the internal clock */
+               unsigned internal_clock:1;
+               /* nonremovable e.g. eMMC */
+               unsigned nonremovable:1;
+               /* Try to sleep or power off when possible */
+               unsigned power_saving:1;
+               /* If using power_saving and the MMC power is not to go off */
+               unsigned no_off:1;
+               /* eMMC does not handle power off when not in sleep state */
+               unsigned no_regulator_off_init:1;
+               /* Regulator off remapped to sleep */
+               unsigned vcc_aux_disable_is_sleep:1;
+               /* we can put the features above into this variable */
+ #define HSMMC_HAS_PBIAS               (1 << 0)
+ #define HSMMC_HAS_UPDATED_RESET       (1 << 1)
++#define HSMMC_HAS_HSPE_SUPPORT        (1 << 2)
++#define MMC_OMAP7XX           (1 << 3)
++#define MMC_OMAP15XX          (1 << 4)
++#define MMC_OMAP16XX          (1 << 5)
+               unsigned features;
+               int switch_pin;                 /* gpio (card detect) */
+               int gpio_wp;                    /* gpio (write protect) */
+               int (*set_bus_mode)(struct device *dev, int slot, int bus_mode);
+               int (*set_power)(struct device *dev, int slot,
+                                int power_on, int vdd);
+               int (*get_ro)(struct device *dev, int slot);
+               void (*remux)(struct device *dev, int slot, int power_on);
+               /* Call back before enabling / disabling regulators */
+               void (*before_set_reg)(struct device *dev, int slot,
+                                      int power_on, int vdd);
+               /* Call back after enabling / disabling regulators */
+               void (*after_set_reg)(struct device *dev, int slot,
+                                     int power_on, int vdd);
+               /* if we have special card, init it using this callback */
+               void (*init_card)(struct mmc_card *card);
+               /* return MMC cover switch state, can be NULL if not supported.
+                *
+                * possible return values:
+                *   0 - closed
+                *   1 - open
+                */
+               int (*get_cover_state)(struct device *dev, int slot);
+               const char *name;
+               u32 ocr_mask;
+               /* Card detection IRQs */
+               int card_detect_irq;
+               int (*card_detect)(struct device *dev, int slot);
+               unsigned int ban_openended:1;
+       } slots[OMAP_MMC_MAX_SLOTS];
+ };