]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge tag 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 26 May 2012 19:22:27 +0000 (12:22 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 26 May 2012 19:22:27 +0000 (12:22 -0700)
Pull arm-soc driver specific updates from Olof Johansson:
 "These changes are specific to some driver that may be used by multiple
  boards or socs.  The most significant change in here is the move of
  the samsung iommu code from a platform specific in-kernel interface to
  the generic iommu subsystem."

Fix up trivial conflicts in arch/arm/mach-exynos/Kconfig

* tag 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (28 commits)
  mmc: dt: Consolidate DT bindings
  iommu/exynos: Add iommu driver for EXYNOS Platforms
  ARM: davinci: optimize the DMA ISR
  ARM: davinci: implement DEBUG_LL port choice
  ARM: tegra: Add SMMU enabler in AHB
  ARM: tegra: Add Tegra AHB driver
  Input: pxa27x_keypad add choice to set direct_key_mask
  Input: pxa27x_keypad direct key may be low active
  Input: pxa27x_keypad bug fix for direct_key_mask
  Input: pxa27x_keypad keep clock on as wakeup source
  ARM: dt: tegra: pinmux changes for USB ULPI
  ARM: tegra: add USB ULPI PHY reset GPIO to device tree
  ARM: tegra: don't hard-code USB ULPI PHY reset_gpio
  ARM: tegra: change pll_p_out4's rate to 24MHz
  ARM: tegra: fix pclk rate
  ARM: tegra: reparent sclk to pll_c_out1
  ARM: tegra: Add pllc clock init table
  ARM: dt: tegra cardhu: basic audio support
  ARM: dt: tegra30.dtsi: Add audio-related nodes
  ARM: tegra: add AUXDATA required for audio
  ...

22 files changed:
1  2 
arch/arm/boot/dts/omap4-panda.dts
arch/arm/boot/dts/omap4-sdp.dts
arch/arm/mach-davinci/dma.c
arch/arm/mach-ep93xx/core.c
arch/arm/mach-exynos/Kconfig
arch/arm/mach-exynos/clock-exynos5.c
arch/arm/mach-exynos/include/mach/irqs.h
arch/arm/mach-exynos/include/mach/map.h
arch/arm/mach-exynos/mach-armlex4210.c
arch/arm/mach-exynos/mach-smdkv310.c
arch/arm/mach-tegra/board-paz00.c
arch/arm/mach-tegra/board-trimslice.c
arch/arm/mach-tegra/devices.c
arch/arm/mach-tegra/devices.h
arch/arm/mach-tegra/tegra2_clocks.c
drivers/Makefile
drivers/dma/ep93xx_dma.c
drivers/iommu/Kconfig
drivers/iommu/Makefile
drivers/mmc/host/omap_hsmmc.c
drivers/mmc/host/sdhci-esdhc-imx.c
drivers/usb/host/ehci-tegra.c

index e671361bc79135abb97b8754d998a7977d348f49,31fb4218d3aeeac63d95ec8b5de08fdcd91f5c34..1efe0c5879855ebbc4165d09f21403eb86ed9be6
                device_type = "memory";
                reg = <0x80000000 0x40000000>; /* 1 GB */
        };
 +
 +      leds {
 +              compatible = "gpio-leds";
 +              heartbeat {
 +                      label = "pandaboard::status1";
 +                      gpios = <&gpio1 7 0>;
 +                      linux,default-trigger = "heartbeat";
 +              };
 +
 +              mmc {
 +                      label = "pandaboard::status2";
 +                      gpios = <&gpio1 8 0>;
 +                      linux,default-trigger = "mmc0";
 +              };
 +      };
  };
  
  &i2c1 {
@@@ -70,7 -55,7 +70,7 @@@
  
  &mmc1 {
        vmmc-supply = <&vmmc>;
-       ti,bus-width = <8>;
+       bus-width = <8>;
  };
  
  &mmc2 {
@@@ -87,5 -72,5 +87,5 @@@
  
  &mmc5 {
        ti,non-removable;
-       ti,bus-width = <4>;
+       bus-width = <4>;
  };
index e5eeb6f9c6e668e596c8a24d3e2699b81a26458e,a1dd873425fcbbd9ea8990b3abbec8da828afa73..d08c4d1372800a0f944489ace4495db188c499c7
                enable-active-high;
                regulator-boot-on;
        };
 +
 +      leds {
 +              compatible = "gpio-leds";
 +              debug0 {
 +                      label = "omap4:green:debug0";
 +                      gpios = <&gpio2 29 0>; /* 61 */
 +              };
 +
 +              debug1 {
 +                      label = "omap4:green:debug1";
 +                      gpios = <&gpio1 30 0>; /* 30 */
 +              };
 +
 +              debug2 {
 +                      label = "omap4:green:debug2";
 +                      gpios = <&gpio1 7 0>; /* 7 */
 +              };
 +
 +              debug3 {
 +                      label = "omap4:green:debug3";
 +                      gpios = <&gpio1 8 0>; /* 8 */
 +              };
 +
 +              debug4 {
 +                      label = "omap4:green:debug4";
 +                      gpios = <&gpio2 18 0>; /* 50 */
 +              };
 +
 +              user1 {
 +                      label = "omap4:blue:user";
 +                      gpios = <&gpio6 9 0>; /* 169 */
 +              };
 +
 +              user2 {
 +                      label = "omap4:red:user";
 +                      gpios = <&gpio6 10 0>; /* 170 */
 +              };
 +
 +              user3 {
 +                      label = "omap4:green:user";
 +                      gpios = <&gpio5 11 0>; /* 139 */
 +              };
 +      };
  };
  
  &i2c1 {
  
  &mmc1 {
        vmmc-supply = <&vmmc>;
-       ti,bus-width = <8>;
+       bus-width = <8>;
  };
  
  &mmc2 {
        vmmc-supply = <&vaux1>;
-       ti,bus-width = <8>;
+       bus-width = <8>;
        ti,non-removable;
  };
  
  };
  
  &mmc5 {
-       ti,bus-width = <4>;
+       bus-width = <4>;
        ti,non-removable;
  };
