Merge tag 'soc-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 5 Apr 2014 21:19:54 +0000 (14:19 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 5 Apr 2014 21:19:54 +0000 (14:19 -0700)
Pull ARM SoC specific changes from Arnd Bergmann:
 "Lots of changes specific to one of the SoC families.  Some that stick
  out are:

   - mach-qcom gains new features, most importantly SMP support for the
     newer chips (Stephen Boyd, Rohit Vaswani)
   - mvebu gains support for three new SoCs: Armada 375, 380 and 385
     (Thomas Petazzoni and Free-electrons team)
   - SMP support for Rockchips (Heiko Stübner)
   - Lots of i.MX changes (Shawn Guo)
   - Added support for BCM5301x SoC (Hauke Mehrtens)
   - Multiplatform support for Marvell Kirkwood and Dove (Andrew Lunn
     and Sebastian Hesselbarth doing the final part of a long journey)
   - Unify davinci platforms and remove obsolete ones (Sekhar Nori, Arnd
     Bergmann)"

* tag 'soc-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (126 commits)
  ARM: sunxi: Select HAVE_ARM_ARCH_TIMER
  ARM: cache-tauros2: remove ARMv6 code
  ARM: mvebu: don't select CONFIG_NEON
  ARM: davinci: fix DT booting with default defconfig
  ARM: configs: bcm_defconfig: enable bcm590xx regulator support
  ARM: davinci: remove tnetv107x support
  MAINTAINERS: Update ARM STi maintainers
  ARM: restrict BCM_KONA_UART to ARCH_BCM_MOBILE
  ARM: bcm21664: Add board support.
  ARM: sunxi: Add the new watchog compatibles to the reboot code
  ARM: enable ARM_HAS_SG_CHAIN for multiplatform
  ARM: davinci: remove da8xx_omapl_defconfig
  ARM: davinci: da8xx: fix multiple watchdog device registration
  ARM: davinci: add da8xx specific configs to davinci_all_defconfig
  ARM: davinci: enable da8xx build concurrently with older devices
  ARM: BCM5301X: workaround suppress fault
  ARM: BCM5301X: add early debugging support
  ARM: BCM5301X: initial support for the BCM5301X/BCM470X SoCs with ARM CPU
  ARM: mach-bcm: Remove GENERIC_TIME
  ARM: shmobile: APMU: Fix warnings due to improper printk formats
  ...

21 files changed:
1  2 
MAINTAINERS
arch/arm/Kconfig
arch/arm/Kconfig.debug
arch/arm/boot/dts/Makefile
arch/arm/configs/davinci_all_defconfig
arch/arm/include/asm/smp.h
arch/arm/mach-bcm/Kconfig
arch/arm/mach-bcm/Makefile
arch/arm/mach-clps711x/board-autcpu12.c
arch/arm/mach-davinci/Kconfig
arch/arm/mach-imx/pm-imx6.c
arch/arm/mach-mvebu/Kconfig
arch/arm/mach-mvebu/board-v7.c
arch/arm/mach-omap2/Kconfig
arch/arm/mach-omap2/dpll3xxx.c
arch/arm/mach-omap2/prminst44xx.c
arch/arm/mach-shmobile/Kconfig
arch/arm/mm/Kconfig
arch/arm/mm/cache-feroceon-l2.c
drivers/irqchip/Makefile
include/asm-generic/vmlinux.lds.h

diff --cc MAINTAINERS
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 396d05c8b5705fa78608b9b81a71d9efb5efb857,21474458aa56565325b1faddb9c49e5fafea35d8..49c914cd9c7a9c83159475a33c4a4a9961b7f4a9
@@@ -27,22 -27,32 +27,48 @@@ config ARCH_BCM_MOBIL
          BCM11130, BCM11140, BCM11351, BCM28145 and
          BCM28155 variants.
  
 +config ARCH_BCM2835
 +      bool "Broadcom BCM2835 family" if ARCH_MULTI_V6
 +      select ARCH_REQUIRE_GPIOLIB
 +      select ARM_AMBA
 +      select ARM_ERRATA_411920
 +      select ARM_TIMER_SP804
 +      select CLKDEV_LOOKUP
 +      select CLKSRC_OF
 +      select CPU_V6
 +      select GENERIC_CLOCKEVENTS
 +      select PINCTRL
 +      select PINCTRL_BCM2835
 +      help
 +        This enables support for the Broadcom BCM2835 SoC. This SoC is
 +        used in the Raspberry Pi and Roku 2 devices.
 +
