Merge branches 'imx/pata' and 'imx/sata' into next/driver
authorArnd Bergmann <arnd@arndb.de>
Thu, 20 Oct 2011 13:17:34 +0000 (15:17 +0200)
committerArnd Bergmann <arnd@arndb.de>
Thu, 20 Oct 2011 13:17:34 +0000 (15:17 +0200)
Conflicts:
arch/arm/mach-mx5/clock-mx51-mx53.c
arch/arm/mach-mx5/devices-imx53.h

1  2 
arch/arm/mach-mx5/clock-mx51-mx53.c
arch/arm/mach-mx5/devices-imx53.h
arch/arm/mach-mx5/mx51_efika.c
arch/arm/plat-mxc/devices/Kconfig
arch/arm/plat-mxc/devices/Makefile
arch/arm/plat-mxc/include/mach/devices-common.h

@@@ -271,7 -271,11 +271,11 @@@ static int _clk_pll_enable(struct clk *
        int i = 0;
  
        pllbase = _get_pll_base(clk);
-       reg = __raw_readl(pllbase + MXC_PLL_DP_CTL) | MXC_PLL_DP_CTL_UPEN;
+       reg = __raw_readl(pllbase + MXC_PLL_DP_CTL);
+       if (reg & MXC_PLL_DP_CTL_UPEN)
+               return 0;
+       reg |= MXC_PLL_DP_CTL_UPEN;
        __raw_writel(reg, pllbase + MXC_PLL_DP_CTL);
  
        /* Wait for lock */
@@@ -1397,6 -1401,22 +1401,22 @@@ static struct clk esdhc4_mx53_clk = 
        .secondary = &esdhc4_ipg_clk,
  };
  
+ static struct clk sata_clk = {
+       .parent = &ipg_clk,
+       .enable = _clk_max_enable,
+       .enable_reg = MXC_CCM_CCGR4,
+       .enable_shift = MXC_CCM_CCGRx_CG1_OFFSET,
+       .disable = _clk_max_disable,
+ };
+ static struct clk ahci_phy_clk = {
+       .parent = &usb_phy1_clk,
+ };
+ static struct clk ahci_dma_clk = {
+       .parent = &ahb_clk,
+ };
  DEFINE_CLOCK(mipi_esc_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG5_OFFSET, NULL, NULL, NULL, &pll2_sw_clk);
  DEFINE_CLOCK(mipi_hsc2_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG4_OFFSET, NULL, NULL, &mipi_esc_clk, &pll2_sw_clk);
  DEFINE_CLOCK(mipi_hsc1_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG3_OFFSET, NULL, NULL, &mipi_hsc2_clk, &pll2_sw_clk);
