1. 17 8月, 2017 1 次提交
  2. 08 3月, 2017 1 次提交
    • L
      soc: imx: move PGC handling to a new GPC driver · 721cabf6
      Lucas Stach 提交于
      This is an almost complete re-write of the previous GPC power gating control
      code found in the IMX architecture code. It supports both the old and the new
      DT binding, allowing more domains to be added later and generally makes the
      driver easier to extend, while keeping compatibility with existing DTBs.
      
      As the result, all functionality regarding the power gating controller
      gets removed from the IMX architecture GPC driver.  It keeps only the
      IRQ controller code in the architecture, as this is closely coupled to
      the CPU idle implementation.
      Signed-off-by: NLucas Stach <l.stach@pengutronix.de>
      Signed-off-by: NShawn Guo <shawnguo@kernel.org>
      721cabf6
  3. 24 10月, 2016 2 次提交
    • F
      ARM: imx: gpc: Fix the imx_gpc_genpd_init() error path · f9d1f7a7
      Fabio Estevam 提交于
      If of_genpd_add_provider_onecell() fails the following kernel crash is
      observed on a kernel built with multi_v7_defconfig:
      
      [    1.739301] [00000040] *pgd=00000000
      [    1.739310] Internal error: Oops: 5 [#1] SMP ARM
      [    1.739319] Modules linked in:
      [    1.739328] CPU: 1 PID: 95 Comm: kworker/1:4 Not tainted 4.8.0-11897-g6b5e09a7 #1
      [    1.739331] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
      [    1.739352] Workqueue: pm genpd_power_off_work_fn
      [    1.739356] task: ee63d400 task.stack: ee70a000
      [    1.739365] PC is at mutex_lock+0xc/0x4c
      [    1.739374] LR is at regulator_disable+0x2c/0x60
      [    1.739379] pc : [<c0bc0da0>]    lr : [<c06e4b10>]    psr: 60000013
      [    1.739379] sp : ee70beb0  ip : 10624dd3  fp : ee6e6280
      [    1.739382] r10: eefb0900  r9 : 00000000  r8 : c1309918
      [    1.739385] r7 : 00000000  r6 : 00000040  r5 : 00000000  r4 : 00000040
      [    1.739390] r3 : 0000004c  r2 : 7fffd540  r1 : 000001e4  r0 : 00000040
      
      Instead of returning of_genpd_add_provider_onecell() directly,
      we should check its return value and in the case of error we
      should unwind the previously taken actions, which in these case are:
      - Call imx6q_pm_pu_power_off()
      - Set imx6q_pu_domain.reg back to NULL
      
      Setting imx6q_pu_domain.reg to NULL in the error case is important
      as it will prevent further operations in the pu_reg regulator.
      
      This kernel crash is not observed with imx_v6_v7_defconfig because
      it selects GPU and VPU drivers, which are consumers of the GPC block
      and thus change the refcount of the pu_reg regulator.
      Signed-off-by: NFabio Estevam <fabio.estevam@nxp.com>
      Signed-off-by: NShawn Guo <shawnguo@kernel.org>
      f9d1f7a7
    • F
      ARM: imx: gpc: Initialize all power domains · eef0b282
      Fabio Estevam 提交于
      Since commit 0159ec67 ("PM / Domains: Verify the PM domain is present
      when adding a provider") the following regression is observed on imx6:
      
      imx-gpc: probe of 20dc000.gpc failed with error -22
      
      The gpc probe fails because of_genpd_add_provider_onecell() now checks
      if all the domains are initialized via pm_genpd_present() function
      and it fails because not all the power domains are initialized.
      
      In order to fix this error, initialize all the power domains from
      imx_gpc_domains[], not only the imx6q_pu_domain.base one.
      Reported-by: NOlof's autobooter <build@lixom.net>
      Signed-off-by: NFabio Estevam <fabio.estevam@nxp.com>
      Signed-off-by: NShawn Guo <shawnguo@kernel.org>
      eef0b282
  4. 22 10月, 2016 1 次提交
  5. 10 8月, 2016 1 次提交
  6. 16 2月, 2016 1 次提交
  7. 23 11月, 2015 1 次提交
  8. 23 10月, 2015 1 次提交
  9. 14 10月, 2015 2 次提交
  10. 08 7月, 2015 1 次提交
    • L
      ARM: imx6: gpc: always enable PU domain if CONFIG_PM is not set · d438462c
      Lucas Stach 提交于
      If CONFIG_PM is not set the PU power domain needs to be enabled always,
      otherwise there are two failure scenarios which will hang the system if
      one of the devices in the PU domain is accessed.
      
      1. New DTs (4.1+) drop the "always-on" property from the PU regulator, so
      if it isn't properly enabled by the GPC code it will be disabled at the
      end of boot.
      
      2. If the bootloader already disabled the PU domain the GPC explicitly
      needs to enable it again, even if the kernel doesn't do any power
      management. This is a bit hypothetical, as it requires to boot a
      mainline kernel on a downstream bootloader, as no mainline bootloader
      disables the PM domains.
      
      Cc: <stable@vger.kernel.org> # 4.1
      Signed-off-by: NLucas Stach <l.stach@pengutronix.de>
      Acked-by: NPhilipp Zabel <p.zabel@pengutronix.de>
      Signed-off-by: NShawn Guo <shawn.guo@linaro.org>
      d438462c
  11. 03 6月, 2015 1 次提交
  12. 27 5月, 2015 2 次提交
    • L
      ARM: imx6: gpc: don't register power domain if DT data is missing · b17c70cd
      Lucas Stach 提交于
      If the devicetree is too old and does not provide the regulator and clocks
      for the power domain, we need to avoid registering the power domain.
      Otherwise runtime PM will try to control the domain, which will lead to
      machine hangs without the proper DT configuration data.
      
      This restores functionality to the kernel 4.0 level if an old DT is
      detected, where the power domain is constantly powered on.
      Signed-off-by: NLucas Stach <l.stach@pengutronix.de>
      Signed-off-by: NShawn Guo <shawn.guo@linaro.org>
      b17c70cd
    • L
      ARM: imx6: allow booting with old DT · 634a6037
      Lucas Stach 提交于
      The GPC rewrite to IRQ domains has been on the premise that it may break
      suspend/resume for new kernels on old DT, but otherwise keep things working
      from a user perspective. This was an accepted compromise to be able to move
      the GIC cleanup forward.
      
      What actually happened was that booting a new kernel on an old DT crashes
      before even the console is up, so the user does not even see the warning
      that the DT is too old. The warning message suggests that this has been
      known before, which is clearly unacceptable.
      
      Fix the early crash by mapping the GPC memory space if the IRQ controller
      doesn't claim it. This keeps at least CPUidle and the needed CPU wakeup
      workarounds working. With this fixed the system is able to boot up
      properly minus the expected suspend/resume breakage.
      Signed-off-by: NLucas Stach <l.stach@pengutronix.de>
      Signed-off-by: NShawn Guo <shawn.guo@linaro.org>
      634a6037
  13. 11 5月, 2015 1 次提交
  14. 30 3月, 2015 3 次提交
  15. 11 3月, 2015 1 次提交
    • P
      ARM: imx6: gpc: Add PU power domain for GPU/VPU · 00eb60a8
      Philipp Zabel 提交于
      When generic pm domain support is enabled, the PGC can be used
      to completely gate power to the PU power domain containing GPU3D,
      GPU2D, and VPU cores.
      This code triggers the PGC powerdown sequence to disable the GPU/VPU
      isolation cells and gate power and then disables the PU regulator.
      To reenable, the reverse powerup sequence is triggered after the PU
      regulator is enabled again.
      The GPU and VPU devices in the PU power domain temporarily need
      to be clocked during powerup, so that the reset machinery can work.
      
      [Avoid explicit regulator enabling in probe, unless !PM]
      Signed-off-by: NMarkus Pargmann <mpa@pengutronix.de>
      Signed-off-by: NPhilipp Zabel <p.zabel@pengutronix.de>
      Signed-off-by: NShawn Guo <shawn.guo@linaro.org>
      00eb60a8
  16. 05 1月, 2015 1 次提交
  17. 05 12月, 2014 2 次提交
  18. 18 7月, 2014 1 次提交
  19. 21 10月, 2013 1 次提交
    • S
      ARM: imx: ensure dsm_request signal is not asserted when setting LPM · d48866fe
      Shawn Guo 提交于
      There is a defect in imx6 LPM design.  When SW tries to enter low power
      mode with following sequence, the chip will enter low power mode before
      A9 CPU execute WFI instruction:
      
      1. Set CCM_CLPCR[1:0] to 2'b00;
      2. ARM CPU enters WFI;
      3. ARM CPU wakeup from an interrupt event, which is masked by GPC or not
         visible to GPC, such as interrupt from local timer;
      4. Set CCM_CLPCR[1:0] to 2'b01 or 2'b10;
      5. ARM CPU execute WFI.
      
      Before the last step, the chip will enter WAIT mode if CCM_CLPCR[1:0] is
      set to 2'b01, or enter STOP mode if CCM_CLPCR[1:0] is set to 2'b10.
      
      The patch implements a recommended workaround for this issue.
      
      1. SW triggers irq #32(IOMUX) to be always pending manually by setting
         IOMUX_GPR1_GINT bit;
      2. SW should then unmask it in GPC before setting CCM LPM;
      3. SW should mask it right after CCM LPM is set (bit0-1 of CCM_CLPCR).
      Signed-off-by: NShawn Guo <shawn.guo@linaro.org>
      d48866fe
  20. 12 4月, 2013 1 次提交
    • A
      ARM: imx: enable RBC to support anatop LPM mode · 263475d4
      Anson Huang 提交于
      RBC is to control whether some ANATOP sub modules
      can enter lpm mode when SOC is into STOP mode, if
      RBC is enabled and PMIC_VSTBY_REQ is set, ANATOP
      will have below behaviors:
      
      1. Digital LDOs(CORE, SOC and PU) are bypassed;
      2. Analog LDOs(1P1, 2P5, 3P0) are disabled;
      
      As the 2P5 is necessary for DRAM IO pre-drive in
      STOP mode, so we need to enable weak 2P5 in STOP
      mode when 2P5 LDO is disabled.
      
      For RBC settings, there are some rules as below
      due to hardware design:
      
      1. All interrupts must be masked during operating
         RBC registers;
      2. At least 2 CKIL(32K) cycles is needed after the
         RBC setting is changed.
      Signed-off-by: NAnson Huang <b20788@freescale.com>
      Signed-off-by: NShawn Guo <shawn.guo@linaro.org>
      263475d4
  21. 01 4月, 2013 1 次提交
    • F
      ARM: mach-imx: gpc: Include "common.h" · 9a67a6fd
      Fabio Estevam 提交于
      Fix the following sparse warnings:
      
      arch/arm/mach-imx/gpc.c:29:6: warning: symbol 'imx_gpc_pre_suspend' was not declared. Should it be static?
      arch/arm/mach-imx/gpc.c:43:6: warning: symbol 'imx_gpc_post_resume' was not declared. Should it be static?
      arch/arm/mach-imx/gpc.c:71:6: warning: symbol 'imx_gpc_mask_all' was not declared. Should it be static?
      arch/arm/mach-imx/gpc.c:83:6: warning: symbol 'imx_gpc_restore_all' was not declared. Should it be static?
      arch/arm/mach-imx/gpc.c:122:13: warning: symbol 'imx_gpc_init' was not declared. Should it be static?
      Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com>
      Signed-off-by: NShawn Guo <shawn.guo@linaro.org>
      9a67a6fd
  22. 30 1月, 2013 1 次提交
  23. 13 1月, 2013 1 次提交
    • R
      irqchip: Move ARM gic.h to include/linux/irqchip/arm-gic.h · 520f7bd7
      Rob Herring 提交于
      Now that we have GIC moved to drivers/irqchip and all GIC DT init for
      platforms using irqchip_init, move gic.h and update the remaining
      includes.
      Signed-off-by: NRob Herring <rob.herring@calxeda.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Anton Vorontsov <avorontsov@mvista.com>
      Cc: Kukjin Kim <kgene.kim@samsung.com>
      Cc: Sascha Hauer <kernel@pengutronix.de>
      Cc: David Brown <davidb@codeaurora.org>
      Cc: Daniel Walker <dwalker@fifo99.com>
      Cc: Bryan Huntsman <bryanh@codeaurora.org>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Magnus Damm <magnus.damm@gmail.com>
      Cc: Viresh Kumar <viresh.linux@gmail.com>
      Cc: Shiraz Hashim <shiraz.hashim@st.com>
      Cc: Stephen Warren <swarren@wwwdotorg.org>
      Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Samuel Ortiz <sameo@linux.intel.com>
      520f7bd7
  24. 31 10月, 2011 1 次提交