+ config ARCH_BCM_5301X
+       bool "Broadcom BCM470X / BCM5301X ARM SoC" if ARCH_MULTI_V7
+       depends on MMU
+       select ARM_GIC
+       select CACHE_L2X0
+       select HAVE_ARM_SCU if SMP
+       select HAVE_ARM_TWD if SMP
+       select HAVE_SMP
+       select COMMON_CLK
+       select GENERIC_CLOCKEVENTS
+       select ARM_GLOBAL_TIMER
+       select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK
+       select MIGHT_HAVE_PCI
+       help
+         Support for Broadcom BCM470X and BCM5301X SoCs with ARM CPU cores.
+         This is a network SoC line mostly used in home routers and
+         wifi access points, it's internal name is Northstar.
+         This inclused the following SoC: BCM53010, BCM53011, BCM53012,
+         BCM53014, BCM53015, BCM53016, BCM53017, BCM53018, BCM4707,
+         BCM4708 and BCM4709.
+         Do not confuse this with the BCM4760 which is a totally
+         different SoC or with the older BCM47XX and BCM53XX based
+         network SoC using a MIPS CPU, they are supported by arch/mips/bcm47xx
  endmenu
  
  endif
index 0ad293882079453dd5d44bad084e946802e2fc85,4e4a2ed6851e5ea2d8478c48a29817aa1a8089f6..a326b28c44064656b69f67f20ce721a9e5192169
@@@ -10,8 -10,8 +10,9 @@@
  # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  # GNU General Public License for more details.
  
- obj-$(CONFIG_ARCH_BCM_MOBILE) := board_bcm281xx.o bcm_kona_smc.o bcm_kona_smc_asm.o kona.o
+ obj-$(CONFIG_ARCH_BCM_MOBILE) := board_bcm281xx.o board_bcm21664.o \
+                               bcm_kona_smc.o bcm_kona_smc_asm.o kona.o
 +obj-$(CONFIG_ARCH_BCM2835)    += board_bcm2835.o
  
  plus_sec := $(call as-instr,.arch_extension sec,+sec)
  AFLAGS_bcm_kona_smc_asm.o     :=-Wa,-march=armv7-a$(plus_sec)
index 626d2b82d0f317317fd1a22d7f617dcd1dd5a67e,3b98e348d8d5db02e4e0d1cdfa5adb2505f64e23..db18ef866593882ccda3216f90be35827a4a8f23
@@@ -214,14 -209,12 +209,7 @@@ config DA850_WL12X
          Say Y if you want to use a wl1271 expansion card connected to the
          AM18x EVM.
  
 -config GPIO_PCA953X
 -      default MACH_DAVINCI_DA850_EVM
 -
 -config KEYBOARD_GPIO_POLLED
 -      default MACH_DAVINCI_DA850_EVM
  
- config MACH_TNETV107X
-       bool "TI TNETV107X Reference Platform"
-       default ARCH_DAVINCI_TNETV107X
-       depends on ARCH_DAVINCI_TNETV107X
-       help
-         Say Y here to select the TI TNETV107X Evaluation Module.
  config MACH_MITYOMAPL138
        bool "Critical Link MityDSP-L138/MityARM-1808 SoM"
        depends on ARCH_DAVINCI_DA850
index 0000000000000000000000000000000000000000,16f0d249f6a7aa0ef4a7e989f823858961519320..9392a8f4ef24bcbb31ad58a14623b23c6511afc1
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,552 +1,551 @@@
 -      struct irq_desc *iomuxc_irq_desc;