@@@ -1414,10 -1434,6 +1434,10 @@@ DEFINE_CLOCK(ipu_di0_clk, 0, MXC_CCM_CC
  DEFINE_CLOCK(ipu_di1_clk, 0, MXC_CCM_CCGR6, MXC_CCM_CCGRx_CG6_OFFSET,
                NULL, NULL, &pll3_sw_clk, NULL);
  
 +/* PATA */
 +DEFINE_CLOCK(pata_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG0_OFFSET,
 +              NULL, NULL, &ipg_clk, &spba_clk);
 +
  #define _REGISTER_CLOCK(d, n, c) \
         { \
                .dev_id = d, \
@@@ -1474,7 -1490,6 +1494,7 @@@ static struct clk_lookup mx51_lookups[
        _REGISTER_CLOCK("imx-ipuv3", "di0", ipu_di0_clk)
        _REGISTER_CLOCK("imx-ipuv3", "di1", ipu_di1_clk)
        _REGISTER_CLOCK(NULL, "gpc_dvfs", gpc_dvfs_clk)
 +      _REGISTER_CLOCK("pata_imx", NULL, pata_clk)
  };
  
  static struct clk_lookup mx53_lookups[] = {
        _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk)
        _REGISTER_CLOCK("imx-ssi.2", NULL, ssi3_clk)
        _REGISTER_CLOCK("imx-keypad", NULL, dummy_clk)
 +      _REGISTER_CLOCK("pata_imx", NULL, pata_clk)
+       _REGISTER_CLOCK("imx53-ahci.0", "ahci", sata_clk)
+       _REGISTER_CLOCK("imx53-ahci.0", "ahci_phy", ahci_phy_clk)
+       _REGISTER_CLOCK("imx53-ahci.0", "ahci_dma", ahci_dma_clk)
  };
  
  static void clk_tree_init(void)
@@@ -41,6 -41,4 +41,7 @@@ extern const struct imx_imx_keypad_dat
  #define imx53_add_imx_keypad(pdata)   \
        imx_add_imx_keypad(&imx53_imx_keypad_data, pdata)
  
 +extern const struct imx_pata_imx_data imx53_pata_imx_data;
 +#define imx53_add_pata_imx() \
 +      imx_add_pata_imx(&imx53_pata_imx_data)
+ extern struct platform_device *__init imx53_add_ahci_imx(void);
@@@ -186,7 -186,7 +186,7 @@@ static int initialize_usbh1_port(struc
  
        mdelay(10);
  
-       return mx51_initialize_usb_hw(0, MXC_EHCI_ITC_NO_THRESHOLD);
+       return mx51_initialize_usb_hw(pdev->id, MXC_EHCI_ITC_NO_THRESHOLD);
  }
  
  static struct mxc_usbh_platform_data usbh1_config = {
@@@ -627,8 -627,6 +627,8 @@@ void __init efika_board_common_init(voi
                ARRAY_SIZE(mx51_efika_spi_board_info));
        imx51_add_ecspi(0, &mx51_efika_spi_pdata);
  
 +      imx51_add_pata_imx();
 +
  #if defined(CONFIG_CPU_FREQ_IMX)
        get_cpu_op = mx51_get_cpu_op;
  #endif
@@@ -31,9 -31,6 +31,9 @@@ config IMX_HAVE_PLATFORM_IMX_I2
  config IMX_HAVE_PLATFORM_IMX_KEYPAD
        bool
  
 +config IMX_HAVE_PLATFORM_PATA_IMX
 +      bool
 +
  config IMX_HAVE_PLATFORM_IMX_SSI
        bool
  
@@@ -79,3 -76,7 +79,7 @@@ config IMX_HAVE_PLATFORM_SDHCI_ESDHC_IM
  
  config IMX_HAVE_PLATFORM_SPI_IMX
        bool
+ config IMX_HAVE_PLATFORM_AHCI
+       bool
+       default y if ARCH_MX53
@@@ -10,7 -10,6 +10,7 @@@ obj-y += platform-imx-dma.
  obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_FB) += platform-imx-fb.o
  obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o
  obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_KEYPAD) += platform-imx-keypad.o
 +obj-$(CONFIG_IMX_HAVE_PLATFORM_PATA_IMX) += platform-pata_imx.o
  obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SSI) += platform-imx-ssi.o
  obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART) += platform-imx-uart.o
  obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UDC) += platform-imx_udc.o
@@@ -26,3 -25,4 +26,4 @@@ obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_RTC
  obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_W1) += platform-mxc_w1.o
  obj-$(CONFIG_IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX) += platform-sdhci-esdhc-imx.o
  obj-$(CONFIG_IMX_HAVE_PLATFORM_SPI_IMX) +=  platform-spi_imx.o
+ obj-$(CONFIG_IMX_HAVE_PLATFORM_AHCI) +=  platform-ahci-imx.o
@@@ -251,14 -251,6 +251,14 @@@ struct platform_device *__init imx_add_
                const struct imx_mxc_nand_data *data,
                const struct mxc_nand_platform_data *pdata);
  
 +struct imx_pata_imx_data {
 +      resource_size_t iobase;
 +      resource_size_t iosize;
 +      resource_size_t irq;
 +};
 +struct platform_device *__init imx_add_pata_imx(
 +              const struct imx_pata_imx_data *data);
 +
  struct imx_mxc_pwm_data {
        int id;
        resource_size_t iobase;
@@@ -309,3 -301,13 +309,13 @@@ struct platform_device *__init imx_add_
  struct platform_device *imx_add_imx_dma(void);
  struct platform_device *imx_add_imx_sdma(char *name,
        resource_size_t iobase, int irq, struct sdma_platform_data *pdata);
+ #include <linux/ahci_platform.h>
+ struct imx_ahci_imx_data {
+       const char *devid;
+       resource_size_t iobase;
+       resource_size_t irq;
+ };
+ struct platform_device *__init imx_add_ahci_imx(
+               const struct imx_ahci_imx_data *data,
+               const struct ahci_platform_data *pdata);