index 95ce019c9b98686b5fb14f69fc93665daf964f49,8713694a6f2c71ba0a5a27070f05c1967ae3c9c2..a685e9706b7ba305b462b103899398b3521f2917
@@@ -353,9 -353,10 +353,10 @@@ static int irq2ctlr(int irq
   *****************************************************************************/
  static irqreturn_t dma_irq_handler(int irq, void *data)
  {
-       int i;
        int ctlr;
-       unsigned int cnt = 0;
+       u32 sh_ier;
+       u32 sh_ipr;
+       u32 bank;
  
        ctlr = irq2ctlr(irq);
        if (ctlr < 0)
  
        dev_dbg(data, "dma_irq_handler\n");
  
-       if ((edma_shadow0_read_array(ctlr, SH_IPR, 0) == 0) &&
-           (edma_shadow0_read_array(ctlr, SH_IPR, 1) == 0))
-               return IRQ_NONE;
+       sh_ipr = edma_shadow0_read_array(ctlr, SH_IPR, 0);
+       if (!sh_ipr) {
+               sh_ipr = edma_shadow0_read_array(ctlr, SH_IPR, 1);
+               if (!sh_ipr)
+                       return IRQ_NONE;
+               sh_ier = edma_shadow0_read_array(ctlr, SH_IER, 1);
+               bank = 1;
+       } else {
+               sh_ier = edma_shadow0_read_array(ctlr, SH_IER, 0);
+               bank = 0;
+       }
+       do {
+               u32 slot;
+               u32 channel;
  
-       while (1) {
-               int j;
-               if (edma_shadow0_read_array(ctlr, SH_IPR, 0) &
-                               edma_shadow0_read_array(ctlr, SH_IER, 0))
-                       j = 0;
-               else if (edma_shadow0_read_array(ctlr, SH_IPR, 1) &
-                               edma_shadow0_read_array(ctlr, SH_IER, 1))
-                       j = 1;
-               else
-                       break;
-               dev_dbg(data, "IPR%d %08x\n", j,
-                               edma_shadow0_read_array(ctlr, SH_IPR, j));
-               for (i = 0; i < 32; i++) {
-                       int k = (j << 5) + i;
-                       if ((edma_shadow0_read_array(ctlr, SH_IPR, j) & BIT(i))
-                                       && (edma_shadow0_read_array(ctlr,
-                                                       SH_IER, j) & BIT(i))) {
-                               /* Clear the corresponding IPR bits */
-                               edma_shadow0_write_array(ctlr, SH_ICR, j,
-                                                       BIT(i));
-                               if (edma_cc[ctlr]->intr_data[k].callback)
-                                       edma_cc[ctlr]->intr_data[k].callback(
-                                               k, DMA_COMPLETE,
-                                               edma_cc[ctlr]->intr_data[k].
-                                               data);
-                       }
+               dev_dbg(data, "IPR%d %08x\n", bank, sh_ipr);
+               slot = __ffs(sh_ipr);
+               sh_ipr &= ~(BIT(slot));
+               if (sh_ier & BIT(slot)) {
+                       channel = (bank << 5) | slot;
+                       /* Clear the corresponding IPR bits */
+                       edma_shadow0_write_array(ctlr, SH_ICR, bank,
+                                       BIT(slot));
+                       if (edma_cc[ctlr]->intr_data[channel].callback)
+                               edma_cc[ctlr]->intr_data[channel].callback(
+                                       channel, DMA_COMPLETE,
+                                       edma_cc[ctlr]->intr_data[channel].data);
                }
-               cnt++;
-               if (cnt > 10)
-                       break;
-       }
+       } while (sh_ipr);
        edma_shadow0_write(ctlr, SH_IEVAL, 1);
        return IRQ_HANDLED;
  }
@@@ -557,9 -556,9 +556,9 @@@ static int reserve_contiguous_slots(in
        if (i == edma_cc[ctlr]->num_slots)
                stop_slot = i;
  
 -      for (j = start_slot; j < stop_slot; j++)
 -              if (test_bit(j, tmp_inuse))
 -                      clear_bit(j, edma_cc[ctlr]->edma_inuse);
 +      j = start_slot;
 +      for_each_set_bit_from(j, tmp_inuse, stop_slot)
 +              clear_bit(j, edma_cc[ctlr]->edma_inuse);
  
        if (count)
                return -EBUSY;
index 66b1494f23a6f0f4b2182f23ae2433089bcd1f53,2ea2ffc61875a2608ad790a9b8e10919a690f77b..ad1a91ab6acd9978b4418b051c3b68cf90cf1565
@@@ -241,7 -241,11 +241,7 @@@ unsigned int ep93xx_chip_revision(void
   * EP93xx GPIO
   *************************************************************************/
  static struct resource ep93xx_gpio_resource[] = {
 -      {
 -              .start          = EP93XX_GPIO_PHYS_BASE,
 -              .end            = EP93XX_GPIO_PHYS_BASE + 0xcc - 1,
 -              .flags          = IORESOURCE_MEM,
 -      },
 +      DEFINE_RES_MEM(EP93XX_GPIO_PHYS_BASE, 0xcc),
  };
  
  static struct platform_device ep93xx_gpio_device = {
@@@ -284,7 -288,11 +284,7 @@@ static AMBA_APB_DEVICE(uart3, "apb:uart
        { IRQ_EP93XX_UART3 }, &ep93xx_uart_data);
  
  static struct resource ep93xx_rtc_resource[] = {
 -      {
 -              .start          = EP93XX_RTC_PHYS_BASE,
 -              .end            = EP93XX_RTC_PHYS_BASE + 0x10c - 1,
 -              .flags          = IORESOURCE_MEM,
 -      },
 +      DEFINE_RES_MEM(EP93XX_RTC_PHYS_BASE, 0x10c),
  };
  
  static struct platform_device ep93xx_rtc_device = {
  
  
  static struct resource ep93xx_ohci_resources[] = {
 -      [0] = {
 -              .start  = EP93XX_USB_PHYS_BASE,
 -              .end    = EP93XX_USB_PHYS_BASE + 0x0fff,
 -              .flags  = IORESOURCE_MEM,
 -      },
 -      [1] = {
 -              .start  = IRQ_EP93XX_USB,
 -              .end    = IRQ_EP93XX_USB,
 -              .flags  = IORESOURCE_IRQ,
 -      },
 +      DEFINE_RES_MEM(EP93XX_USB_PHYS_BASE, 0x1000),
 +      DEFINE_RES_IRQ(IRQ_EP93XX_USB),
  };
  
  
@@@ -356,8 -372,15 +356,8 @@@ void __init ep93xx_register_flash(unsig
  static struct ep93xx_eth_data ep93xx_eth_data;
  
  static struct resource ep93xx_eth_resource[] = {
 -      {
 -              .start  = EP93XX_ETHERNET_PHYS_BASE,
 -              .end    = EP93XX_ETHERNET_PHYS_BASE + 0xffff,
 -              .flags  = IORESOURCE_MEM,
 -      }, {
 -              .start  = IRQ_EP93XX_ETHERNET,
 -              .end    = IRQ_EP93XX_ETHERNET,
 -              .flags  = IORESOURCE_IRQ,
 -      }
 +      DEFINE_RES_MEM(EP93XX_ETHERNET_PHYS_BASE, 0x10000),
 +      DEFINE_RES_IRQ(IRQ_EP93XX_ETHERNET),
  };
  
  static u64 ep93xx_eth_dma_mask = DMA_BIT_MASK(32);
@@@ -438,8 -461,16 +438,8 @@@ void __init ep93xx_register_i2c(struct 
  static struct ep93xx_spi_info ep93xx_spi_master_data;
  
  static struct resource ep93xx_spi_resources[] = {
 -      {
 -              .start  = EP93XX_SPI_PHYS_BASE,
 -              .end    = EP93XX_SPI_PHYS_BASE + 0x18 - 1,
 -              .flags  = IORESOURCE_MEM,
 -      },
 -      {
 -              .start  = IRQ_EP93XX_SSP,
 -              .end    = IRQ_EP93XX_SSP,
 -              .flags  = IORESOURCE_IRQ,
 -      },
 +      DEFINE_RES_MEM(EP93XX_SPI_PHYS_BASE, 0x18),
 +      DEFINE_RES_IRQ(IRQ_EP93XX_SSP),
  };
  
  static u64 ep93xx_spi_dma_mask = DMA_BIT_MASK(32);
@@@ -482,7 -513,7 +482,7 @@@ void __init ep93xx_register_spi(struct 
  /*************************************************************************
   * EP93xx LEDs
   *************************************************************************/
 -static struct gpio_led ep93xx_led_pins[] = {
 +static const struct gpio_led ep93xx_led_pins[] __initconst = {
        {
                .name   = "platform:grled",
                .gpio   = EP93XX_GPIO_LINE_GRLED,
        },
  };
  
 -static struct gpio_led_platform_data ep93xx_led_data = {
 +static const struct gpio_led_platform_data ep93xx_led_data __initconst = {
        .num_leds       = ARRAY_SIZE(ep93xx_led_pins),
        .leds           = ep93xx_led_pins,
  };
  
 -static struct platform_device ep93xx_leds = {
 -      .name           = "leds-gpio",
 -      .id             = -1,
 -      .dev            = {
 -              .platform_data  = &ep93xx_led_data,
 -      },
 -};
 -
 -
  /*************************************************************************
   * EP93xx pwm peripheral handling
   *************************************************************************/
  static struct resource ep93xx_pwm0_resource[] = {
 -      {
 -              .start  = EP93XX_PWM_PHYS_BASE,
 -              .end    = EP93XX_PWM_PHYS_BASE + 0x10 - 1,
 -              .flags  = IORESOURCE_MEM,
 -      },
 +      DEFINE_RES_MEM(EP93XX_PWM_PHYS_BASE, 0x10),
  };
  
  static struct platform_device ep93xx_pwm0_device = {
  };
  
  static struct resource ep93xx_pwm1_resource[] = {
 -      {
 -              .start  = EP93XX_PWM_PHYS_BASE + 0x20,
 -              .end    = EP93XX_PWM_PHYS_BASE + 0x30 - 1,
 -              .flags  = IORESOURCE_MEM,
 -      },
 +      DEFINE_RES_MEM(EP93XX_PWM_PHYS_BASE + 0x20, 0x10),
  };
  
  static struct platform_device ep93xx_pwm1_device = {
@@@ -580,7 -628,11 +580,7 @@@ EXPORT_SYMBOL(ep93xx_pwm_release_gpio)
  static struct ep93xxfb_mach_info ep93xxfb_data;
  
  static struct resource ep93xx_fb_resource[] = {
 -      {
 -              .start          = EP93XX_RASTER_PHYS_BASE,
 -              .end            = EP93XX_RASTER_PHYS_BASE + 0x800 - 1,
 -              .flags          = IORESOURCE_MEM,
 -      },
 +      DEFINE_RES_MEM(EP93XX_RASTER_PHYS_BASE, 0x800),
  };
  
  static struct platform_device ep93xx_fb_device = {
@@@ -628,8 -680,15 +628,8 @@@ void __init ep93xx_register_fb(struct e
  static struct ep93xx_keypad_platform_data ep93xx_keypad_data;
  
  static struct resource ep93xx_keypad_resource[] = {
 -      {
 -              .start  = EP93XX_KEY_MATRIX_PHYS_BASE,
 -              .end    = EP93XX_KEY_MATRIX_PHYS_BASE + 0x0c - 1,
 -              .flags  = IORESOURCE_MEM,
 -      }, {
 -              .start  = IRQ_EP93XX_KEY,
 -              .end    = IRQ_EP93XX_KEY,
 -              .flags  = IORESOURCE_IRQ,
 -      },
 +      DEFINE_RES_MEM(EP93XX_KEY_MATRIX_PHYS_BASE, 0x0c),
 +      DEFINE_RES_IRQ(IRQ_EP93XX_KEY),
  };
  
  static struct platform_device ep93xx_keypad_device = {
@@@ -675,7 -734,7 +675,7 @@@ int ep93xx_keypad_acquire_gpio(struct p
  fail_gpio_d:
        gpio_free(EP93XX_GPIO_LINE_C(i));
  fail_gpio_c:
-       for ( ; i >= 0; --i) {
+       for (--i; i >= 0; --i) {
                gpio_free(EP93XX_GPIO_LINE_C(i));
                gpio_free(EP93XX_GPIO_LINE_D(i));
        }
@@@ -702,7 -761,11 +702,7 @@@ EXPORT_SYMBOL(ep93xx_keypad_release_gpi
   * EP93xx I2S audio peripheral handling
   *************************************************************************/
  static struct resource ep93xx_i2s_resource[] = {
 -      {
 -              .start  = EP93XX_I2S_PHYS_BASE,
 -              .end    = EP93XX_I2S_PHYS_BASE + 0x100 - 1,
 -              .flags  = IORESOURCE_MEM,
 -      },
 +      DEFINE_RES_MEM(EP93XX_I2S_PHYS_BASE, 0x100),
  };
  
  static struct platform_device ep93xx_i2s_device = {
@@@ -761,8 -824,16 +761,8 @@@ EXPORT_SYMBOL(ep93xx_i2s_release)
   * EP93xx AC97 audio peripheral handling
   *************************************************************************/
  static struct resource ep93xx_ac97_resources[] = {
 -      {
 -              .start  = EP93XX_AAC_PHYS_BASE,
 -              .end    = EP93XX_AAC_PHYS_BASE + 0xac - 1,
 -              .flags  = IORESOURCE_MEM,
 -      },
 -      {
 -              .start  = IRQ_EP93XX_AACINTR,
 -              .end    = IRQ_EP93XX_AACINTR,
 -              .flags  = IORESOURCE_IRQ,
 -      },
 +      DEFINE_RES_MEM(EP93XX_AAC_PHYS_BASE, 0xac),
 +      DEFINE_RES_IRQ(IRQ_EP93XX_AACINTR),
  };
  
  static struct platform_device ep93xx_ac97_device = {
@@@ -818,9 -889,8 +818,9 @@@ void __init ep93xx_init_devices(void
  
        platform_device_register(&ep93xx_rtc_device);
        platform_device_register(&ep93xx_ohci_device);
 -      platform_device_register(&ep93xx_leds);
        platform_device_register(&ep93xx_wdt_device);
 +
 +      gpio_led_register_device(-1, &ep93xx_led_data);
  }
  
  void ep93xx_restart(char mode, const char *cmd)
index 15b05b89cc399ddd3bf36658ec3d68f1bc12581b,2c35fd404cae17f467af5359534325d603d53201..e3cfd5fd7dd54bb694789f1b3553e1abe3569bf5
@@@ -85,10 -85,10 +85,10 @@@ config EXYNOS4_SETUP_FIMD
        help
          Common setup code for FIMD0.
  
- config EXYNOS4_DEV_SYSMMU
+ config EXYNOS_DEV_SYSMMU
        bool
        help
-         Common setup code for SYSTEM MMU in EXYNOS4
+         Common setup code for SYSTEM MMU in EXYNOS platforms
  
  config EXYNOS4_DEV_DWMCI
        bool
@@@ -200,13 -200,12 +200,13 @@@ config MACH_SMDKV31
        select S3C_DEV_HSMMC2
        select S3C_DEV_HSMMC3
        select SAMSUNG_DEV_BACKLIGHT
 +      select EXYNOS_DEV_DRM
+       select EXYNOS_DEV_SYSMMU
        select EXYNOS4_DEV_AHCI
        select SAMSUNG_DEV_KEYPAD
        select EXYNOS4_DEV_DMA
        select SAMSUNG_DEV_PWM
        select EXYNOS4_DEV_USB_OHCI
-       select EXYNOS4_DEV_SYSMMU
        select EXYNOS4_SETUP_FIMD0
        select EXYNOS4_SETUP_I2C1
        select EXYNOS4_SETUP_KEYPAD
@@@ -225,7 -224,6 +225,6 @@@ config MACH_ARMLEX421
        select S3C_DEV_HSMMC3
        select EXYNOS4_DEV_AHCI
        select EXYNOS4_DEV_DMA
-       select EXYNOS4_DEV_SYSMMU
        select EXYNOS4_SETUP_SDHCI
        help
          Machine support for Samsung ARMLEX4210 based on EXYNOS4210
  config MACH_UNIVERSAL_C210
        bool "Mobile UNIVERSAL_C210 Board"
        select CPU_EXYNOS4210
 +      select S5P_HRT
 +      select CLKSRC_MMIO
 +      select HAVE_SCHED_CLOCK
        select S5P_GPIO_INT
        select S5P_DEV_FIMC0
        select S5P_DEV_FIMC1
        select S3C_DEV_I2C1
        select S3C_DEV_I2C3
        select S3C_DEV_I2C5
 +      select S3C_DEV_USB_HSOTG
        select S5P_DEV_I2C_HDMIPHY
        select S5P_DEV_MFC
        select S5P_DEV_ONENAND
        select S5P_DEV_TV
+       select EXYNOS_DEV_SYSMMU
        select EXYNOS4_DEV_DMA
 +      select EXYNOS_DEV_DRM
        select EXYNOS4_SETUP_FIMD0
        select EXYNOS4_SETUP_I2C1
        select EXYNOS4_SETUP_I2C3
        select EXYNOS4_SETUP_SDHCI
        select EXYNOS4_SETUP_FIMC
        select S5P_SETUP_MIPIPHY
 +      select EXYNOS4_SETUP_USB_PHY
        help
          Machine support for Samsung Mobile Universal S5PC210 Reference
          Board.
@@@ -284,7 -277,6 +284,7 @@@ config MACH_NUR
        select S3C_DEV_I2C3
        select S3C_DEV_I2C5
        select S3C_DEV_I2C6
 +      select S3C_DEV_USB_HSOTG
        select S5P_DEV_CSIS0
        select S5P_DEV_JPEG
        select S5P_DEV_FIMC0
        select S5P_DEV_USB_EHCI
        select S5P_SETUP_MIPIPHY
        select EXYNOS4_DEV_DMA
 +      select EXYNOS_DEV_DRM
        select EXYNOS4_SETUP_FIMC
        select EXYNOS4_SETUP_FIMD0
        select EXYNOS4_SETUP_I2C1
@@@ -331,7 -322,7 +331,8 @@@ config MACH_ORIGE
        select S5P_DEV_USB_EHCI
        select SAMSUNG_DEV_BACKLIGHT
        select SAMSUNG_DEV_PWM
 +      select EXYNOS_DEV_DRM
+       select EXYNOS_DEV_SYSMMU
        select EXYNOS4_DEV_DMA
        select EXYNOS4_DEV_USB_OHCI
        select EXYNOS4_SETUP_FIMD0
@@@ -352,14 -343,10 +353,15 @@@ config MACH_SMDK421
        select S3C_DEV_I2C7
        select S3C_DEV_RTC
        select S3C_DEV_WDT
 +      select S5P_DEV_FIMC0
 +      select S5P_DEV_FIMC1
 +      select S5P_DEV_FIMC2
 +      select S5P_DEV_FIMC3
 +      select S5P_DEV_MFC
        select SAMSUNG_DEV_BACKLIGHT
        select SAMSUNG_DEV_KEYPAD
        select SAMSUNG_DEV_PWM
+       select EXYNOS_DEV_SYSMMU
        select EXYNOS4_DEV_DMA
        select EXYNOS4_SETUP_I2C1
        select EXYNOS4_SETUP_I2C3
index 7ac6ff4c46bd382839234a3d8a19ffb2042e311b,ad3bec4f1fa663c347623335fee03656e2db8766..9f87a07b0bf80672ab96c70c92764eab2df32b1a
@@@ -82,6 -82,11 +82,11 @@@ static int exynos5_clksrc_mask_peric0_c
        return s5p_gatectrl(EXYNOS5_CLKSRC_MASK_PERIC0, clk, enable);
  }
  
+ static int exynos5_clk_ip_acp_ctrl(struct clk *clk, int enable)
+ {
+       return s5p_gatectrl(EXYNOS5_CLKGATE_IP_ACP, clk, enable);
+ }
  static int exynos5_clk_ip_core_ctrl(struct clk *clk, int enable)
  {
        return s5p_gatectrl(EXYNOS5_CLKGATE_IP_CORE, clk, enable);
@@@ -127,6 -132,21 +132,21 @@@ static int exynos5_clk_ip_peris_ctrl(st
        return s5p_gatectrl(EXYNOS5_CLKGATE_IP_PERIS, clk, enable);
  }
  
+ static int exynos5_clk_ip_gscl_ctrl(struct clk *clk, int enable)
+ {
+       return s5p_gatectrl(EXYNOS5_CLKGATE_IP_GSCL, clk, enable);
+ }
+ static int exynos5_clk_ip_isp0_ctrl(struct clk *clk, int enable)
+ {
+       return s5p_gatectrl(EXYNOS5_CLKGATE_IP_ISP0, clk, enable);
+ }
+ static int exynos5_clk_ip_isp1_ctrl(struct clk *clk, int enable)
+ {
+       return s5p_gatectrl(EXYNOS5_CLKGATE_IP_ISP1, clk, enable);
+ }
  /* Core list of CMU_CPU side */
  
  static struct clksrc_clk exynos5_clk_mout_apll = {
@@@ -630,6 -650,76 +650,76 @@@ static struct clk exynos5_init_clocks_o
                .parent         = &exynos5_clk_aclk_66.clk,
                .enable         = exynos5_clk_ip_peric_ctrl,
                .ctrlbit        = (1 << 14),
+       }, {
+               .name           = SYSMMU_CLOCK_NAME,
+               .devname        = SYSMMU_CLOCK_DEVNAME(mfc_l, 0),
+               .enable         = &exynos5_clk_ip_mfc_ctrl,
+               .ctrlbit        = (1 << 1),
+       }, {
+               .name           = SYSMMU_CLOCK_NAME,
+               .devname        = SYSMMU_CLOCK_DEVNAME(mfc_r, 1),
+               .enable         = &exynos5_clk_ip_mfc_ctrl,
+               .ctrlbit        = (1 << 2),
+       }, {
+               .name           = SYSMMU_CLOCK_NAME,
+               .devname        = SYSMMU_CLOCK_DEVNAME(tv, 2),
+               .enable         = &exynos5_clk_ip_disp1_ctrl,
+               .ctrlbit        = (1 << 9)
+       }, {
+               .name           = SYSMMU_CLOCK_NAME,
+               .devname        = SYSMMU_CLOCK_DEVNAME(jpeg, 3),
+               .enable         = &exynos5_clk_ip_gen_ctrl,
+               .ctrlbit        = (1 << 7),
+       }, {
+               .name           = SYSMMU_CLOCK_NAME,
+               .devname        = SYSMMU_CLOCK_DEVNAME(rot, 4),
+               .enable         = &exynos5_clk_ip_gen_ctrl,
+               .ctrlbit        = (1 << 6)
+       }, {
+               .name           = SYSMMU_CLOCK_NAME,
+               .devname        = SYSMMU_CLOCK_DEVNAME(gsc0, 5),
+               .enable         = &exynos5_clk_ip_gscl_ctrl,
+               .ctrlbit        = (1 << 7),
+       }, {
+               .name           = SYSMMU_CLOCK_NAME,
+               .devname        = SYSMMU_CLOCK_DEVNAME(gsc1, 6),
+               .enable         = &exynos5_clk_ip_gscl_ctrl,
+               .ctrlbit        = (1 << 8),
+       }, {
+               .name           = SYSMMU_CLOCK_NAME,
+               .devname        = SYSMMU_CLOCK_DEVNAME(gsc2, 7),
+               .enable         = &exynos5_clk_ip_gscl_ctrl,
+               .ctrlbit        = (1 << 9),
+       }, {
+               .name           = SYSMMU_CLOCK_NAME,
+               .devname        = SYSMMU_CLOCK_DEVNAME(gsc3, 8),
+               .enable         = &exynos5_clk_ip_gscl_ctrl,
+               .ctrlbit        = (1 << 10),
+       }, {
+               .name           = SYSMMU_CLOCK_NAME,
+               .devname        = SYSMMU_CLOCK_DEVNAME(isp, 9),
+               .enable         = &exynos5_clk_ip_isp0_ctrl,
+               .ctrlbit        = (0x3F << 8),
+       }, {
+               .name           = SYSMMU_CLOCK_NAME2,
+               .devname        = SYSMMU_CLOCK_DEVNAME(isp, 9),
+               .enable         = &exynos5_clk_ip_isp1_ctrl,
+               .ctrlbit        = (0xF << 4),
+       }, {
+               .name           = SYSMMU_CLOCK_NAME,
+               .devname        = SYSMMU_CLOCK_DEVNAME(camif0, 12),
+               .enable         = &exynos5_clk_ip_gscl_ctrl,
+               .ctrlbit        = (1 << 11),
+       }, {
+               .name           = SYSMMU_CLOCK_NAME,
+               .devname        = SYSMMU_CLOCK_DEVNAME(camif1, 13),
+               .enable         = &exynos5_clk_ip_gscl_ctrl,
+               .ctrlbit        = (1 << 12),
+       }, {
+               .name           = SYSMMU_CLOCK_NAME,
+               .devname        = SYSMMU_CLOCK_DEVNAME(2d, 14),
+               .enable         = &exynos5_clk_ip_acp_ctrl,
+               .ctrlbit        = (1 << 7)
        }
  };
  
@@@ -678,7 -768,7 +768,7 @@@ static struct clk exynos5_clk_pdma1 = 
        .name           = "dma",
        .devname        = "dma-pl330.1",
        .enable         = exynos5_clk_ip_fsys_ctrl,
 -      .ctrlbit        = (1 << 1),
 +      .ctrlbit        = (1 << 2),
  };
  
  static struct clk exynos5_clk_mdma1 = {
index c02dae7bf4a37923f99ec623337d78a08d182106,116167524051fa18c2e6c5207b2f36e583e404c0..ddde8f3a24d435cdf09073d83302bc34a4e22b8b
  #define EXYNOS4_IRQ_SYSMMU_MFC_M1_0   COMBINER_IRQ(5, 6)
  #define EXYNOS4_IRQ_SYSMMU_PCIE_0     COMBINER_IRQ(5, 7)
  
+ #define EXYNOS4_IRQ_SYSMMU_FIMC_LITE0_0       COMBINER_IRQ(16, 0)
+ #define EXYNOS4_IRQ_SYSMMU_FIMC_LITE1_0       COMBINER_IRQ(16, 1)
+ #define EXYNOS4_IRQ_SYSMMU_FIMC_ISP_0 COMBINER_IRQ(16, 2)
+ #define EXYNOS4_IRQ_SYSMMU_FIMC_DRC_0 COMBINER_IRQ(16, 3)
+ #define EXYNOS4_IRQ_SYSMMU_FIMC_FD_0  COMBINER_IRQ(16, 4)
+ #define EXYNOS4_IRQ_SYSMMU_FIMC_CX_0  COMBINER_IRQ(16, 5)
  #define EXYNOS4_IRQ_FIMD0_FIFO                COMBINER_IRQ(11, 0)
  #define EXYNOS4_IRQ_FIMD0_VSYNC               COMBINER_IRQ(11, 1)
  #define EXYNOS4_IRQ_FIMD0_SYSTEM      COMBINER_IRQ(11, 2)
  #define IRQ_IIC7                      EXYNOS4_IRQ_IIC7
  
  #define IRQ_USB_HOST                  EXYNOS4_IRQ_USB_HOST
 +#define IRQ_OTG                               EXYNOS4_IRQ_USB_HSOTG
  
  #define IRQ_HSMMC0                    EXYNOS4_IRQ_HSMMC0
  #define IRQ_HSMMC1                    EXYNOS4_IRQ_HSMMC1
  #define IRQ_KEYPAD                    EXYNOS4_IRQ_KEYPAD
  #define IRQ_PMU                               EXYNOS4_IRQ_PMU
  
- #define IRQ_SYSMMU_MDMA0_0            EXYNOS4_IRQ_SYSMMU_MDMA0_0
- #define IRQ_SYSMMU_SSS_0                EXYNOS4_IRQ_SYSMMU_SSS_0
- #define IRQ_SYSMMU_FIMC0_0              EXYNOS4_IRQ_SYSMMU_FIMC0_0
- #define IRQ_SYSMMU_FIMC1_0              EXYNOS4_IRQ_SYSMMU_FIMC1_0
- #define IRQ_SYSMMU_FIMC2_0              EXYNOS4_IRQ_SYSMMU_FIMC2_0
- #define IRQ_SYSMMU_FIMC3_0              EXYNOS4_IRQ_SYSMMU_FIMC3_0
- #define IRQ_SYSMMU_JPEG_0               EXYNOS4_IRQ_SYSMMU_JPEG_0
- #define IRQ_SYSMMU_2D_0                 EXYNOS4_IRQ_SYSMMU_2D_0
- #define IRQ_SYSMMU_ROTATOR_0            EXYNOS4_IRQ_SYSMMU_ROTATOR_0
- #define IRQ_SYSMMU_MDMA1_0              EXYNOS4_IRQ_SYSMMU_MDMA1_0
- #define IRQ_SYSMMU_LCD0_M0_0            EXYNOS4_IRQ_SYSMMU_LCD0_M0_0
- #define IRQ_SYSMMU_LCD1_M1_0            EXYNOS4_IRQ_SYSMMU_LCD1_M1_0
- #define IRQ_SYSMMU_TV_M0_0              EXYNOS4_IRQ_SYSMMU_TV_M0_0
- #define IRQ_SYSMMU_MFC_M0_0             EXYNOS4_IRQ_SYSMMU_MFC_M0_0
- #define IRQ_SYSMMU_MFC_M1_0             EXYNOS4_IRQ_SYSMMU_MFC_M1_0
- #define IRQ_SYSMMU_PCIE_0               EXYNOS4_IRQ_SYSMMU_PCIE_0
  #define IRQ_FIMD0_FIFO                        EXYNOS4_IRQ_FIMD0_FIFO
  #define IRQ_FIMD0_VSYNC                       EXYNOS4_IRQ_FIMD0_VSYNC
  #define IRQ_FIMD0_SYSTEM              EXYNOS4_IRQ_FIMD0_SYSTEM
index e009a66477f42e579572ff8e5edbcab914bc08a0,0e2292d04550359b637d7ce011c7c7549be711ee..2196af2d8218f81e22055b9017eb66d4e4bd3d1a
@@@ -95,6 -95,7 +95,7 @@@
  #define EXYNOS5_PA_PDMA1              0x121B0000
  
  #define EXYNOS4_PA_SYSMMU_MDMA                0x10A40000
+ #define EXYNOS4_PA_SYSMMU_2D_ACP      0x10A40000
  #define EXYNOS4_PA_SYSMMU_SSS         0x10A50000
  #define EXYNOS4_PA_SYSMMU_FIMC0               0x11A20000
  #define EXYNOS4_PA_SYSMMU_FIMC1               0x11A30000
  #define EXYNOS4_PA_SYSMMU_JPEG                0x11A60000
  #define EXYNOS4_PA_SYSMMU_FIMD0               0x11E20000
  #define EXYNOS4_PA_SYSMMU_FIMD1               0x12220000
+ #define EXYNOS4_PA_SYSMMU_FIMC_ISP    0x12260000
+ #define EXYNOS4_PA_SYSMMU_FIMC_DRC    0x12270000
+ #define EXYNOS4_PA_SYSMMU_FIMC_FD     0x122A0000
+ #define EXYNOS4_PA_SYSMMU_ISPCPU      0x122B0000
+ #define EXYNOS4_PA_SYSMMU_FIMC_LITE0  0x123B0000
+ #define EXYNOS4_PA_SYSMMU_FIMC_LITE1  0x123C0000
  #define EXYNOS4_PA_SYSMMU_PCIe                0x12620000
  #define EXYNOS4_PA_SYSMMU_G2D         0x12A20000
  #define EXYNOS4_PA_SYSMMU_ROTATOR     0x12A30000
  #define EXYNOS4_PA_SYSMMU_TV          0x12E20000
  #define EXYNOS4_PA_SYSMMU_MFC_L               0x13620000
  #define EXYNOS4_PA_SYSMMU_MFC_R               0x13630000
+ #define EXYNOS5_PA_SYSMMU_MDMA1               0x10A40000
+ #define EXYNOS5_PA_SYSMMU_SSS         0x10A50000
+ #define EXYNOS5_PA_SYSMMU_2D          0x10A60000
+ #define EXYNOS5_PA_SYSMMU_MFC_L               0x11200000
+ #define EXYNOS5_PA_SYSMMU_MFC_R               0x11210000
+ #define EXYNOS5_PA_SYSMMU_ROTATOR     0x11D40000
+ #define EXYNOS5_PA_SYSMMU_MDMA2               0x11D50000
+ #define EXYNOS5_PA_SYSMMU_JPEG                0x11F20000
+ #define EXYNOS5_PA_SYSMMU_IOP         0x12360000
+ #define EXYNOS5_PA_SYSMMU_RTIC                0x12370000
+ #define EXYNOS5_PA_SYSMMU_GPS         0x12630000
+ #define EXYNOS5_PA_SYSMMU_ISP         0x13260000
+ #define EXYNOS5_PA_SYSMMU_DRC         0x12370000
+ #define EXYNOS5_PA_SYSMMU_SCALERC     0x13280000
+ #define EXYNOS5_PA_SYSMMU_SCALERP     0x13290000
+ #define EXYNOS5_PA_SYSMMU_FD          0x132A0000
+ #define EXYNOS5_PA_SYSMMU_ISPCPU      0x132B0000
+ #define EXYNOS5_PA_SYSMMU_ODC         0x132C0000
+ #define EXYNOS5_PA_SYSMMU_DIS0                0x132D0000
+ #define EXYNOS5_PA_SYSMMU_DIS1                0x132E0000
+ #define EXYNOS5_PA_SYSMMU_3DNR                0x132F0000
+ #define EXYNOS5_PA_SYSMMU_LITE0               0x13C40000
+ #define EXYNOS5_PA_SYSMMU_LITE1               0x13C50000
+ #define EXYNOS5_PA_SYSMMU_GSC0                0x13E80000
+ #define EXYNOS5_PA_SYSMMU_GSC1                0x13E90000
+ #define EXYNOS5_PA_SYSMMU_GSC2                0x13EA0000
+ #define EXYNOS5_PA_SYSMMU_GSC3                0x13EB0000
+ #define EXYNOS5_PA_SYSMMU_FIMD1               0x14640000
+ #define EXYNOS5_PA_SYSMMU_TV          0x14650000
  #define EXYNOS4_PA_SPI0                       0x13920000
  #define EXYNOS4_PA_SPI1                       0x13930000
  #define EXYNOS4_PA_SPI2                       0x13940000
  #define EXYNOS4_PA_HSMMC(x)           (0x12510000 + ((x) * 0x10000))
  #define EXYNOS4_PA_DWMCI              0x12550000
  
 +#define EXYNOS4_PA_HSOTG              0x12480000
 +#define EXYNOS4_PA_USB_HSPHY          0x125B0000
 +
  #define EXYNOS4_PA_SATA                       0x12560000
  #define EXYNOS4_PA_SATAPHY            0x125D0000
  #define EXYNOS4_PA_SATAPHY_CTRL               0x126B0000
  #define S3C_PA_SPI0                   EXYNOS4_PA_SPI0
  #define S3C_PA_SPI1                   EXYNOS4_PA_SPI1
  #define S3C_PA_SPI2                   EXYNOS4_PA_SPI2
 +#define S3C_PA_USB_HSOTG              EXYNOS4_PA_HSOTG
  
  #define S5P_PA_EHCI                   EXYNOS4_PA_EHCI
  #define S5P_PA_FIMC0                  EXYNOS4_PA_FIMC0
index fed7116418eb1315c60b2b87cb844a0ba28ba318,6ce21484501e84a7b59e911700ccc91fb3762901..372e33196e8a9444f3cfabc30fe06cb065501c71
@@@ -77,6 -77,7 +77,6 @@@ static struct s3c2410_uartcfg armlex421
  
  static struct s3c_sdhci_platdata armlex4210_hsmmc0_pdata __initdata = {
        .cd_type                = S3C_SDHCI_CD_PERMANENT,
 -      .clk_type               = S3C_SDHCI_CLK_DIV_EXTERNAL,
  #ifdef CONFIG_EXYNOS4_SDHCI_CH0_8BIT
        .max_width              = 8,
        .host_caps              = MMC_CAP_8_BIT_DATA,
@@@ -87,11 -88,13 +87,11 @@@ static struct s3c_sdhci_platdata armlex
        .cd_type                = S3C_SDHCI_CD_GPIO,
        .ext_cd_gpio            = EXYNOS4_GPX2(5),
        .ext_cd_gpio_invert     = 1,
 -      .clk_type               = S3C_SDHCI_CLK_DIV_EXTERNAL,
        .max_width              = 4,
  };
  
  static struct s3c_sdhci_platdata armlex4210_hsmmc3_pdata __initdata = {
        .cd_type                = S3C_SDHCI_CD_PERMANENT,
 -      .clk_type               = S3C_SDHCI_CLK_DIV_EXTERNAL,
        .max_width              = 4,
  };
  
@@@ -118,9 -121,16 +118,9 @@@ static void __init armlex4210_wlan_init
  }
  
  static struct resource armlex4210_smsc911x_resources[] = {
 -      [0] = {
 -              .start  = EXYNOS4_PA_SROM_BANK(3),
 -              .end    = EXYNOS4_PA_SROM_BANK(3) + SZ_64K - 1,
 -              .flags  = IORESOURCE_MEM,
 -      },
 -      [1] = {
 -              .start  = IRQ_EINT(27),
 -              .end    = IRQ_EINT(27),
 -              .flags  = IORESOURCE_IRQ | IRQF_TRIGGER_HIGH,
 -      },
 +      [0] = DEFINE_RES_MEM(EXYNOS4_PA_SROM_BANK(3), SZ_64K),
 +      [1] = DEFINE_RES_NAMED(IRQ_EINT(27), 1, NULL, IORESOURCE_IRQ \
 +                                      | IRQF_TRIGGER_HIGH),
  };
  
  static struct smsc911x_platform_config smsc9215_config = {
@@@ -147,7 -157,6 +147,6 @@@ static struct platform_device *armlex42
        &s3c_device_hsmmc3,
        &s3c_device_rtc,
        &s3c_device_wdt,
-       &exynos4_device_sysmmu,
        &samsung_asoc_dma,
        &armlex4210_smsc911x,
        &exynos4_device_ahci,
index 5af96064ca5109ddec70a66a444a74ff0720168c,495c7e502be1413a97375ee87d468f46e70052d7..a8c7656b1fce99a9c979d41363467d925d1bbe3d
@@@ -44,7 -44,6 +44,7 @@@
  #include <mach/map.h>
  #include <mach/ohci.h>
  
 +#include <drm/exynos_drm.h>
  #include "common.h"
  
  /* Following are default values for UCON, ULCON and UFCON UART registers */
@@@ -94,6 -93,7 +94,6 @@@ static struct s3c2410_uartcfg smdkv310_
  
  static struct s3c_sdhci_platdata smdkv310_hsmmc0_pdata __initdata = {
        .cd_type                = S3C_SDHCI_CD_INTERNAL,
 -      .clk_type               = S3C_SDHCI_CLK_DIV_EXTERNAL,
  #ifdef CONFIG_EXYNOS4_SDHCI_CH0_8BIT
        .max_width              = 8,
        .host_caps              = MMC_CAP_8_BIT_DATA,
@@@ -104,10 -104,12 +104,10 @@@ static struct s3c_sdhci_platdata smdkv3
        .cd_type                = S3C_SDHCI_CD_GPIO,
        .ext_cd_gpio            = EXYNOS4_GPK0(2),
        .ext_cd_gpio_invert     = 1,
 -      .clk_type               = S3C_SDHCI_CLK_DIV_EXTERNAL,
  };
  
  static struct s3c_sdhci_platdata smdkv310_hsmmc2_pdata __initdata = {
        .cd_type                = S3C_SDHCI_CD_INTERNAL,
 -      .clk_type               = S3C_SDHCI_CLK_DIV_EXTERNAL,
  #ifdef CONFIG_EXYNOS4_SDHCI_CH2_8BIT
        .max_width              = 8,
        .host_caps              = MMC_CAP_8_BIT_DATA,
@@@ -118,6 -120,7 +118,6 @@@ static struct s3c_sdhci_platdata smdkv3
        .cd_type                = S3C_SDHCI_CD_GPIO,
        .ext_cd_gpio            = EXYNOS4_GPK2(2),
        .ext_cd_gpio_invert     = 1,
 -      .clk_type               = S3C_SDHCI_CLK_DIV_EXTERNAL,
  };
  
  static void lcd_lte480wv_set_power(struct plat_lcd_data *pd,
@@@ -157,26 -160,6 +157,26 @@@ static struct platform_device smdkv310_
        .dev.platform_data      = &smdkv310_lcd_lte480wv_data,
  };
  
 +#ifdef CONFIG_DRM_EXYNOS
 +static struct exynos_drm_fimd_pdata drm_fimd_pdata = {
 +      .panel  = {
 +              .timing = {
 +                      .left_margin    = 13,
 +                      .right_margin   = 8,
 +                      .upper_margin   = 7,
 +                      .lower_margin   = 5,
 +                      .hsync_len      = 3,
 +                      .vsync_len      = 1,
 +                      .xres           = 800,
 +                      .yres           = 480,
 +              },
 +      },
 +      .vidcon0        = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
 +      .vidcon1        = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
 +      .default_win    = 0,
 +      .bpp            = 32,
 +};
 +#else
  static struct s3c_fb_pd_win smdkv310_fb_win0 = {
        .win_mode = {
                .left_margin    = 13,
@@@ -198,12 -181,18 +198,12 @@@ static struct s3c_fb_platdata smdkv310_
        .vidcon1        = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
        .setup_gpio     = exynos4_fimd0_gpio_setup_24bpp,
  };
 +#endif
  
  static struct resource smdkv310_smsc911x_resources[] = {
 -      [0] = {
 -              .start  = EXYNOS4_PA_SROM_BANK(1),
 -              .end    = EXYNOS4_PA_SROM_BANK(1) + SZ_64K - 1,
 -              .flags  = IORESOURCE_MEM,
 -      },
 -      [1] = {
 -              .start  = IRQ_EINT(5),
 -              .end    = IRQ_EINT(5),
 -              .flags  = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
 -      },
 +      [0] = DEFINE_RES_MEM(EXYNOS4_PA_SROM_BANK(1), SZ_64K),
 +      [1] = DEFINE_RES_NAMED(IRQ_EINT(5), 1, NULL, IORESOURCE_IRQ \
 +                                              | IRQF_TRIGGER_LOW),
  };
  
  static struct smsc911x_platform_config smsc9215_config = {
@@@ -284,9 -273,6 +284,9 @@@ static struct platform_device *smdkv310
        &s5p_device_fimc_md,
        &s5p_device_g2d,
        &s5p_device_jpeg,
 +#ifdef CONFIG_DRM_EXYNOS
 +      &exynos_device_drm,
 +#endif
        &exynos4_device_ac97,
        &exynos4_device_i2s0,
        &exynos4_device_ohci,
        &s5p_device_mfc_l,
        &s5p_device_mfc_r,
        &exynos4_device_spdif,
-       &exynos4_device_sysmmu,
        &samsung_asoc_dma,
        &samsung_asoc_idma,
        &s5p_device_fimd0,
@@@ -378,12 -363,7 +377,12 @@@ static void __init smdkv310_machine_ini
        samsung_keypad_set_platdata(&smdkv310_keypad_data);
  
        samsung_bl_set(&smdkv310_bl_gpio_info, &smdkv310_bl_data);
 +#ifdef CONFIG_DRM_EXYNOS
 +      s5p_device_fimd0.dev.platform_data = &drm_fimd_pdata;
 +      exynos4_fimd0_gpio_setup_24bpp();
 +#else
        s5p_fimd0_set_platdata(&smdkv310_lcd0_pdata);
 +#endif
  
        smdkv310_ehci_init();
        smdkv310_ohci_init();
index d0735c70d688e8054fc7aa5e16f1731eb0e00c9b,e31317deec219f5aeb6aee96f26ebac078847e29..55a1e6ccf4a274ad365225aa7181adfe77c3216f
@@@ -21,7 -21,6 +21,7 @@@
  #include <linux/init.h>
  #include <linux/platform_device.h>
  #include <linux/serial_8250.h>
 +#include <linux/of_serial.h>
  #include <linux/clk.h>
  #include <linux/dma-mapping.h>
  #include <linux/gpio_keys.h>
@@@ -56,7 -55,6 +56,7 @@@ static struct plat_serial8250_port debu
                .irq            = INT_UARTA,
                .flags          = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE,
                .type           = PORT_TEGRA,
 +              .handle_break   = tegra_serial_handle_break,
                .iotype         = UPIO_MEM,
                .regshift       = 2,
                .uartclk        = 216000000,
@@@ -67,7 -65,6 +67,7 @@@
                .irq            = INT_UARTC,
                .flags          = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE,
                .type           = PORT_TEGRA,
 +              .handle_break   = tegra_serial_handle_break,
                .iotype         = UPIO_MEM,
                .regshift       = 2,
                .uartclk        = 216000000,
@@@ -162,6 -159,8 +162,8 @@@ static void paz00_i2c_init(void
  
  static void paz00_usb_init(void)
  {
+       tegra_ehci2_ulpi_phy_config.reset_gpio = TEGRA_ULPI_RST;
        platform_device_register(&tegra_ehci2_device);
        platform_device_register(&tegra_ehci3_device);
  }
@@@ -179,7 -178,6 +181,6 @@@ static __initdata struct tegra_clk_init
        { "uarta",      "pll_p",        216000000,      true },
        { "uartc",      "pll_p",        216000000,      true },
  
-       { "pll_p_out4", "pll_p",        24000000,       true },
        { "usbd",       "clk_m",        12000000,       false },
        { "usb2",       "clk_m",        12000000,       false },
        { "usb3",       "clk_m",        12000000,       false },
index bc59b379c6fe609db1d413c874b24e54e1b378a2,24f1678098dd88614f9045f41fb1b6a6fcb6cf78..832fa931c7100afcb3d07657d8f2fa24f1df6216
@@@ -22,7 -22,6 +22,7 @@@
  #include <linux/init.h>
  #include <linux/platform_device.h>
  #include <linux/serial_8250.h>
 +#include <linux/of_serial.h>
  #include <linux/io.h>
  #include <linux/i2c.h>
  #include <linux/gpio.h>
@@@ -50,7 -49,6 +50,7 @@@ static struct plat_serial8250_port debu
                .irq            = INT_UARTA,
                .flags          = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE,
                .type           = PORT_TEGRA,
 +              .handle_break   = tegra_serial_handle_break,
                .iotype         = UPIO_MEM,
                .regshift       = 2,
                .uartclk        = 216000000,
@@@ -89,6 -87,7 +89,6 @@@ static struct platform_device *trimslic
        &tegra_sdhci_device4,
        &tegra_i2s_device1,
        &tegra_das_device,
 -      &tegra_pcm_device,
        &trimslice_audio_device,
  };
  
@@@ -118,6 -117,8 +118,8 @@@ static void trimslice_usb_init(void
        pdata = tegra_ehci1_device.dev.platform_data;
        pdata->vbus_gpio = TRIMSLICE_GPIO_USB1_MODE;
  
+       tegra_ehci2_ulpi_phy_config.reset_gpio = TEGRA_GPIO_PV0;
        platform_device_register(&tegra_ehci3_device);
        platform_device_register(&tegra_ehci2_device);
        platform_device_register(&tegra_ehci1_device);
index 2d8dfa2faf8f09d0dcdfb8f301713912ca553782,9fcb9a52227651fe917cd78ec22bd4bb3683fc30..c70e65ffa36ba8a91e16b372c8c616abd4414c20
@@@ -439,9 -439,8 +439,8 @@@ static struct resource tegra_usb3_resou
        },
  };
  
- static struct tegra_ulpi_config tegra_ehci2_ulpi_phy_config = {
-       /* All existing boards use GPIO PV0 for phy reset */
-       .reset_gpio = TEGRA_GPIO_PV0,
+ struct tegra_ulpi_config tegra_ehci2_ulpi_phy_config = {
+       .reset_gpio = -1,
        .clk = "cdev2",
  };
  
@@@ -674,14 -673,14 +673,14 @@@ static struct resource i2s_resource2[] 
  };
  
  struct platform_device tegra_i2s_device1 = {
 -      .name           = "tegra-i2s",
 +      .name           = "tegra20-i2s",
        .id             = 0,
        .resource       = i2s_resource1,
        .num_resources  = ARRAY_SIZE(i2s_resource1),
  };
  
  struct platform_device tegra_i2s_device2 = {
 -      .name           = "tegra-i2s",
 +      .name           = "tegra20-i2s",
        .id             = 1,
        .resource       = i2s_resource2,
        .num_resources  = ARRAY_SIZE(i2s_resource2),
@@@ -696,8 -695,13 +695,8 @@@ static struct resource tegra_das_resour
  };
  
  struct platform_device tegra_das_device = {
 -      .name           = "tegra-das",
 +      .name           = "tegra20-das",
        .id             = -1,
        .num_resources  = ARRAY_SIZE(tegra_das_resources),
        .resource       = tegra_das_resources,
  };
 -
 -struct platform_device tegra_pcm_device = {
 -      .name = "tegra-pcm-audio",
 -      .id = -1,
 -};
index 138c642e59f4cec93143845d8e072df332b083e3,4290ea0063acdcc9d84c2097f33d711e7ec9c824..4f50527264956b0f28413e462b9afef024b00322
  #include <linux/platform_device.h>
  #include <linux/platform_data/tegra_usb.h>
  
+ #include <mach/usb_phy.h>
+ extern struct tegra_ulpi_config tegra_ehci2_ulpi_phy_config;
  extern struct tegra_ehci_platform_data tegra_ehci1_pdata;
  extern struct tegra_ehci_platform_data tegra_ehci2_pdata;
  extern struct tegra_ehci_platform_data tegra_ehci3_pdata;
@@@ -52,5 -56,6 +56,5 @@@ extern struct platform_device tegra_pmu
  extern struct platform_device tegra_i2s_device1;
  extern struct platform_device tegra_i2s_device2;
  extern struct platform_device tegra_das_device;
 -extern struct platform_device tegra_pcm_device;
  
  #endif
index bae09b8598912b2f310ea854401457bcba9983da,a357ad2a8cf7f610ba4d6f84afa37f5997694f75..b59315ce3691c8c73fefdccd9e91328b14d07dab
@@@ -1486,6 -1486,10 +1486,10 @@@ static struct clk tegra_clk_m = 
  };
  
  static struct clk_pll_freq_table tegra_pll_c_freq_table[] = {
+       { 12000000, 600000000, 600, 12, 1, 8 },
+       { 13000000, 600000000, 600, 13, 1, 8 },
+       { 19200000, 600000000, 500, 16, 1, 6 },
+       { 26000000, 600000000, 600, 26, 1, 8 },
        { 0, 0, 0, 0, 0, 0 },
  };
  
@@@ -1764,12 -1768,6 +1768,12 @@@ static struct clk_pll_freq_table tegra_
        { 19200000, 760000000,  950,  24, 1, 8},
        { 26000000, 760000000,  760,  26, 1, 12},
  
 +      /* 750 MHz */
 +      { 12000000, 750000000,  750,  12, 1, 12},
 +      { 13000000, 750000000,  750,  13, 1, 12},
 +      { 19200000, 750000000,  625,  16, 1, 8},
 +      { 26000000, 750000000,  750,  26, 1, 12},
 +
        /* 608 MHz */
        { 12000000, 608000000,  608,  12, 1, 12},
        { 13000000, 608000000,  608,  13, 1, 12},
@@@ -2148,8 -2146,8 +2152,8 @@@ static struct clk tegra_list_clks[] = 
        PERIPH_CLK("apbdma",    "tegra-dma",            NULL,   34,     0,      108000000, mux_pclk,                    0),
        PERIPH_CLK("rtc",       "rtc-tegra",            NULL,   4,      0,      32768,     mux_clk_32k,                 PERIPH_NO_RESET),
        PERIPH_CLK("timer",     "timer",                NULL,   5,      0,      26000000,  mux_clk_m,                   0),
 -      PERIPH_CLK("i2s1",      "tegra-i2s.0",          NULL,   11,     0x100,  26000000,  mux_pllaout0_audio2x_pllp_clkm,      MUX | DIV_U71),
 -      PERIPH_CLK("i2s2",      "tegra-i2s.1",          NULL,   18,     0x104,  26000000,  mux_pllaout0_audio2x_pllp_clkm,      MUX | DIV_U71),
 +      PERIPH_CLK("i2s1",      "tegra20-i2s.0",        NULL,   11,     0x100,  26000000,  mux_pllaout0_audio2x_pllp_clkm,      MUX | DIV_U71),
 +      PERIPH_CLK("i2s2",      "tegra20-i2s.1",        NULL,   18,     0x104,  26000000,  mux_pllaout0_audio2x_pllp_clkm,      MUX | DIV_U71),
        PERIPH_CLK("spdif_out", "spdif_out",            NULL,   10,     0x108,  100000000, mux_pllaout0_audio2x_pllp_clkm,      MUX | DIV_U71),
        PERIPH_CLK("spdif_in",  "spdif_in",             NULL,   10,     0x10c,  100000000, mux_pllp_pllc_pllm,          MUX | DIV_U71),
        PERIPH_CLK("pwm",       "pwm",                  NULL,   17,     0x110,  432000000, mux_pllp_pllc_audio_clkm_clk32,      MUX | DIV_U71),
diff --combined drivers/Makefile
index 0ee98d50f9752b0a77925dca996f5cd36fee12a3,fd7176390168786fc7aaac05c5e9755b5cb3f418..2ba29ffef2cbd84ff0a55d66a861ab3eee2159fa
@@@ -18,7 -18,7 +18,7 @@@ obj-$(CONFIG_SFI)             += sfi
  # PnP must come after ACPI since it will eventually need to check if acpi
  # was used and do nothing if so
  obj-$(CONFIG_PNP)             += pnp/
- obj-$(CONFIG_ARM_AMBA)                += amba/
+ obj-y                         += amba/
  # Many drivers will want to use DMA so this has to be made available
  # really early.
  obj-$(CONFIG_DMA_ENGINE)      += dma/
@@@ -92,6 -92,7 +92,6 @@@ obj-$(CONFIG_BT)              += bluetooth
  obj-$(CONFIG_ACCESSIBILITY)   += accessibility/
  obj-$(CONFIG_ISDN)            += isdn/
  obj-$(CONFIG_EDAC)            += edac/
 -obj-$(CONFIG_MCA)             += mca/
  obj-$(CONFIG_EISA)            += eisa/
  obj-y                         += lguest/
  obj-$(CONFIG_CPU_FREQ)                += cpufreq/
@@@ -133,7 -134,3 +133,7 @@@ obj-$(CONFIG_VIRT_DRIVERS) += virt
  obj-$(CONFIG_HYPERV)          += hv/
  
  obj-$(CONFIG_PM_DEVFREQ)      += devfreq/
 +obj-$(CONFIG_EXTCON)          += extcon/
 +obj-$(CONFIG_MEMORY)          += memory/
 +obj-$(CONFIG_IIO)             += iio/
 +obj-$(CONFIG_VME_BUS)         += vme/
diff --combined drivers/dma/ep93xx_dma.c
index f6e9b572b998919ee117cf154e560788da439de3,bbfbb0622d35041c902bfccb8971ab6c0febb9d0..c64917ec313dc25d501ad41312fa8e898df8e003
@@@ -71,6 -71,7 +71,7 @@@
  #define M2M_CONTROL_TM_SHIFT          13
  #define M2M_CONTROL_TM_TX             (1 << M2M_CONTROL_TM_SHIFT)
  #define M2M_CONTROL_TM_RX             (2 << M2M_CONTROL_TM_SHIFT)
+ #define M2M_CONTROL_NFBINT            BIT(21)
  #define M2M_CONTROL_RSS_SHIFT         22
  #define M2M_CONTROL_RSS_SSPRX         (1 << M2M_CONTROL_RSS_SHIFT)
  #define M2M_CONTROL_RSS_SSPTX         (2 << M2M_CONTROL_RSS_SHIFT)
  #define M2M_CONTROL_PWSC_SHIFT                25
  
  #define M2M_INTERRUPT                 0x0004
- #define M2M_INTERRUPT_DONEINT         BIT(1)
+ #define M2M_INTERRUPT_MASK            6
+ #define M2M_STATUS                    0x000c
+ #define M2M_STATUS_CTL_SHIFT          1
+ #define M2M_STATUS_CTL_IDLE           (0 << M2M_STATUS_CTL_SHIFT)
+ #define M2M_STATUS_CTL_STALL          (1 << M2M_STATUS_CTL_SHIFT)
+ #define M2M_STATUS_CTL_MEMRD          (2 << M2M_STATUS_CTL_SHIFT)
+ #define M2M_STATUS_CTL_MEMWR          (3 << M2M_STATUS_CTL_SHIFT)
+ #define M2M_STATUS_CTL_BWCWAIT                (4 << M2M_STATUS_CTL_SHIFT)
+ #define M2M_STATUS_CTL_MASK           (7 << M2M_STATUS_CTL_SHIFT)
+ #define M2M_STATUS_BUF_SHIFT          4
+ #define M2M_STATUS_BUF_NO             (0 << M2M_STATUS_BUF_SHIFT)
+ #define M2M_STATUS_BUF_ON             (1 << M2M_STATUS_BUF_SHIFT)
+ #define M2M_STATUS_BUF_NEXT           (2 << M2M_STATUS_BUF_SHIFT)
+ #define M2M_STATUS_BUF_MASK           (3 << M2M_STATUS_BUF_SHIFT)
+ #define M2M_STATUS_DONE                       BIT(6)
  
  #define M2M_BCR0                      0x0010
  #define M2M_BCR1                      0x0014
@@@ -426,15 -442,6 +442,6 @@@ static int m2p_hw_interrupt(struct ep93
  
  /*
   * M2M DMA implementation
-  *
-  * For the M2M transfers we don't use NFB at all. This is because it simply
-  * doesn't work well with memcpy transfers. When you submit both buffers it is
-  * extremely unlikely that you get an NFB interrupt, but it instead reports
-  * DONE interrupt and both buffers are already transferred which means that we
-  * weren't able to update the next buffer.
-  *
-  * So for now we "simulate" NFB by just submitting buffer after buffer
-  * without double buffering.
   */
  
  static int m2m_hw_setup(struct ep93xx_dma_chan *edmac)
@@@ -543,6 -550,11 +550,11 @@@ static void m2m_hw_submit(struct ep93xx
        m2m_fill_desc(edmac);
        control |= M2M_CONTROL_DONEINT;
  
+       if (ep93xx_dma_advance_active(edmac)) {
+               m2m_fill_desc(edmac);
+               control |= M2M_CONTROL_NFBINT;
+       }
        /*
         * Now we can finally enable the channel. For M2M channel this must be
         * done _after_ the BCRx registers are programmed.
        }
  }
  
+ /*
+  * According to EP93xx User's Guide, we should receive DONE interrupt when all
+  * M2M DMA controller transactions complete normally. This is not always the
+  * case - sometimes EP93xx M2M DMA asserts DONE interrupt when the DMA channel
+  * is still running (channel Buffer FSM in DMA_BUF_ON state, and channel
+  * Control FSM in DMA_MEM_RD state, observed at least in IDE-DMA operation).
+  * In effect, disabling the channel when only DONE bit is set could stop
+  * currently running DMA transfer. To avoid this, we use Buffer FSM and
+  * Control FSM to check current state of DMA channel.
+  */
  static int m2m_hw_interrupt(struct ep93xx_dma_chan *edmac)
  {
+       u32 status = readl(edmac->regs + M2M_STATUS);
+       u32 ctl_fsm = status & M2M_STATUS_CTL_MASK;
+       u32 buf_fsm = status & M2M_STATUS_BUF_MASK;
+       bool done = status & M2M_STATUS_DONE;
+       bool last_done;
        u32 control;
+       struct ep93xx_dma_desc *desc;
  
-       if (!(readl(edmac->regs + M2M_INTERRUPT) & M2M_INTERRUPT_DONEINT))
+       /* Accept only DONE and NFB interrupts */
+       if (!(readl(edmac->regs + M2M_INTERRUPT) & M2M_INTERRUPT_MASK))
                return INTERRUPT_UNKNOWN;
  
-       /* Clear the DONE bit */
-       writel(0, edmac->regs + M2M_INTERRUPT);
+       if (done) {
+               /* Clear the DONE bit */
+               writel(0, edmac->regs + M2M_INTERRUPT);
+       }
  
-       /* Disable interrupts and the channel */
-       control = readl(edmac->regs + M2M_CONTROL);
-       control &= ~(M2M_CONTROL_DONEINT | M2M_CONTROL_ENABLE);
-       writel(control, edmac->regs + M2M_CONTROL);
+       /*
+        * Check whether we are done with descriptors or not. This, together
+        * with DMA channel state, determines action to take in interrupt.
+        */
+       desc = ep93xx_dma_get_active(edmac);
+       last_done = !desc || desc->txd.cookie;
  
        /*
-        * Since we only get DONE interrupt we have to find out ourselves
-        * whether there still is something to process. So we try to advance
-        * the chain an see whether it succeeds.
+        * Use M2M DMA Buffer FSM and Control FSM to check current state of
+        * DMA channel. Using DONE and NFB bits from channel status register
+        * or bits from channel interrupt register is not reliable.
         */
-       if (ep93xx_dma_advance_active(edmac)) {
-               edmac->edma->hw_submit(edmac);
-               return INTERRUPT_NEXT_BUFFER;
+       if (!last_done &&
+           (buf_fsm == M2M_STATUS_BUF_NO ||
+            buf_fsm == M2M_STATUS_BUF_ON)) {
+               /*
+                * Two buffers are ready for update when Buffer FSM is in
+                * DMA_NO_BUF state. Only one buffer can be prepared without
+                * disabling the channel or polling the DONE bit.
+                * To simplify things, always prepare only one buffer.
+                */
+               if (ep93xx_dma_advance_active(edmac)) {
+                       m2m_fill_desc(edmac);
+                       if (done && !edmac->chan.private) {
+                               /* Software trigger for memcpy channel */
+                               control = readl(edmac->regs + M2M_CONTROL);
+                               control |= M2M_CONTROL_START;
+                               writel(control, edmac->regs + M2M_CONTROL);
+                       }
+                       return INTERRUPT_NEXT_BUFFER;
+               } else {
+                       last_done = true;
+               }
        }
  
-       return INTERRUPT_DONE;
+       /*
+        * Disable the channel only when Buffer FSM is in DMA_NO_BUF state
+        * and Control FSM is in DMA_STALL state.
+        */
+       if (last_done &&
+           buf_fsm == M2M_STATUS_BUF_NO &&
+           ctl_fsm == M2M_STATUS_CTL_STALL) {
+               /* Disable interrupts and the channel */
+               control = readl(edmac->regs + M2M_CONTROL);
+               control &= ~(M2M_CONTROL_DONEINT | M2M_CONTROL_NFBINT
+                           | M2M_CONTROL_ENABLE);
+               writel(control, edmac->regs + M2M_CONTROL);
+               return INTERRUPT_DONE;
+       }
+       /*
+        * Nothing to do this time.
+        */
+       return INTERRUPT_NEXT_BUFFER;
  }
  
  /*
@@@ -703,9 -772,7 +772,9 @@@ static void ep93xx_dma_tasklet(unsigne
        desc = ep93xx_dma_get_active(edmac);
        if (desc) {
                if (desc->complete) {
 -                      dma_cookie_complete(&desc->txd);
 +                      /* mark descriptor complete for non cyclic case only */
 +                      if (!test_bit(EP93XX_DMA_IS_CYCLIC, &edmac->flags))
 +                              dma_cookie_complete(&desc->txd);
                        list_splice_init(&edmac->active, &list);
                }
                callback = desc->txd.callback;
diff --combined drivers/iommu/Kconfig
index c69843742bb041e911a116e0f96558c20de2bb63,23db79205fd7900b3903248190b59ee4e7f901f1..34089372753893ab3cf0a247d097fd3f4f67c688
@@@ -43,7 -43,7 +43,7 @@@ config AMD_IOMM
          With this option you can enable support for AMD IOMMU hardware in
          your system. An IOMMU is a hardware component which provides
          remapping of DMA memory accesses from devices. With an AMD IOMMU you
 -        can isolate the the DMA memory of different devices and protect the
 +        can isolate the DMA memory of different devices and protect the
          system from misbehaving device drivers or hardware.
  
          You can find out if your system has an AMD IOMMU if you look into
@@@ -67,7 -67,7 +67,7 @@@ config AMD_IOMMU_V
        ---help---
          This option enables support for the AMD IOMMUv2 features of the IOMMU
          hardware. Select this option if you want to use devices that support
 -        the the PCI PRI and PASID interface.
 +        the PCI PRI and PASID interface.
  
  # Intel IOMMU support
  config DMAR_TABLE
@@@ -162,4 -162,25 +162,25 @@@ config TEGRA_IOMMU_SMM
          space through the SMMU (System Memory Management Unit)
          hardware included on Tegra SoCs.
  
+ config EXYNOS_IOMMU
+       bool "Exynos IOMMU Support"
+       depends on ARCH_EXYNOS && EXYNOS_DEV_SYSMMU
+       select IOMMU_API
+       help
+         Support for the IOMMU(System MMU) of Samsung Exynos application
+         processor family. This enables H/W multimedia accellerators to see
+         non-linear physical memory chunks as a linear memory in their
+         address spaces
+         If unsure, say N here.
+ config EXYNOS_IOMMU_DEBUG
+       bool "Debugging log for Exynos IOMMU"
+       depends on EXYNOS_IOMMU
+       help
+         Select this to see the detailed log message that shows what
+         happens in the IOMMU driver
+         Say N unless you need kernel log message for IOMMU debugging
  endif # IOMMU_SUPPORT
diff --combined drivers/iommu/Makefile
index 3e5e82ae9f0de957a7c67f004776850cc7ef3536,d06dec6a84b41ab3159a4fb1871cab1b806b15fb..76e54ef796dec14864f0ca5c05dd44cc4a5f570f
@@@ -4,9 -4,10 +4,10 @@@ obj-$(CONFIG_AMD_IOMMU) += amd_iommu.o 
  obj-$(CONFIG_AMD_IOMMU_V2) += amd_iommu_v2.o
  obj-$(CONFIG_DMAR_TABLE) += dmar.o
  obj-$(CONFIG_INTEL_IOMMU) += iova.o intel-iommu.o
 -obj-$(CONFIG_IRQ_REMAP) += intr_remapping.o
 +obj-$(CONFIG_IRQ_REMAP) += intel_irq_remapping.o irq_remapping.o
  obj-$(CONFIG_OMAP_IOMMU) += omap-iommu.o
  obj-$(CONFIG_OMAP_IOVMM) += omap-iovmm.o
  obj-$(CONFIG_OMAP_IOMMU_DEBUG) += omap-iommu-debug.o
  obj-$(CONFIG_TEGRA_IOMMU_GART) += tegra-gart.o
  obj-$(CONFIG_TEGRA_IOMMU_SMMU) += tegra-smmu.o
+ obj-$(CONFIG_EXYNOS_IOMMU) += exynos-iommu.o
index a9fc714fb38daed1113aab632047c8304347ac78,33e81c24e1408734bf8b431bbb319926a362fa00..9a7a60aeb19ea35dc921cd43f2e796c2bfd75469
  #define BRR_ENABLE            (1 << 5)
  #define DTO_ENABLE            (1 << 20)
  #define INIT_STREAM           (1 << 1)
 +#define ACEN_ACMD12           (1 << 2)
  #define DP_SELECT             (1 << 21)
  #define DDIR                  (1 << 4)
  #define DMA_EN                        0x1
  #define MSBS                  (1 << 5)
  #define BCE                   (1 << 1)
  #define FOUR_BIT              (1 << 1)
 +#define DDR                   (1 << 19)
  #define DW8                   (1 << 5)
  #define CC                    0x1
  #define TC                    0x02
  #define OMAP_MMC_MAX_CLOCK    52000000
  #define DRIVER_NAME           "omap_hsmmc"
  
 +#define AUTO_CMD12            (1 << 0)        /* Auto CMD12 support */
  /*
   * One controller can have multiple slots, like on some omap boards using
   * omap.c controller driver. Luckily this is not currently done on any known
@@@ -170,6 -167,7 +170,6 @@@ struct omap_hsmmc_host 
        int                     use_dma, dma_ch;
        int                     dma_line_tx, dma_line_rx;
        int                     slot_id;
 -      int                     got_dbclk;
        int                     response_busy;
        int                     context_loss;
        int                     vdd;
        int                     reqs_blocked;
        int                     use_reg;
        int                     req_in_progress;
 +      unsigned int            flags;
        struct omap_hsmmc_next  next_data;
  
        struct  omap_mmc_platform_data  *pdata;
@@@ -523,10 -520,6 +523,10 @@@ static void omap_hsmmc_set_bus_width(st
        u32 con;
  
        con = OMAP_HSMMC_READ(host->base, CON);
 +      if (ios->timing == MMC_TIMING_UHS_DDR50)
 +              con |= DDR;     /* configure in DDR mode */
 +      else
 +              con &= ~DDR;
        switch (ios->bus_width) {
        case MMC_BUS_WIDTH_8:
                OMAP_HSMMC_WRITE(host->base, CON, con | DW8);
@@@ -773,8 -766,6 +773,8 @@@ omap_hsmmc_start_command(struct omap_hs
                cmdtype = 0x3;
  
        cmdreg = (cmd->opcode << 24) | (resptype << 16) | (cmdtype << 22);
 +      if ((host->flags & AUTO_CMD12) && mmc_op_multi(cmd->opcode))
 +              cmdreg |= ACEN_ACMD12;
  
        if (data) {
                cmdreg |= DP_SELECT | MSBS | BCE;
@@@ -805,12 -796,11 +805,12 @@@ omap_hsmmc_get_dma_dir(struct omap_hsmm
  static void omap_hsmmc_request_done(struct omap_hsmmc_host *host, struct mmc_request *mrq)
  {
        int dma_ch;
 +      unsigned long flags;
  
 -      spin_lock(&host->irq_lock);
 +      spin_lock_irqsave(&host->irq_lock, flags);
        host->req_in_progress = 0;
        dma_ch = host->dma_ch;
 -      spin_unlock(&host->irq_lock);
 +      spin_unlock_irqrestore(&host->irq_lock, flags);
  
        omap_hsmmc_disable_irq(host);
        /* Do not complete the request if DMA is still in progress */
@@@ -847,14 -837,11 +847,14 @@@ omap_hsmmc_xfer_done(struct omap_hsmmc_
        else
                data->bytes_xfered = 0;
  
 -      if (!data->stop) {
 +      if (data->stop && ((!(host->flags & AUTO_CMD12)) || data->error)) {
 +              omap_hsmmc_start_command(host, data->stop, NULL);
 +      } else {
 +              if (data->stop)
 +                      data->stop->resp[0] = OMAP_HSMMC_READ(host->base,
 +                                                      RSP76);
                omap_hsmmc_request_done(host, data->mrq);
 -              return;
        }
 -      omap_hsmmc_start_command(host, data->stop, NULL);
  }
  
  /*
@@@ -887,14 -874,13 +887,14 @@@ omap_hsmmc_cmd_done(struct omap_hsmmc_h
  static void omap_hsmmc_dma_cleanup(struct omap_hsmmc_host *host, int errno)
  {
        int dma_ch;
 +      unsigned long flags;
  
        host->data->error = errno;
  
 -      spin_lock(&host->irq_lock);
 +      spin_lock_irqsave(&host->irq_lock, flags);
        dma_ch = host->dma_ch;
        host->dma_ch = -1;
 -      spin_unlock(&host->irq_lock);
 +      spin_unlock_irqrestore(&host->irq_lock, flags);
  
        if (host->use_dma && dma_ch != -1) {
                dma_unmap_sg(mmc_dev(host->mmc), host->data->sg,
@@@ -1096,7 -1082,7 +1096,7 @@@ static int omap_hsmmc_switch_opcond(str
  
        /* Disable the clocks */
        pm_runtime_put_sync(host->dev);
 -      if (host->got_dbclk)
 +      if (host->dbclk)
                clk_disable(host->dbclk);
  
        /* Turn the power off */
                ret = mmc_slot(host).set_power(host->dev, host->slot_id, 1,
                                               vdd);
        pm_runtime_get_sync(host->dev);
 -      if (host->got_dbclk)
 +      if (host->dbclk)
                clk_enable(host->dbclk);
  
        if (ret != 0)
@@@ -1248,7 -1234,6 +1248,7 @@@ static void omap_hsmmc_dma_cb(int lch, 
        struct omap_hsmmc_host *host = cb_data;
        struct mmc_data *data;
        int dma_ch, req_in_progress;
 +      unsigned long flags;
  
        if (!(ch_status & OMAP_DMA_BLOCK_IRQ)) {
                dev_warn(mmc_dev(host->mmc), "unexpected dma status %x\n",
                return;
        }
  
 -      spin_lock(&host->irq_lock);
 +      spin_lock_irqsave(&host->irq_lock, flags);
        if (host->dma_ch < 0) {
 -              spin_unlock(&host->irq_lock);
 +              spin_unlock_irqrestore(&host->irq_lock, flags);
                return;
        }
  
                /* Fire up the next transfer. */
                omap_hsmmc_config_dma_params(host, data,
                                           data->sg + host->dma_sg_idx);
 -              spin_unlock(&host->irq_lock);
 +              spin_unlock_irqrestore(&host->irq_lock, flags);
                return;
        }
  
        req_in_progress = host->req_in_progress;
        dma_ch = host->dma_ch;
        host->dma_ch = -1;
 -      spin_unlock(&host->irq_lock);
 +      spin_unlock_irqrestore(&host->irq_lock, flags);
  
        omap_free_dma(dma_ch);
  
@@@ -1781,7 -1766,7 +1781,7 @@@ static struct omap_mmc_platform_data *o
                pdata->slots[0].nonremovable = true;
                pdata->slots[0].no_regulator_off_init = true;
        }
-       of_property_read_u32(np, "ti,bus-width", &bus_width);
+       of_property_read_u32(np, "bus-width", &bus_width);
        if (bus_width == 4)
                pdata->slots[0].caps |= MMC_CAP_4_BIT_DATA;
        else if (bus_width == 8)
@@@ -1859,7 -1844,6 +1859,7 @@@ static int __devinit omap_hsmmc_probe(s
        host->mapbase   = res->start + pdata->reg_offset;
        host->base      = ioremap(host->mapbase, SZ_4K);
        host->power_mode = MMC_POWER_OFF;
 +      host->flags     = AUTO_CMD12;
        host->next_data.cookie = 1;
  
        platform_set_drvdata(pdev, host);
  
        omap_hsmmc_context_save(host);
  
 -      if (cpu_is_omap2430()) {
 -              host->dbclk = clk_get(&pdev->dev, "mmchsdb_fck");
 -              /*
 -               * MMC can still work without debounce clock.
 -               */
 -              if (IS_ERR(host->dbclk))
 -                      dev_warn(mmc_dev(host->mmc),
 -                              "Failed to get debounce clock\n");
 -              else
 -                      host->got_dbclk = 1;
 -
 -              if (host->got_dbclk)
 -                      if (clk_enable(host->dbclk) != 0)
 -                              dev_dbg(mmc_dev(host->mmc), "Enabling debounce"
 -                                                      " clk failed\n");
 +      host->dbclk = clk_get(&pdev->dev, "mmchsdb_fck");
 +      /*
 +       * 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_enable(host->dbclk) != 0) {
 +              dev_warn(mmc_dev(host->mmc), "Failed to enable debounce clk\n");
 +              clk_put(host->dbclk);
 +              host->dbclk = NULL;
        }
  
        /* Since we do only SG emulation, we can have as many segs
                ret = request_threaded_irq(mmc_slot(host).card_detect_irq,
                                           NULL,
                                           omap_hsmmc_detect,
 -                                         IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
 +                                         IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
                                           mmc_hostname(mmc), host);
                if (ret) {
                        dev_dbg(mmc_dev(host->mmc),
@@@ -2031,7 -2019,7 +2031,7 @@@ err_irq
        pm_runtime_put_sync(host->dev);
        pm_runtime_disable(host->dev);
        clk_put(host->fclk);
 -      if (host->got_dbclk) {
 +      if (host->dbclk) {
                clk_disable(host->dbclk);
                clk_put(host->dbclk);
        }
@@@ -2042,9 -2030,7 +2042,9 @@@ err1
  err_alloc:
        omap_hsmmc_gpio_free(pdata);
  err:
 -      release_mem_region(res->start, resource_size(res));
 +      res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 +      if (res)
 +              release_mem_region(res->start, resource_size(res));
        return ret;
  }
  
@@@ -2066,7 -2052,7 +2066,7 @@@ static int __devexit omap_hsmmc_remove(
        pm_runtime_put_sync(host->dev);
        pm_runtime_disable(host->dev);
        clk_put(host->fclk);
 -      if (host->got_dbclk) {
 +      if (host->dbclk) {
                clk_disable(host->dbclk);
                clk_put(host->dbclk);
        }
@@@ -2124,7 -2110,7 +2124,7 @@@ static int omap_hsmmc_suspend(struct de
                                OMAP_HSMMC_READ(host->base, HCTL) & ~SDBP);
        }
  
 -      if (host->got_dbclk)
 +      if (host->dbclk)
                clk_disable(host->dbclk);
  err:
        pm_runtime_put_sync(host->dev);
@@@ -2145,7 -2131,7 +2145,7 @@@ static int omap_hsmmc_resume(struct dev
  
        pm_runtime_get_sync(host->dev);
  
 -      if (host->got_dbclk)
 +      if (host->dbclk)
                clk_enable(host->dbclk);
  
        if (!(host->mmc->pm_flags & MMC_PM_KEEP_POWER))
index d190d04636a714e87da50a3f8748b17347ca225f,0d2b082f22466717fb974d7c1714db53217299d7..365b16c230f8905653c4987c61dda268721d5334
@@@ -24,7 -24,6 +24,7 @@@
  #include <linux/of.h>
  #include <linux/of_device.h>
  #include <linux/of_gpio.h>
 +#include <linux/pinctrl/consumer.h>
  #include <mach/esdhc.h>
  #include "sdhci-pltfm.h"
  #include "sdhci-esdhc.h"
@@@ -69,7 -68,6 +69,7 @@@ struct pltfm_imx_data 
        int flags;
        u32 scratchpad;
        enum imx_esdhc_type devtype;
 +      struct pinctrl *pinctrl;
        struct esdhc_platform_data boarddata;
  };
  
@@@ -404,7 -402,7 +404,7 @@@ sdhci_esdhc_imx_probe_dt(struct platfor
        if (!np)
                return -ENODEV;
  
-       if (of_get_property(np, "fsl,card-wired", NULL))
+       if (of_get_property(np, "non-removable", NULL))
                boarddata->cd_type = ESDHC_CD_PERMANENT;
  
        if (of_get_property(np, "fsl,cd-controller", NULL))
@@@ -469,12 -467,6 +469,12 @@@ static int __devinit sdhci_esdhc_imx_pr
        clk_prepare_enable(clk);
        pltfm_host->clk = clk;
  
 +      imx_data->pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
 +      if (IS_ERR(imx_data->pinctrl)) {
 +              err = PTR_ERR(imx_data->pinctrl);
 +              goto pin_err;
 +      }
 +
        host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
  
        if (is_imx25_esdhc(imx_data) || is_imx35_esdhc(imx_data))
@@@ -566,7 -558,6 +566,7 @@@ no_card_detect_irq
                gpio_free(boarddata->wp_gpio);
  no_card_detect_pin:
  no_board_data:
 +pin_err:
        clk_disable_unprepare(pltfm_host->clk);
        clk_put(pltfm_host->clk);
  err_clk_get:
index 4a44bf833611bc88126005d219853ae15850621b,99ae5ea3f8d1d39ea2fd51ce82dbf6ccd3f3fa83..68548236ec4228ceb224d69845daba6345bf9971
@@@ -147,7 -147,18 +147,7 @@@ static int tegra_ehci_hub_control
  
        spin_lock_irqsave(&ehci->lock, flags);
  
 -      /*
 -       * In ehci_hub_control() for USB_PORT_FEAT_ENABLE clears the other bits
 -       * that are write on clear, by writing back the register read value, so
 -       * USB_PORT_FEAT_ENABLE is handled by masking the set on clear bits
 -       */
 -      if (typeReq == ClearPortFeature && wValue == USB_PORT_FEAT_ENABLE) {
 -              temp = ehci_readl(ehci, status_reg) & ~PORT_RWC_BITS;
 -              ehci_writel(ehci, temp & ~PORT_PE, status_reg);
 -              goto done;
 -      }
 -
 -      else if (typeReq == GetPortStatus) {
 +      if (typeReq == GetPortStatus) {
                temp = ehci_readl(ehci, status_reg);
                if (tegra->port_resuming && !(temp & PORT_SUSPEND)) {
                        /* Resume completed, re-enable disconnect detection */
                        goto done;
                }
  
 -              temp &= ~PORT_WKCONN_E;
 +              temp &= ~(PORT_RWC_BITS | PORT_WKCONN_E);
                temp |= PORT_WKDISC_E | PORT_WKOC_E;
                ehci_writel(ehci, temp | PORT_SUSPEND, status_reg);
  
@@@ -308,23 -319,26 +308,23 @@@ static int tegra_ehci_setup(struct usb_
        return retval;
  }
  
 -struct temp_buffer {
 +struct dma_aligned_buffer {
        void *kmalloc_ptr;
        void *old_xfer_buffer;
        u8 data[0];
  };
  
 -static void free_temp_buffer(struct urb *urb)
 +static void free_dma_aligned_buffer(struct urb *urb)
  {
 -      enum dma_data_direction dir;
 -      struct temp_buffer *temp;
 +      struct dma_aligned_buffer *temp;
  
        if (!(urb->transfer_flags & URB_ALIGNED_TEMP_BUFFER))
                return;
  
 -      dir = usb_urb_dir_in(urb) ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
 -
 -      temp = container_of(urb->transfer_buffer, struct temp_buffer,
 -                          data);
 +      temp = container_of(urb->transfer_buffer,
 +              struct dma_aligned_buffer, data);
  
 -      if (dir == DMA_FROM_DEVICE)
 +      if (usb_urb_dir_in(urb))
                memcpy(temp->old_xfer_buffer, temp->data,
                       urb->transfer_buffer_length);
        urb->transfer_buffer = temp->old_xfer_buffer;
        urb->transfer_flags &= ~URB_ALIGNED_TEMP_BUFFER;
  }
  
 -static int alloc_temp_buffer(struct urb *urb, gfp_t mem_flags)
 +static int alloc_dma_aligned_buffer(struct urb *urb, gfp_t mem_flags)
  {
 -      enum dma_data_direction dir;
 -      struct temp_buffer *temp, *kmalloc_ptr;
 +      struct dma_aligned_buffer *temp, *kmalloc_ptr;
        size_t kmalloc_size;
  
        if (urb->num_sgs || urb->sg ||
            !((uintptr_t)urb->transfer_buffer & (TEGRA_USB_DMA_ALIGN - 1)))
                return 0;
  
 -      dir = usb_urb_dir_in(urb) ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
 -
        /* Allocate a buffer with enough padding for alignment */
        kmalloc_size = urb->transfer_buffer_length +
 -              sizeof(struct temp_buffer) + TEGRA_USB_DMA_ALIGN - 1;
 +              sizeof(struct dma_aligned_buffer) + TEGRA_USB_DMA_ALIGN - 1;
  
        kmalloc_ptr = kmalloc(kmalloc_size, mem_flags);
        if (!kmalloc_ptr)
                return -ENOMEM;
  
 -      /* Position our struct temp_buffer such that data is aligned */
 +      /* Position our struct dma_aligned_buffer such that data is aligned */
        temp = PTR_ALIGN(kmalloc_ptr + 1, TEGRA_USB_DMA_ALIGN) - 1;
 -
        temp->kmalloc_ptr = kmalloc_ptr;
        temp->old_xfer_buffer = urb->transfer_buffer;
 -      if (dir == DMA_TO_DEVICE)
 +      if (usb_urb_dir_out(urb))
                memcpy(temp->data, urb->transfer_buffer,
                       urb->transfer_buffer_length);
        urb->transfer_buffer = temp->data;
@@@ -370,13 -388,13 +370,13 @@@ static int tegra_ehci_map_urb_for_dma(s
  {
        int ret;
  
 -      ret = alloc_temp_buffer(urb, mem_flags);
 +      ret = alloc_dma_aligned_buffer(urb, mem_flags);
        if (ret)
                return ret;
  
        ret = usb_hcd_map_urb_for_dma(hcd, urb, mem_flags);
        if (ret)
 -              free_temp_buffer(urb);
 +              free_dma_aligned_buffer(urb);
  
        return ret;
  }
  static void tegra_ehci_unmap_urb_for_dma(struct usb_hcd *hcd, struct urb *urb)
  {
        usb_hcd_unmap_urb_for_dma(hcd, urb);
 -      free_temp_buffer(urb);
 +      free_dma_aligned_buffer(urb);
  }
  
  static const struct hc_driver tegra_ehci_hc_driver = {
        .description            = hcd_name,
        .product_desc           = "Tegra EHCI Host Controller",
        .hcd_priv_size          = sizeof(struct ehci_hcd),
 -
        .flags                  = HCD_USB2 | HCD_MEMORY,
  
 -      .reset                  = tegra_ehci_setup,
 +      /* standard ehci functions */
        .irq                    = ehci_irq,
 -
        .start                  = ehci_run,
        .stop                   = ehci_stop,
 -      .shutdown               = tegra_ehci_shutdown,
        .urb_enqueue            = ehci_urb_enqueue,
        .urb_dequeue            = ehci_urb_dequeue,
 -      .map_urb_for_dma        = tegra_ehci_map_urb_for_dma,
 -      .unmap_urb_for_dma      = tegra_ehci_unmap_urb_for_dma,
        .endpoint_disable       = ehci_endpoint_disable,
        .endpoint_reset         = ehci_endpoint_reset,
        .get_frame_number       = ehci_get_frame,
        .hub_status_data        = ehci_hub_status_data,
 -      .hub_control            = tegra_ehci_hub_control,
        .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
 +      .relinquish_port        = ehci_relinquish_port,
 +      .port_handed_over       = ehci_port_handed_over,
 +
 +      /* modified ehci functions for tegra */
 +      .reset                  = tegra_ehci_setup,
 +      .shutdown               = tegra_ehci_shutdown,
 +      .map_urb_for_dma        = tegra_ehci_map_urb_for_dma,
 +      .unmap_urb_for_dma      = tegra_ehci_unmap_urb_for_dma,
 +      .hub_control            = tegra_ehci_hub_control,
  #ifdef CONFIG_PM
        .bus_suspend            = ehci_bus_suspend,
        .bus_resume             = ehci_bus_resume,
  #endif
 -      .relinquish_port        = ehci_relinquish_port,
 -      .port_handed_over       = ehci_port_handed_over,
  };
  
  static int setup_vbus_gpio(struct platform_device *pdev,
@@@ -722,8 -739,9 +722,9 @@@ static int tegra_ehci_probe(struct plat
                }
        }
  
-       tegra->phy = tegra_usb_phy_open(instance, hcd->regs, pdata->phy_config,
-                                               TEGRA_USB_PHY_MODE_HOST);
+       tegra->phy = tegra_usb_phy_open(&pdev->dev, instance, hcd->regs,
+                                       pdata->phy_config,
+                                       TEGRA_USB_PHY_MODE_HOST);
        if (IS_ERR(tegra->phy)) {
                dev_err(&pdev->dev, "Failed to open USB phy\n");
                err = -ENXIO;