+ /*
+  * Copyright 2011-2014 Freescale Semiconductor, Inc.
+  * Copyright 2011 Linaro Ltd.
+  *
+  * The code contained herein is licensed under the GNU General Public
+  * License. You may obtain a copy of the GNU General Public License
+  * Version 2 or later at the following locations:
+  *
+  * http://www.opensource.org/licenses/gpl-license.html
+  * http://www.gnu.org/copyleft/gpl.html
+  */
+ #include <linux/delay.h>
+ #include <linux/init.h>
+ #include <linux/io.h>
+ #include <linux/irq.h>
+ #include <linux/genalloc.h>
+ #include <linux/mfd/syscon.h>
+ #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
+ #include <linux/of.h>
+ #include <linux/of_address.h>
+ #include <linux/of_platform.h>
+ #include <linux/regmap.h>
+ #include <linux/suspend.h>
+ #include <asm/cacheflush.h>
+ #include <asm/fncpy.h>
+ #include <asm/proc-fns.h>
+ #include <asm/suspend.h>
+ #include <asm/tlb.h>
+ #include "common.h"
+ #include "hardware.h"
+ #define CCR                           0x0
+ #define BM_CCR_WB_COUNT                       (0x7 << 16)
+ #define BM_CCR_RBC_BYPASS_COUNT               (0x3f << 21)
+ #define BM_CCR_RBC_EN                 (0x1 << 27)
+ #define CLPCR                         0x54
+ #define BP_CLPCR_LPM                  0
+ #define BM_CLPCR_LPM                  (0x3 << 0)
+ #define BM_CLPCR_BYPASS_PMIC_READY    (0x1 << 2)
+ #define BM_CLPCR_ARM_CLK_DIS_ON_LPM   (0x1 << 5)
+ #define BM_CLPCR_SBYOS                        (0x1 << 6)
+ #define BM_CLPCR_DIS_REF_OSC          (0x1 << 7)
+ #define BM_CLPCR_VSTBY                        (0x1 << 8)
+ #define BP_CLPCR_STBY_COUNT           9
+ #define BM_CLPCR_STBY_COUNT           (0x3 << 9)
+ #define BM_CLPCR_COSC_PWRDOWN         (0x1 << 11)
+ #define BM_CLPCR_WB_PER_AT_LPM                (0x1 << 16)
+ #define BM_CLPCR_WB_CORE_AT_LPM               (0x1 << 17)
+ #define BM_CLPCR_BYP_MMDC_CH0_LPM_HS  (0x1 << 19)
+ #define BM_CLPCR_BYP_MMDC_CH1_LPM_HS  (0x1 << 21)
+ #define BM_CLPCR_MASK_CORE0_WFI               (0x1 << 22)
+ #define BM_CLPCR_MASK_CORE1_WFI               (0x1 << 23)
+ #define BM_CLPCR_MASK_CORE2_WFI               (0x1 << 24)
+ #define BM_CLPCR_MASK_CORE3_WFI               (0x1 << 25)
+ #define BM_CLPCR_MASK_SCU_IDLE                (0x1 << 26)
+ #define BM_CLPCR_MASK_L2CC_IDLE               (0x1 << 27)
+ #define CGPR                          0x64
+ #define BM_CGPR_INT_MEM_CLK_LPM               (0x1 << 17)
+ #define MX6Q_SUSPEND_OCRAM_SIZE               0x1000
+ #define MX6_MAX_MMDC_IO_NUM           33
+ static void __iomem *ccm_base;
+ static void __iomem *suspend_ocram_base;
+ static void (*imx6_suspend_in_ocram_fn)(void __iomem *ocram_vbase);
+ /*
+  * suspend ocram space layout:
+  * ======================== high address ======================
+  *                              .
+  *                              .
+  *                              .
+  *                              ^
+  *                              ^
+  *                              ^
+  *                      imx6_suspend code
+  *              PM_INFO structure(imx6_cpu_pm_info)
+  * ======================== low address =======================
+  */
+ struct imx6_pm_base {
+       phys_addr_t pbase;
+       void __iomem *vbase;
+ };
+ struct imx6_pm_socdata {
+       u32 cpu_type;
+       const char *mmdc_compat;
+       const char *src_compat;
+       const char *iomuxc_compat;
+       const char *gpc_compat;
+       const u32 mmdc_io_num;
+       const u32 *mmdc_io_offset;
+ };
+ static const u32 imx6q_mmdc_io_offset[] __initconst = {
+       0x5ac, 0x5b4, 0x528, 0x520, /* DQM0 ~ DQM3 */
+       0x514, 0x510, 0x5bc, 0x5c4, /* DQM4 ~ DQM7 */
+       0x56c, 0x578, 0x588, 0x594, /* CAS, RAS, SDCLK_0, SDCLK_1 */
+       0x5a8, 0x5b0, 0x524, 0x51c, /* SDQS0 ~ SDQS3 */
+       0x518, 0x50c, 0x5b8, 0x5c0, /* SDQS4 ~ SDQS7 */
+       0x784, 0x788, 0x794, 0x79c, /* GPR_B0DS ~ GPR_B3DS */
+       0x7a0, 0x7a4, 0x7a8, 0x748, /* GPR_B4DS ~ GPR_B7DS */
+       0x59c, 0x5a0, 0x750, 0x774, /* SODT0, SODT1, MODE_CTL, MODE */
+       0x74c,                      /* GPR_ADDS */
+ };
+ static const u32 imx6dl_mmdc_io_offset[] __initconst = {
+       0x470, 0x474, 0x478, 0x47c, /* DQM0 ~ DQM3 */
+       0x480, 0x484, 0x488, 0x48c, /* DQM4 ~ DQM7 */
+       0x464, 0x490, 0x4ac, 0x4b0, /* CAS, RAS, SDCLK_0, SDCLK_1 */
+       0x4bc, 0x4c0, 0x4c4, 0x4c8, /* DRAM_SDQS0 ~ DRAM_SDQS3 */
+       0x4cc, 0x4d0, 0x4d4, 0x4d8, /* DRAM_SDQS4 ~ DRAM_SDQS7 */
+       0x764, 0x770, 0x778, 0x77c, /* GPR_B0DS ~ GPR_B3DS */
+       0x780, 0x784, 0x78c, 0x748, /* GPR_B4DS ~ GPR_B7DS */
+       0x4b4, 0x4b8, 0x750, 0x760, /* SODT0, SODT1, MODE_CTL, MODE */
+       0x74c,                      /* GPR_ADDS */
+ };
+ static const u32 imx6sl_mmdc_io_offset[] __initconst = {
+       0x30c, 0x310, 0x314, 0x318, /* DQM0 ~ DQM3 */
+       0x5c4, 0x5cc, 0x5d4, 0x5d8, /* GPR_B0DS ~ GPR_B3DS */
+       0x300, 0x31c, 0x338, 0x5ac, /* CAS, RAS, SDCLK_0, GPR_ADDS */
+       0x33c, 0x340, 0x5b0, 0x5c0, /* SODT0, SODT1, MODE_CTL, MODE */
+       0x330, 0x334, 0x320,        /* SDCKE0, SDCKE1, RESET */
+ };
+ static const struct imx6_pm_socdata imx6q_pm_data __initconst = {
+       .cpu_type = MXC_CPU_IMX6Q,
+       .mmdc_compat = "fsl,imx6q-mmdc",
+       .src_compat = "fsl,imx6q-src",
+       .iomuxc_compat = "fsl,imx6q-iomuxc",
+       .gpc_compat = "fsl,imx6q-gpc",
+       .mmdc_io_num = ARRAY_SIZE(imx6q_mmdc_io_offset),
+       .mmdc_io_offset = imx6q_mmdc_io_offset,
+ };
+ static const struct imx6_pm_socdata imx6dl_pm_data __initconst = {
+       .cpu_type = MXC_CPU_IMX6DL,
+       .mmdc_compat = "fsl,imx6q-mmdc",
+       .src_compat = "fsl,imx6q-src",
+       .iomuxc_compat = "fsl,imx6dl-iomuxc",
+       .gpc_compat = "fsl,imx6q-gpc",
+       .mmdc_io_num = ARRAY_SIZE(imx6dl_mmdc_io_offset),
+       .mmdc_io_offset = imx6dl_mmdc_io_offset,
+ };
+ static const struct imx6_pm_socdata imx6sl_pm_data __initconst = {
+       .cpu_type = MXC_CPU_IMX6SL,
+       .mmdc_compat = "fsl,imx6sl-mmdc",
+       .src_compat = "fsl,imx6sl-src",
+       .iomuxc_compat = "fsl,imx6sl-iomuxc",
+       .gpc_compat = "fsl,imx6sl-gpc",
+       .mmdc_io_num = ARRAY_SIZE(imx6sl_mmdc_io_offset),
+       .mmdc_io_offset = imx6sl_mmdc_io_offset,
+ };
+ /*
+  * This structure is for passing necessary data for low level ocram
+  * suspend code(arch/arm/mach-imx/suspend-imx6.S), if this struct
+  * definition is changed, the offset definition in
+  * arch/arm/mach-imx/suspend-imx6.S must be also changed accordingly,
+  * otherwise, the suspend to ocram function will be broken!
+  */
+ struct imx6_cpu_pm_info {
+       phys_addr_t pbase; /* The physical address of pm_info. */
+       phys_addr_t resume_addr; /* The physical resume address for asm code */
+       u32 cpu_type;
+       u32 pm_info_size; /* Size of pm_info. */
+       struct imx6_pm_base mmdc_base;
+       struct imx6_pm_base src_base;
+       struct imx6_pm_base iomuxc_base;
+       struct imx6_pm_base ccm_base;
+       struct imx6_pm_base gpc_base;
+       struct imx6_pm_base l2_base;
+       u32 mmdc_io_num; /* Number of MMDC IOs which need saved/restored. */
+       u32 mmdc_io_val[MX6_MAX_MMDC_IO_NUM][2]; /* To save offset and value */
+ } __aligned(8);
+ void imx6q_set_int_mem_clk_lpm(void)
+ {
+       u32 val = readl_relaxed(ccm_base + CGPR);
+       val |= BM_CGPR_INT_MEM_CLK_LPM;
+       writel_relaxed(val, ccm_base + CGPR);
+ }
+ static void imx6q_enable_rbc(bool enable)
+ {
+       u32 val;
+       /*
+        * need to mask all interrupts in GPC before
+        * operating RBC configurations
+        */
+       imx_gpc_mask_all();
+       /* configure RBC enable bit */
+       val = readl_relaxed(ccm_base + CCR);
+       val &= ~BM_CCR_RBC_EN;
+       val |= enable ? BM_CCR_RBC_EN : 0;
+       writel_relaxed(val, ccm_base + CCR);
+       /* configure RBC count */
+       val = readl_relaxed(ccm_base + CCR);
+       val &= ~BM_CCR_RBC_BYPASS_COUNT;
+       val |= enable ? BM_CCR_RBC_BYPASS_COUNT : 0;
+       writel(val, ccm_base + CCR);
+       /*
+        * need to delay at least 2 cycles of CKIL(32K)
+        * due to hardware design requirement, which is
+        * ~61us, here we use 65us for safe
+        */
+       udelay(65);
+       /* restore GPC interrupt mask settings */
+       imx_gpc_restore_all();
+ }
+ static void imx6q_enable_wb(bool enable)
+ {
+       u32 val;
+       /* configure well bias enable bit */
+       val = readl_relaxed(ccm_base + CLPCR);
+       val &= ~BM_CLPCR_WB_PER_AT_LPM;
+       val |= enable ? BM_CLPCR_WB_PER_AT_LPM : 0;
+       writel_relaxed(val, ccm_base + CLPCR);
+       /* configure well bias count */
+       val = readl_relaxed(ccm_base + CCR);
+       val &= ~BM_CCR_WB_COUNT;
+       val |= enable ? BM_CCR_WB_COUNT : 0;
+       writel_relaxed(val, ccm_base + CCR);
+ }
+ int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode)
+ {
 -      iomuxc_irq_desc = irq_to_desc(32);
 -      imx_gpc_irq_unmask(&iomuxc_irq_desc->irq_data);
++      struct irq_data *iomuxc_irq_data = irq_get_irq_data(32);
+       u32 val = readl_relaxed(ccm_base + CLPCR);
+       val &= ~BM_CLPCR_LPM;
+       switch (mode) {
+       case WAIT_CLOCKED:
+               break;
+       case WAIT_UNCLOCKED:
+               val |= 0x1 << BP_CLPCR_LPM;
+               val |= BM_CLPCR_ARM_CLK_DIS_ON_LPM;
+               break;
+       case STOP_POWER_ON:
+               val |= 0x2 << BP_CLPCR_LPM;
+               break;
+       case WAIT_UNCLOCKED_POWER_OFF:
+               val |= 0x1 << BP_CLPCR_LPM;
+               val &= ~BM_CLPCR_VSTBY;
+               val &= ~BM_CLPCR_SBYOS;
+               break;
+       case STOP_POWER_OFF:
+               val |= 0x2 << BP_CLPCR_LPM;
+               val |= 0x3 << BP_CLPCR_STBY_COUNT;
+               val |= BM_CLPCR_VSTBY;
+               val |= BM_CLPCR_SBYOS;
+               if (cpu_is_imx6sl()) {
+                       val |= BM_CLPCR_BYPASS_PMIC_READY;
+                       val |= BM_CLPCR_BYP_MMDC_CH0_LPM_HS;
+               } else {
+                       val |= BM_CLPCR_BYP_MMDC_CH1_LPM_HS;
+               }
+               break;
+       default:
+               return -EINVAL;
+       }
+       /*
+        * ERR007265: CCM: When improper low-power sequence is used,
+        * the SoC enters low power mode before the ARM core executes WFI.
+        *
+        * Software workaround:
+        * 1) Software should trigger IRQ #32 (IOMUX) to be always pending
+        *    by setting IOMUX_GPR1_GINT.
+        * 2) Software should then unmask IRQ #32 in GPC before setting CCM
+        *    Low-Power mode.
+        * 3) Software should mask IRQ #32 right after CCM Low-Power mode
+        *    is set (set bits 0-1 of CCM_CLPCR).
+        */
 -      imx_gpc_irq_mask(&iomuxc_irq_desc->irq_data);
++      imx_gpc_irq_unmask(iomuxc_irq_data);
+       writel_relaxed(val, ccm_base + CLPCR);
++      imx_gpc_irq_mask(iomuxc_irq_data);
+       return 0;
+ }
+ static int imx6q_suspend_finish(unsigned long val)
+ {
+       if (!imx6_suspend_in_ocram_fn) {
+               cpu_do_idle();
+       } else {
+               /*
+                * call low level suspend function in ocram,
+                * as we need to float DDR IO.
+                */
+               local_flush_tlb_all();
+               imx6_suspend_in_ocram_fn(suspend_ocram_base);
+       }
+       return 0;
+ }
+ static int imx6q_pm_enter(suspend_state_t state)
+ {
+       switch (state) {
+       case PM_SUSPEND_MEM:
+               imx6q_set_lpm(STOP_POWER_OFF);
+               imx6q_enable_wb(true);
+               /*
+                * For suspend into ocram, asm code already take care of
+                * RBC setting, so we do NOT need to do that here.
+                */
+               if (!imx6_suspend_in_ocram_fn)
+                       imx6q_enable_rbc(true);
+               imx_gpc_pre_suspend();
+               imx_anatop_pre_suspend();
+               imx_set_cpu_jump(0, v7_cpu_resume);
+               /* Zzz ... */
+               cpu_suspend(0, imx6q_suspend_finish);
+               if (cpu_is_imx6q() || cpu_is_imx6dl())
+                       imx_smp_prepare();
+               imx_anatop_post_resume();
+               imx_gpc_post_resume();
+               imx6q_enable_rbc(false);
+               imx6q_enable_wb(false);
+               imx6q_set_lpm(WAIT_CLOCKED);
+               break;
+       default:
+               return -EINVAL;
+       }
+       return 0;
+ }
+ static const struct platform_suspend_ops imx6q_pm_ops = {
+       .enter = imx6q_pm_enter,
+       .valid = suspend_valid_only_mem,
+ };
+ void __init imx6q_pm_set_ccm_base(void __iomem *base)
+ {
+       ccm_base = base;
+ }
+ static int __init imx6_pm_get_base(struct imx6_pm_base *base,
+                               const char *compat)
+ {
+       struct device_node *node;
+       struct resource res;
+       int ret = 0;
+       node = of_find_compatible_node(NULL, NULL, compat);
+       if (!node) {
+               ret = -ENODEV;
+               goto out;
+       }
+       ret = of_address_to_resource(node, 0, &res);
+       if (ret)
+               goto put_node;
+       base->pbase = res.start;
+       base->vbase = ioremap(res.start, resource_size(&res));
+       if (!base->vbase)
+               ret = -ENOMEM;
+ put_node:
+       of_node_put(node);
+ out:
+       return ret;
+ }
+ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata)
+ {
+       phys_addr_t ocram_pbase;
+       struct device_node *node;
+       struct platform_device *pdev;
+       struct imx6_cpu_pm_info *pm_info;
+       struct gen_pool *ocram_pool;
+       unsigned long ocram_base;
+       int i, ret = 0;
+       const u32 *mmdc_offset_array;
+       suspend_set_ops(&imx6q_pm_ops);
+       if (!socdata) {
+               pr_warn("%s: invalid argument!\n", __func__);
+               return -EINVAL;
+       }
+       node = of_find_compatible_node(NULL, NULL, "mmio-sram");
+       if (!node) {
+               pr_warn("%s: failed to find ocram node!\n", __func__);
+               return -ENODEV;
+       }
+       pdev = of_find_device_by_node(node);
+       if (!pdev) {
+               pr_warn("%s: failed to find ocram device!\n", __func__);
+               ret = -ENODEV;
+               goto put_node;
+       }
+       ocram_pool = dev_get_gen_pool(&pdev->dev);
+       if (!ocram_pool) {
+               pr_warn("%s: ocram pool unavailable!\n", __func__);
+               ret = -ENODEV;
+               goto put_node;
+       }
+       ocram_base = gen_pool_alloc(ocram_pool, MX6Q_SUSPEND_OCRAM_SIZE);
+       if (!ocram_base) {
+               pr_warn("%s: unable to alloc ocram!\n", __func__);
+               ret = -ENOMEM;
+               goto put_node;
+       }
+       ocram_pbase = gen_pool_virt_to_phys(ocram_pool, ocram_base);
+       suspend_ocram_base = __arm_ioremap_exec(ocram_pbase,
+               MX6Q_SUSPEND_OCRAM_SIZE, false);
+       pm_info = suspend_ocram_base;
+       pm_info->pbase = ocram_pbase;
+       pm_info->resume_addr = virt_to_phys(v7_cpu_resume);
+       pm_info->pm_info_size = sizeof(*pm_info);
+       /*
+        * ccm physical address is not used by asm code currently,
+        * so get ccm virtual address directly, as we already have
+        * it from ccm driver.
+        */
+       pm_info->ccm_base.vbase = ccm_base;
+       ret = imx6_pm_get_base(&pm_info->mmdc_base, socdata->mmdc_compat);
+       if (ret) {
+               pr_warn("%s: failed to get mmdc base %d!\n", __func__, ret);
+               goto put_node;
+       }
+       ret = imx6_pm_get_base(&pm_info->src_base, socdata->src_compat);
+       if (ret) {
+               pr_warn("%s: failed to get src base %d!\n", __func__, ret);
+               goto src_map_failed;
+       }
+       ret = imx6_pm_get_base(&pm_info->iomuxc_base, socdata->iomuxc_compat);
+       if (ret) {
+               pr_warn("%s: failed to get iomuxc base %d!\n", __func__, ret);
+               goto iomuxc_map_failed;
+       }
+       ret = imx6_pm_get_base(&pm_info->gpc_base, socdata->gpc_compat);
+       if (ret) {
+               pr_warn("%s: failed to get gpc base %d!\n", __func__, ret);
+               goto gpc_map_failed;
+       }
+       ret = imx6_pm_get_base(&pm_info->l2_base, "arm,pl310-cache");
+       if (ret) {
+               pr_warn("%s: failed to get pl310-cache base %d!\n",
+                       __func__, ret);
+               goto pl310_cache_map_failed;
+       }
+       pm_info->cpu_type = socdata->cpu_type;
+       pm_info->mmdc_io_num = socdata->mmdc_io_num;
+       mmdc_offset_array = socdata->mmdc_io_offset;
+       for (i = 0; i < pm_info->mmdc_io_num; i++) {
+               pm_info->mmdc_io_val[i][0] =
+                       mmdc_offset_array[i];
+               pm_info->mmdc_io_val[i][1] =
+                       readl_relaxed(pm_info->iomuxc_base.vbase +
+                       mmdc_offset_array[i]);
+       }
+       imx6_suspend_in_ocram_fn = fncpy(
+               suspend_ocram_base + sizeof(*pm_info),
+               &imx6_suspend,
+               MX6Q_SUSPEND_OCRAM_SIZE - sizeof(*pm_info));
+       goto put_node;
+ pl310_cache_map_failed:
+       iounmap(&pm_info->gpc_base.vbase);
+ gpc_map_failed:
+       iounmap(&pm_info->iomuxc_base.vbase);
+ iomuxc_map_failed:
+       iounmap(&pm_info->src_base.vbase);
+ src_map_failed:
+       iounmap(&pm_info->mmdc_base.vbase);
+ put_node:
+       of_node_put(node);
+       return ret;
+ }
+ static void __init imx6_pm_common_init(const struct imx6_pm_socdata
+                                       *socdata)
+ {
+       struct regmap *gpr;
+       int ret;
+       WARN_ON(!ccm_base);
+       if (IS_ENABLED(CONFIG_SUSPEND)) {
+               ret = imx6q_suspend_init(socdata);
+               if (ret)
+                       pr_warn("%s: No DDR LPM support with suspend %d!\n",
+                               __func__, ret);
+       }
+       /*
+        * This is for SW workaround step #1 of ERR007265, see comments
+        * in imx6q_set_lpm for details of this errata.
+        * Force IOMUXC irq pending, so that the interrupt to GPC can be
+        * used to deassert dsm_request signal when the signal gets
+        * asserted unexpectedly.
+        */
+       gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr");
+       if (!IS_ERR(gpr))
+               regmap_update_bits(gpr, IOMUXC_GPR1, IMX6Q_GPR1_GINT,
+                                  IMX6Q_GPR1_GINT);
+ }
+ void __init imx6q_pm_init(void)
+ {
+       imx6_pm_common_init(&imx6q_pm_data);
+ }
+ void __init imx6dl_pm_init(void)
+ {
+       imx6_pm_common_init(&imx6dl_pm_data);
+ }
+ void __init imx6sl_pm_init(void)
+ {
+       imx6_pm_common_init(&imx6sl_pm_data);
+ }
Simple merge
index 0000000000000000000000000000000000000000,746134ecdfc2a8e9d6cd812682761dbc7fb8e57a..333fca8fdc41c2cf667a849b7461bd8fb2c9baac
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,139 +1,140 @@@
+ /*
+  * Device Tree support for Armada 370 and XP platforms.
+  *
+  * Copyright (C) 2012 Marvell
+  *
+  * Lior Amsalem <alior@marvell.com>
+  * Gregory CLEMENT <gregory.clement@free-electrons.com>
+  * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+  *
+  * This file is licensed under the terms of the GNU General Public
+  * License version 2.  This program is licensed "as is" without any
+  * warranty of any kind, whether express or implied.
+  */
+ #include <linux/kernel.h>
+ #include <linux/init.h>
+ #include <linux/clk-provider.h>
+ #include <linux/of_address.h>
+ #include <linux/of_platform.h>
+ #include <linux/io.h>
+ #include <linux/clocksource.h>
+ #include <linux/dma-mapping.h>
+ #include <linux/mbus.h>
++#include <linux/signal.h>
+ #include <linux/slab.h>
+ #include <asm/hardware/cache-l2x0.h>
+ #include <asm/mach/arch.h>
+ #include <asm/mach/map.h>
+ #include <asm/mach/time.h>
+ #include "armada-370-xp.h"
+ #include "common.h"
+ #include "coherency.h"
+ #include "mvebu-soc-id.h"
+ /*
+  * Early versions of Armada 375 SoC have a bug where the BootROM
+  * leaves an external data abort pending. The kernel is hit by this
+  * data abort as soon as it enters userspace, because it unmasks the
+  * data aborts at this moment. We register a custom abort handler
+  * below to ignore the first data abort to work around this
+  * problem.
+  */
+ static int armada_375_external_abort_wa(unsigned long addr, unsigned int fsr,
+                                       struct pt_regs *regs)
+ {
+       static int ignore_first;
+       if (!ignore_first && fsr == 0x1406) {
+               ignore_first = 1;
+               return 0;
+       }
+       return 1;
+ }
+ static void __init mvebu_timer_and_clk_init(void)
+ {
+       of_clk_init(NULL);
+       clocksource_of_init();
+       coherency_init();
+       BUG_ON(mvebu_mbus_dt_init());
+ #ifdef CONFIG_CACHE_L2X0
+       l2x0_of_init(0, ~0UL);
+ #endif
+       if (of_machine_is_compatible("marvell,armada375"))
+               hook_fault_code(16 + 6, armada_375_external_abort_wa, SIGBUS, 0,
+                               "imprecise external abort");
+ }
+ static void __init i2c_quirk(void)
+ {
+       struct device_node *np;
+       u32 dev, rev;
+       /*
+        * Only revisons more recent than A0 support the offload
+        * mechanism. We can exit only if we are sure that we can
+        * get the SoC revision and it is more recent than A0.
+        */
+       if (mvebu_get_soc_id(&rev, &dev) == 0 && dev > MV78XX0_A0_REV)
+               return;
+       for_each_compatible_node(np, NULL, "marvell,mv78230-i2c") {
+               struct property *new_compat;
+               new_compat = kzalloc(sizeof(*new_compat), GFP_KERNEL);
+               new_compat->name = kstrdup("compatible", GFP_KERNEL);
+               new_compat->length = sizeof("marvell,mv78230-a0-i2c");
+               new_compat->value = kstrdup("marvell,mv78230-a0-i2c",
+                                               GFP_KERNEL);
+               of_update_property(np, new_compat);
+       }
+       return;
+ }
+ static void __init mvebu_dt_init(void)
+ {
+       if (of_machine_is_compatible("plathome,openblocks-ax3-4"))
+               i2c_quirk();
+       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+ }
+ static const char * const armada_370_xp_dt_compat[] = {
+       "marvell,armada-370-xp",
+       NULL,
+ };
+ DT_MACHINE_START(ARMADA_370_XP_DT, "Marvell Armada 370/XP (Device Tree)")
+       .smp            = smp_ops(armada_xp_smp_ops),
+       .init_machine   = mvebu_dt_init,
+       .init_time      = mvebu_timer_and_clk_init,
+       .restart        = mvebu_restart,
+       .dt_compat      = armada_370_xp_dt_compat,
+ MACHINE_END
+ static const char * const armada_375_dt_compat[] = {
+       "marvell,armada375",
+       NULL,
+ };
+ DT_MACHINE_START(ARMADA_375_DT, "Marvell Armada 375 (Device Tree)")
+       .init_time      = mvebu_timer_and_clk_init,
+       .restart        = mvebu_restart,
+       .dt_compat      = armada_375_dt_compat,
+ MACHINE_END
+ static const char * const armada_38x_dt_compat[] = {
+       "marvell,armada380",
+       "marvell,armada385",
+       NULL,
+ };
+ DT_MACHINE_START(ARMADA_38X_DT, "Marvell Armada 380/385 (Device Tree)")
+       .init_time      = mvebu_timer_and_clk_init,
+       .restart        = mvebu_restart,
+       .dt_compat      = armada_38x_dt_compat,
+ MACHINE_END
Simple merge
Simple merge
Simple merge
index efd53848947da4ee8a15b9b3b1f4648038f19e71,c54db0046ce37feb85d968506f8ed193b95ebbd1..c0b650b1c846ab4ea94f54449e91546221e95121
@@@ -128,7 -119,7 +129,8 @@@ config ARCH_R8A779
        select MIGHT_HAVE_PCI
        select SH_CLK_CPG
        select RENESAS_IRQC
 +      select SYS_SUPPORTS_SH_CMT
