Merge tag 'mvebu' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 14 Dec 2012 22:54:26 +0000 (14:54 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 14 Dec 2012 22:54:26 +0000 (14:54 -0800)
Pull ARM SoC updates for Marvell mvebu/kirkwood from Olof Johansson:
 "This is a branch with updates for Marvell's mvebu/kirkwood platforms.
  They came in late-ish, and were heavily interdependent such that it
  didn't make sense to split them up across the cross-platform topic
  branches.  So here they are (for the second release in a row) in a
  branch on their own."

* tag 'mvebu' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (88 commits)
  arm: l2x0: add aurora related properties to OF binding
  arm: mvebu: add Aurora L2 Cache Controller to the DT
  arm: mvebu: add L2 cache support
  dma: mv_xor: fix error handling path
  dma: mv_xor: fix error checking of irq_of_parse_and_map()
  dma: mv_xor: use request_irq() instead of devm_request_irq()
  dma: mv_xor: clear the window override control registers
  arm: mvebu: fix address decoding armada_cfg_base() function
  ARM: mvebu: update defconfig with I2C and RTC support
  ARM: mvebu: Add SATA support for OpenBlocks AX3-4
  ARM: mvebu: Add support for the RTC in OpenBlocks AX3-4
  ARM: mvebu: Add support for I2C on OpenBlocks AX3-4
  ARM: mvebu: Add support for I2C controllers in Armada 370/XP
  arm: mvebu: Add hardware I/O Coherency support
  arm: plat-orion: Add coherency attribute when setup mbus target
  arm: dma mapping: Export a dma ops function arm_dma_set_mask
  arm: mvebu: Add SMP support for Armada XP
  arm: mm: Add support for PJ4B cpu and init routines
  arm: mvebu: Add IPI support via doorbells
  arm: mvebu: Add initial support for power managmement service unit
  ...

14 files changed:
1  2 
Documentation/devicetree/bindings/arm/l2cc.txt
MAINTAINERS
arch/arm/Kconfig
arch/arm/boot/dts/Makefile
arch/arm/boot/dts/dove.dtsi
arch/arm/boot/dts/kirkwood.dtsi
arch/arm/include/asm/dma-mapping.h
arch/arm/mach-kirkwood/Kconfig
arch/arm/mach-kirkwood/board-dt.c
arch/arm/mach-kirkwood/common.c
arch/arm/mm/proc-v7.S
drivers/clk/Kconfig
drivers/clk/Makefile
drivers/dma/mv_xor.c

diff --cc MAINTAINERS
Simple merge
Simple merge
Simple merge
Simple merge
                wdt@20300 {
                        compatible = "marvell,orion-wdt";
                        reg = <0x20300 0x28>;
+                       clocks = <&gate_clk 7>;
+                       status = "okay";
+               };
+               xor@60800 {
+                       compatible = "marvell,orion-xor";
+                       reg = <0x60800 0x100
+                              0x60A00 0x100>;
+                       status = "okay";
+                       clocks = <&gate_clk 8>;
+                       xor00 {
+                             interrupts = <5>;
+                             dmacap,memcpy;
+                             dmacap,xor;
+                       };
+                       xor01 {
+                             interrupts = <6>;
+                             dmacap,memcpy;
+                             dmacap,xor;
+                             dmacap,memset;
+                       };
+               };
+               xor@60900 {
+                       compatible = "marvell,orion-xor";
+                       reg = <0x60900 0x100
+                              0xd0B00 0x100>;
                        status = "okay";
+                       clocks = <&gate_clk 16>;
+                       xor00 {
+                             interrupts = <7>;
+                             dmacap,memcpy;
+                             dmacap,xor;
+                       };
+                       xor01 {
+                             interrupts = <8>;
+                             dmacap,memcpy;
+                             dmacap,xor;
+                             dmacap,memset;
+                       };
                };
  
 +              ehci@50000 {
 +                      compatible = "marvell,orion-ehci";
 +                      reg = <0x50000 0x1000>;
 +                      interrupts = <19>;
 +                      status = "okay";
 +              };
 +
                sata@80000 {
                        compatible = "marvell,orion-sata";
                        reg = <0x80000 0x5000>;
Simple merge
@@@ -46,11 -46,8 +46,13 @@@ config MACH_GURUPLU
  
  config ARCH_KIRKWOOD_DT
        bool "Marvell Kirkwood Flattened Device Tree"
 +      select POWER_SUPPLY
 +      select POWER_RESET
 +      select POWER_RESET_GPIO
 +      select REGULATOR
 +      select REGULATOR_FIXED_VOLTAGE
+       select MVEBU_CLK_CORE
+       select MVEBU_CLK_GATING
        select USE_OF
        help
          Say 'Y' here if you want your kernel to support the
@@@ -96,30 -128,10 +128,29 @@@ static void __init kirkwood_dt_init(voi
        if (of_machine_is_compatible("keymile,km_kirkwood"))
                km_kirkwood_init();
  
-       of_platform_populate(NULL, kirkwood_dt_match_table,
-                            kirkwood_auxdata_lookup, NULL);
 +      if (of_machine_is_compatible("lacie,inetspace_v2") ||
 +          of_machine_is_compatible("lacie,netspace_v2") ||
 +          of_machine_is_compatible("lacie,netspace_max_v2") ||
 +          of_machine_is_compatible("lacie,netspace_lite_v2") ||
 +          of_machine_is_compatible("lacie,netspace_mini_v2"))
 +              ns2_init();
 +
 +      if (of_machine_is_compatible("mpl,cec4"))
 +              mplcec4_init();
 +
 +      if (of_machine_is_compatible("plathome,openblocks-a6"))
 +              openblocks_a6_init();
 +
 +      if (of_machine_is_compatible("usi,topkick"))
 +              usi_topkick_init();
 +
 +      if (of_machine_is_compatible("zyxel,nsa310"))
 +              nsa310_init();
 +
+       of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
  }
  
 -static const char *kirkwood_dt_board_compat[] = {
 +static const char * const kirkwood_dt_board_compat[] = {
        "globalscale,dreamplug",
        "dlink,dns-320",
        "dlink,dns-325",
Simple merge
Simple merge
@@@ -55,12 -53,6 +55,14 @@@ config COMMON_CLK_MAX7768
        ---help---
          This driver supports Maxim 77686 crystal oscillator clock. 
  
 +config CLK_TWL6040
 +      tristate "External McPDM functional clock from twl6040"
 +      depends on TWL6040_CORE
 +      ---help---
 +        Enable the external functional clock support on OMAP4+ platforms for
 +        McPDM. McPDM module is using the external bit clock on the McPDM bus
 +        as functional clock.
 +
  endmenu
+ source "drivers/clk/mvebu/Kconfig"
Simple merge
@@@ -901,7 -901,7 +901,7 @@@ static void mv_xor_issue_pending(struc
   */
  #define MV_XOR_TEST_SIZE 2000
  
- static int mv_xor_memcpy_self_test(struct mv_xor_device *device)
 -static int __devinit mv_xor_memcpy_self_test(struct mv_xor_chan *mv_chan)
++static int mv_xor_memcpy_self_test(struct mv_xor_chan *mv_chan)
  {
        int i;
        void *src, *dest;
@@@ -975,8 -970,8 +970,8 @@@ out
  }
  
  #define MV_XOR_NUM_SRC_TEST 4 /* must be <= 15 */
 -static int __devinit
 +static int
- mv_xor_xor_self_test(struct mv_xor_device *device)
+ mv_xor_xor_self_test(struct mv_xor_chan *mv_chan)
  {
        int i, src_idx;
        struct page *dest;
@@@ -1258,27 -1241,22 +1241,22 @@@ mv_xor_conf_mbus_windows(struct mv_xor_
  
        writel(win_enable, base + WINDOW_BAR_ENABLE(0));
        writel(win_enable, base + WINDOW_BAR_ENABLE(1));
+       writel(0, base + WINDOW_OVERRIDE_CTRL(0));
+       writel(0, base + WINDOW_OVERRIDE_CTRL(1));
  }
  
- static struct platform_driver mv_xor_driver = {
-       .probe          = mv_xor_probe,
-       .remove         = mv_xor_remove,
-       .driver         = {
-               .owner  = THIS_MODULE,
-               .name   = MV_XOR_NAME,
-       },
- };
- static int mv_xor_shared_probe(struct platform_device *pdev)
 -static int __devinit mv_xor_probe(struct platform_device *pdev)
++static int mv_xor_probe(struct platform_device *pdev)
  {
        const struct mbus_dram_target_info *dram;
-       struct mv_xor_shared_private *msp;
+       struct mv_xor_device *xordev;
+       struct mv_xor_platform_data *pdata = pdev->dev.platform_data;
        struct resource *res;
+       int i, ret;
  
-       dev_printk(KERN_NOTICE, &pdev->dev, "Marvell shared XOR driver\n");
+       dev_notice(&pdev->dev, "Marvell XOR driver\n");
  
-       msp = devm_kzalloc(&pdev->dev, sizeof(*msp), GFP_KERNEL);
-       if (!msp)
+       xordev = devm_kzalloc(&pdev->dev, sizeof(*xordev), GFP_KERNEL);
+       if (!xordev)
                return -ENOMEM;
  
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        /* Not all platforms can gate the clock, so it is not
         * an error if the clock does not exists.
         */
-       msp->clk = clk_get(&pdev->dev, NULL);
-       if (!IS_ERR(msp->clk))
-               clk_prepare_enable(msp->clk);
+       xordev->clk = clk_get(&pdev->dev, NULL);
+       if (!IS_ERR(xordev->clk))
+               clk_prepare_enable(xordev->clk);
+       if (pdev->dev.of_node) {
+               struct device_node *np;
+               int i = 0;
+               for_each_child_of_node(pdev->dev.of_node, np) {
+                       dma_cap_mask_t cap_mask;
+                       int irq;
+                       dma_cap_zero(cap_mask);
+                       if (of_property_read_bool(np, "dmacap,memcpy"))
+                               dma_cap_set(DMA_MEMCPY, cap_mask);
+                       if (of_property_read_bool(np, "dmacap,xor"))
+                               dma_cap_set(DMA_XOR, cap_mask);
+                       if (of_property_read_bool(np, "dmacap,memset"))
+                               dma_cap_set(DMA_MEMSET, cap_mask);
+                       if (of_property_read_bool(np, "dmacap,interrupt"))
+                               dma_cap_set(DMA_INTERRUPT, cap_mask);
+                       irq = irq_of_parse_and_map(np, 0);
+                       if (!irq) {
+                               ret = -ENODEV;
+                               goto err_channel_add;
+                       }
+                       xordev->channels[i] =
+                               mv_xor_channel_add(xordev, pdev, i,
+                                                  cap_mask, irq);
+                       if (IS_ERR(xordev->channels[i])) {
+                               ret = PTR_ERR(xordev->channels[i]);
+                               xordev->channels[i] = NULL;
+                               irq_dispose_mapping(irq);
+                               goto err_channel_add;
+                       }
+                       i++;
+               }
+       } else if (pdata && pdata->channels) {
+               for (i = 0; i < MV_XOR_MAX_CHANNELS; i++) {
+                       struct mv_xor_channel_data *cd;
+                       int irq;
+                       cd = &pdata->channels[i];
+                       if (!cd) {
+                               ret = -ENODEV;
+                               goto err_channel_add;
+                       }
+                       irq = platform_get_irq(pdev, i);
+                       if (irq < 0) {
+                               ret = irq;
+                               goto err_channel_add;
+                       }
+                       xordev->channels[i] =
+                               mv_xor_channel_add(xordev, pdev, i,
+                                                  cd->cap_mask, irq);
+                       if (IS_ERR(xordev->channels[i])) {
+                               ret = PTR_ERR(xordev->channels[i]);
+                               goto err_channel_add;
+                       }
+               }
+       }
  
        return 0;
+ err_channel_add:
+       for (i = 0; i < MV_XOR_MAX_CHANNELS; i++)
+               if (xordev->channels[i]) {
+                       if (pdev->dev.of_node)
+                               irq_dispose_mapping(xordev->channels[i]->irq);
+                       mv_xor_channel_remove(xordev->channels[i]);
+               }
+       clk_disable_unprepare(xordev->clk);
+       clk_put(xordev->clk);
+       return ret;
  }
  
- static int mv_xor_shared_remove(struct platform_device *pdev)
 -static int __devexit mv_xor_remove(struct platform_device *pdev)
++static int mv_xor_remove(struct platform_device *pdev)
  {
-       struct mv_xor_shared_private *msp = platform_get_drvdata(pdev);
+       struct mv_xor_device *xordev = platform_get_drvdata(pdev);
+       int i;
+       for (i = 0; i < MV_XOR_MAX_CHANNELS; i++) {
+               if (xordev->channels[i])
+                       mv_xor_channel_remove(xordev->channels[i]);
+       }
  
-       if (!IS_ERR(msp->clk)) {
-               clk_disable_unprepare(msp->clk);
-               clk_put(msp->clk);
+       if (!IS_ERR(xordev->clk)) {
+               clk_disable_unprepare(xordev->clk);
+               clk_put(xordev->clk);
        }
  
        return 0;
  }
  
- static struct platform_driver mv_xor_shared_driver = {
-       .probe          = mv_xor_shared_probe,
-       .remove         = mv_xor_shared_remove,
+ #ifdef CONFIG_OF
 -static struct of_device_id mv_xor_dt_ids[] __devinitdata = {
++static struct of_device_id mv_xor_dt_ids[] = {
+        { .compatible = "marvell,orion-xor", },
+        {},
+ };
+ MODULE_DEVICE_TABLE(of, mv_xor_dt_ids);
+ #endif
+ static struct platform_driver mv_xor_driver = {
+       .probe          = mv_xor_probe,
 -      .remove         = __devexit_p(mv_xor_remove),
++      .remove         = mv_xor_remove,
        .driver         = {
-               .owner  = THIS_MODULE,
-               .name   = MV_XOR_SHARED_NAME,
+               .owner          = THIS_MODULE,
+               .name           = MV_XOR_NAME,
+               .of_match_table = of_match_ptr(mv_xor_dt_ids),
        },
  };