+       select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE
  
  config ARCH_R8A7791
        bool "R-Car M2 (R8A77910)"
        select MIGHT_HAVE_PCI
        select SH_CLK_CPG
        select RENESAS_IRQC
 +      select SYS_SUPPORTS_SH_CMT
+       select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE
  
  config ARCH_EMEV2
        bool "Emma Mobile EV2"
Simple merge
Simple merge
index 1c0c151d108c2fe40d3cf8c4bda1d0b4c4d9112c,ac61b927952c61737650c2cc9774977e98b31f52..6cee9efa26e74db0a9444e4a18a78acaaa36253c
@@@ -10,9 -10,9 +10,10 @@@ obj-$(CONFIG_DW_APB_ICTL)            += irq-dw-ap
  obj-$(CONFIG_METAG)                   += irq-metag-ext.o
  obj-$(CONFIG_METAG_PERFCOUNTER_IRQS)  += irq-metag.o
  obj-$(CONFIG_ARCH_MOXART)             += irq-moxart.o
+ obj-$(CONFIG_CLPS711X_IRQCHIP)                += irq-clps711x.o
  obj-$(CONFIG_ORION_IRQCHIP)           += irq-orion.o
  obj-$(CONFIG_ARCH_SUNXI)              += irq-sun4i.o
 +obj-$(CONFIG_ARCH_SUNXI)              += irq-sunxi-nmi.o
  obj-$(CONFIG_ARCH_SPEAR3XX)           += spear-shirq.o
  obj-$(CONFIG_ARM_GIC)                 += irq-gic.o
  obj-$(CONFIG_ARM_NVIC)                        += irq-nvic.o
index f10f64fcc8159554a9f270ace2b661207c3e339d,bd02ca7a1d5563ccc6039257fca909b2a89ebd5a..146e4fffd710cadeee498228c0a1ff1c498c32e2
  #define CLK_OF_TABLES()
  #endif
  
 +#ifdef CONFIG_OF_RESERVED_MEM
 +#define RESERVEDMEM_OF_TABLES()                               \
 +      . = ALIGN(8);                                   \
 +      VMLINUX_SYMBOL(__reservedmem_of_table) = .;     \
 +      *(__reservedmem_of_table)                       \
 +      *(__reservedmem_of_table_end)
 +#else
 +#define RESERVEDMEM_OF_TABLES()
 +#endif
 +
+ #ifdef CONFIG_SMP
+ #define CPU_METHOD_OF_TABLES() . = ALIGN(8);                              \
+                          VMLINUX_SYMBOL(__cpu_method_of_table_begin) = .; \
+                          *(__cpu_method_of_table)                         \
+                          VMLINUX_SYMBOL(__cpu_method_of_table_end) = .;
+ #else
+ #define CPU_METHOD_OF_TABLES()
+ #endif
  #define KERNEL_DTB()                                                  \
        STRUCT_ALIGN();                                                 \
        VMLINUX_SYMBOL(__dtb_start) = .;                                \
        TRACE_SYSCALLS()                                                \
        MEM_DISCARD(init.rodata)                                        \
        CLK_OF_TABLES()                                                 \
 +      RESERVEDMEM_OF_TABLES()                                         \
        CLKSRC_OF_TABLES()                                              \
+       CPU_METHOD_OF_TABLES()                                          \
        KERNEL_DTB()                                                    \
        IRQCHIP_OF_MATCH_TABLE()