1. 17 8月, 2018 2 次提交
    • T
      ARM: OMAP2+: Fix module address for modules using mpu_rt_idx · 1dbcb97c
      Tony Lindgren 提交于
      If we use device tree data for a module interconnect target we want
      to map the control registers from the module start. Legacy hwmod platform
      data however is using child IP offsets for cpsw module with mpu_rt_idx.
      
      In cases where we have the interconnect target module already using device
      tree data with legacy hwmod platform data still around, the sysc register
      area is not adjusted for mpu_rt_idx causing wrong registers being accessed.
      
      Let's fix the issue for mixed dts and platform data mode by ioremapping
      the module registers using child IP offset if mpu_rt_idx is set. For
      device tree only data there's no reason to use mpu_rt_idx.
      
      Fixes: 6c72b355 ("ARM: OMAP2+: Parse module IO range from dts for legacy
      "ti,hwmods" support")
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      1dbcb97c
    • T
      ARM: OMAP2+: Fix null hwmod for ti-sysc debug · 4769c003
      Tony Lindgren 提交于
      We may call omap_hwmod_parse_module_range() with no hwmod allocated yet
      and may have debug enabled. Let's fix this by checking for hwmod before
      trying to use it's name.
      
      Fixes: 6c72b355 ("ARM: OMAP2+: Parse module IO range from dts for legacy
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      4769c003
  2. 12 7月, 2018 1 次提交
    • N
      ARM: DRA7/OMAP5: Enable ACTLR[0] (Enable invalidates of BTB) for secondary cores · 2f8b5b21
      Nishanth Menon 提交于
      Call secure services to enable ACTLR[0] (Enable invalidates of BTB with
      ICIALLU) when branch hardening is enabled for kernel.
      
      On GP devices OMAP5/DRA7, there is no possibility to update secure
      side since "secure world" is ROM and there are no override mechanisms
      possible. On HS devices, appropriate PPA should do the workarounds as
      well.
      
      However, the configuration is only done for secondary core, since it is
      expected that firmware/bootloader will have enabled the required
      configuration for the primary boot core (note: bootloaders typically
      will NOT enable secondary processors, since it has no need to do so).
      Signed-off-by: NNishanth Menon <nm@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      2f8b5b21
  3. 10 7月, 2018 3 次提交
  4. 03 7月, 2018 1 次提交
    • D
      ARM: hwmod: RTC: Don't assume lock/unlock will be called with irq enabled · 6d609b35
      Dave Gerlach 提交于
      When the RTC lock and unlock functions were introduced it was likely
      assumed that they would always be called from irq enabled context, hence
      the use of local_irq_disable/enable. This is no longer true as the
      RTC+DDR path makes a late call during the suspend path after irqs
      have been disabled to enable the RTC hwmod which calls both unlock and
      lock, leading to IRQs being reenabled through the local_irq_enable call
      in omap_hwmod_rtc_lock call.
      
      To avoid this change the local_irq_disable/enable to
      local_irq_save/restore to ensure that from whatever context this is
      called the proper IRQ configuration is maintained.
      Signed-off-by: NDave Gerlach <d-gerlach@ti.com>
      Signed-off-by: NKeerthy <j-keerthy@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      6d609b35
  5. 13 6月, 2018 1 次提交
    • K
      treewide: kzalloc() -> kcalloc() · 6396bb22
      Kees Cook 提交于
      The kzalloc() function has a 2-factor argument form, kcalloc(). This
      patch replaces cases of:
      
              kzalloc(a * b, gfp)
      
      with:
              kcalloc(a * b, gfp)
      
      as well as handling cases of:
      
              kzalloc(a * b * c, gfp)
      
      with:
      
              kzalloc(array3_size(a, b, c), gfp)
      
      as it's slightly less ugly than:
      
              kzalloc_array(array_size(a, b), c, gfp)
      
      This does, however, attempt to ignore constant size factors like:
      
              kzalloc(4 * 1024, gfp)
      
      though any constants defined via macros get caught up in the conversion.
      
      Any factors with a sizeof() of "unsigned char", "char", and "u8" were
      dropped, since they're redundant.
      
      The Coccinelle script used for this was:
      
      // Fix redundant parens around sizeof().
      @@
      type TYPE;
      expression THING, E;
      @@
      
      (
        kzalloc(
      -	(sizeof(TYPE)) * E
      +	sizeof(TYPE) * E
        , ...)
      |
        kzalloc(
      -	(sizeof(THING)) * E
      +	sizeof(THING) * E
        , ...)
      )
      
      // Drop single-byte sizes and redundant parens.
      @@
      expression COUNT;
      typedef u8;
      typedef __u8;
      @@
      
      (
        kzalloc(
      -	sizeof(u8) * (COUNT)
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(__u8) * (COUNT)
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(char) * (COUNT)
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(unsigned char) * (COUNT)
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(u8) * COUNT
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(__u8) * COUNT
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(char) * COUNT
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(unsigned char) * COUNT
      +	COUNT
        , ...)
      )
      
      // 2-factor product with sizeof(type/expression) and identifier or constant.
      @@
      type TYPE;
      expression THING;
      identifier COUNT_ID;
      constant COUNT_CONST;
      @@
      
      (
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * (COUNT_ID)
      +	COUNT_ID, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * COUNT_ID
      +	COUNT_ID, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * (COUNT_CONST)
      +	COUNT_CONST, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * COUNT_CONST
      +	COUNT_CONST, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * (COUNT_ID)
      +	COUNT_ID, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * COUNT_ID
      +	COUNT_ID, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * (COUNT_CONST)
      +	COUNT_CONST, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * COUNT_CONST
      +	COUNT_CONST, sizeof(THING)
        , ...)
      )
      
      // 2-factor product, only identifiers.
      @@
      identifier SIZE, COUNT;
      @@
      
      - kzalloc
      + kcalloc
        (
      -	SIZE * COUNT
      +	COUNT, SIZE
        , ...)
      
      // 3-factor product with 1 sizeof(type) or sizeof(expression), with
      // redundant parens removed.
      @@
      expression THING;
      identifier STRIDE, COUNT;
      type TYPE;
      @@
      
      (
        kzalloc(
      -	sizeof(TYPE) * (COUNT) * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE) * (COUNT) * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE) * COUNT * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE) * COUNT * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kzalloc(
      -	sizeof(THING) * (COUNT) * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kzalloc(
      -	sizeof(THING) * (COUNT) * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kzalloc(
      -	sizeof(THING) * COUNT * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kzalloc(
      -	sizeof(THING) * COUNT * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      )
      
      // 3-factor product with 2 sizeof(variable), with redundant parens removed.
      @@
      expression THING1, THING2;
      identifier COUNT;
      type TYPE1, TYPE2;
      @@
      
      (
        kzalloc(
      -	sizeof(TYPE1) * sizeof(TYPE2) * COUNT
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
        , ...)
      |
        kzalloc(
      -	sizeof(THING1) * sizeof(THING2) * COUNT
      +	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
        , ...)
      |
        kzalloc(
      -	sizeof(THING1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * COUNT
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
        , ...)
      )
      
      // 3-factor product, only identifiers, with redundant parens removed.
      @@
      identifier STRIDE, SIZE, COUNT;
      @@
      
      (
        kzalloc(
      -	(COUNT) * STRIDE * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	COUNT * (STRIDE) * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	COUNT * STRIDE * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	(COUNT) * (STRIDE) * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	COUNT * (STRIDE) * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	(COUNT) * STRIDE * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	(COUNT) * (STRIDE) * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	COUNT * STRIDE * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      )
      
      // Any remaining multi-factor products, first at least 3-factor products,
      // when they're not all constants...
      @@
      expression E1, E2, E3;
      constant C1, C2, C3;
      @@
      
      (
        kzalloc(C1 * C2 * C3, ...)
      |
        kzalloc(
      -	(E1) * E2 * E3
      +	array3_size(E1, E2, E3)
        , ...)
      |
        kzalloc(
      -	(E1) * (E2) * E3
      +	array3_size(E1, E2, E3)
        , ...)
      |
        kzalloc(
      -	(E1) * (E2) * (E3)
      +	array3_size(E1, E2, E3)
        , ...)
      |
        kzalloc(
      -	E1 * E2 * E3
      +	array3_size(E1, E2, E3)
        , ...)
      )
      
      // And then all remaining 2 factors products when they're not all constants,
      // keeping sizeof() as the second factor argument.
      @@
      expression THING, E1, E2;
      type TYPE;
      constant C1, C2, C3;
      @@
      
      (
        kzalloc(sizeof(THING) * C2, ...)
      |
        kzalloc(sizeof(TYPE) * C2, ...)
      |
        kzalloc(C1 * C2 * C3, ...)
      |
        kzalloc(C1 * C2, ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * (E2)
      +	E2, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * E2
      +	E2, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * (E2)
      +	E2, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * E2
      +	E2, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	(E1) * E2
      +	E1, E2
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	(E1) * (E2)
      +	E1, E2
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	E1 * E2
      +	E1, E2
        , ...)
      )
      Signed-off-by: NKees Cook <keescook@chromium.org>
      6396bb22
  6. 07 6月, 2018 1 次提交
    • M
      regulator: gpio: Revert · e536700e
      Mark Brown 提交于
      regulator: fixed/gpio: Revert GPIO descriptor changes due to platform breakage
      
      Commit 6059577c "regulator: fixed: Convert to use GPIO descriptor
      only" broke at least the ams-delta platform since the lookup tables
      added to the board files use the function name "enable" while the driver
      uses NULL causing the regulator to not acquire and control the enable
      GPIOs.  Revert that and a couple of other commits that are caught up
      with it to fix the issue:
      
      2b6c00c1 "ARM: pxa, regulator: fix building ezx e680"
      6059577c "regulator: fixed: Convert to use GPIO descriptor only"
      37bed97f "regulator: gpio: Get enable GPIO using GPIO descriptor"
      Reported-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      e536700e
  7. 29 5月, 2018 1 次提交
    • L
      regulator: fixed: Convert to use GPIO descriptor only · 6059577c
      Linus Walleij 提交于
      As we augmented the regulator core to accept a GPIO descriptor instead
      of a GPIO number, we can augment the fixed GPIO regulator to look up
      and pass that descriptor directly from device tree or board GPIO
      descriptor look up tables.
      
      Some boards just auto-enumerate their fixed regulator platform devices
      and I have assumed they get names like "fixed-regulator.0" but it's
      pretty hard to guess this. I need some testing from board maintainers to
      be sure. Other boards are straight forward, using just plain
      "fixed-regulator" (ID -1) or "fixed-regulator.1" hammering down the
      device ID.
      
      The OMAP didn't have proper label names on its GPIO chips so I have fixed
      this with a separate patch to the GPIO tree, see
      commit 088413bc
      "gpio: omap: Give unique labels to each GPIO bank/chip"
      
      It seems the da9055 and da9211 has never got around to actually passing
      any enable gpio into its platform data (not the in-tree code anyway) so we
      can just decide to simply pass a descriptor instead.
      
      The fixed GPIO-controlled regulator in mach-pxa/ezx.c was confusingly named
      "*_dummy_supply_device" while it is a very real device backed by a GPIO
      line. There is nothing dummy about it at all, so I renamed it with the
      infix *_regulator_* as part of this patch set.
      
      For the patch hunk hitting arch/blackfin I would say I do not expect
      testing, review or ACKs anymore so if it works, it works.
      
      The hunk hitting the x86 BCM43xx driver is especially tricky as the number
      comes out of SFI which is a mystery to me. I definately need someone to
      look at this. (Hi Andy.)
      
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Check the x86 BCM stuff
      Cc: Alexander Shiyan <shc_work@mail.ru> # i.MX boards user
      Cc: Haojian Zhuang <haojian.zhuang@gmail.com> # MMP2 maintainer
      Cc: Aaro Koskinen <aaro.koskinen@iki.fi> # OMAP1 maintainer
      Cc: Tony Lindgren <tony@atomide.com> # OMAP1,2,3 maintainer
      Cc: Mike Rapoport <rppt@linux.vnet.ibm.com> # EM-X270 maintainer
      Cc: Robert Jarzmik <robert.jarzmik@free.fr> # EZX maintainer
      Cc: Philipp Zabel <philipp.zabel@gmail.com> # Magician maintainer
      Cc: Daniel Mack <zonque@gmail.com> # Raumfeld maintainer
      Cc: Marc Zyngier <marc.zyngier@arm.com> # Zeus maintainer
      Cc: Geert Uytterhoeven <geert+renesas@glider.be> # SuperH pinctrl/GPIO maintainer
      Cc: Russell King <rmk+kernel@armlinux.org.uk> # SA1100
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Acked-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Acked-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      6059577c
  8. 24 5月, 2018 2 次提交
  9. 18 5月, 2018 7 次提交
  10. 17 5月, 2018 1 次提交
  11. 01 5月, 2018 6 次提交
    • T
      ARM: OMAP2+: powerdomain: use raw_smp_processor_id() for trace · 33e95724
      Tero Kristo 提交于
      smp_processor_id() checks preemption if CONFIG_DEBUG_PREEMPT is enabled,
      causing a warning dump during boot:
      
      [    5.042377] BUG: using smp_processor_id() in preemptible [00000000] code: swapper/0/1
      [    5.050281] caller is pwrdm_set_next_pwrst+0x48/0x88
      [    5.055330] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.14.24-g57341df0b4 #1
      
      Use the raw_smp_processor_id() for the trace instead, this value does
      not need to be perfectly correct. The alternative of disabling preempt
      is too heavy weight operation to be applied in PM hot path for just
      tracing purposes.
      Signed-off-by: NTero Kristo <t-kristo@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      33e95724
    • T
      ARM: OMAP2+: Make display related init into device_initcall · 463ab4d5
      Tony Lindgren 提交于
      We can initialize almost everything at normal module_init time with
      ti-sysc except for clocks and timers. To prepare for that, let's make
      display init into device_initcall as otherwise we'll be calling
      of_platform_populate() before the parent has probed.
      
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      463ab4d5
    • T
      ARM: OMAP2+: Initialize SoC PM later · 02b83dcb
      Tony Lindgren 提交于
      There's no need to probe devices until at module_init time and we
      currently have at least PM trying to use I2C for PMICs early on.
      
      As only a part of the SoC init_early is SoC specific, we only need to call
      the SoC specific PM init function. And we can modify omap2_common_pm_late_init()
      so it becomes a late_initcall().
      
      Note that this changes am335x to call omap2_clk_enable_autoidle_all() that
      seems to be missing currently.
      
      Cc: Keerthy <j-keerthy@ti.com>
      Cc: Tero Kristo <t-kristo@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      02b83dcb
    • T
      ARM: OMAP2+: Only probe SDMA via ti-sysc if configured in dts · 71941002
      Tony Lindgren 提交于
      We still have some SDMA probing using omap_device_build() for the
      arch/arm/plat-omap/dma.c part that the dmaengine driver then uses.
      
      So we still need to ensure that omap_device_build() works even if we
      probe and manage the dmaengine driver via ti-sysc. And we don't want
      to call dev_pm_domain_set() as otherwise we'd also have omap_device
      try to manage the hardware in addition to ti-sysc.
      
      Cc: Paul Walmsley <paul@pwsan.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      71941002
    • T
      ARM: OMAP2+: Use signed value for sysc register offsets · 103fd8e7
      Tony Lindgren 提交于
      We currently don't know if a revision register exists or not. Zero is
      often a valid offset for the revision register. As we are still checking
      device tree data against platform data, we will get bogus warnings with
      correct device tree data because of incomplete platform data.
      
      Let's fix the issue by using signed offsets and tag the revision registers
      that don't exist with -ENODEV, and init the missing ones with the correct
      revision register offset.
      
      Cc: Paul Walmsley <paul@pwsan.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      103fd8e7
    • T
      ARM: OMAP2+: Allow using ti-sysc for system timers · b456d4f5
      Tony Lindgren 提交于
      If a system timer is configured with an interrconnect target module in
      the dts, the ti,hwmods and module fck are at the interconnect target
      level. Then there's a separate fck for the timer child device.
      
      If the child device has a separate functional clock, we need to configure
      it directly. For example, timer clk clkctrl clock bit 0 is the module
      clock for the interconnect target, and bit 24 being the functional clock
      for the timer IP.
      
      For system timers, we already mark them as disabled. Now must also mark
      the interconnect target module as disabled to prevent ti-sysc to manage
      it instead of the system timer.
      
      Cc: Keerthy <j-keerthy@ti.com>
      Cc: Tero Kristo <t-kristo@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      b456d4f5
  12. 19 4月, 2018 1 次提交
  13. 17 4月, 2018 1 次提交
    • T
      ARM: OMAP2+: Drop unused pm-noop · 44773ba1
      Tony Lindgren 提交于
      Looks like these functions don't do anything in the mainline kernel so
      we can just drop it.
      
      Note that we must now also remove ir-rx51 pdata as it relies on the dummy
      platform data that does not do anything. And ir-rx51 is calling a pdata
      callback that doesn't do anything without checking if it exists first.
      
      For configuring device specific minimal latencies, the interface to use
      is pm_qos_add_request(). For an example, see what was done in commit
      9834ffd1 ("ASoC: omap-mcbsp: Add PM QoS support for McBSP to prevent
      glitches"). I've added some comments to ir-rx51 so people using it can
      add pm_qos support and test it.
      
      Cc: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
      Cc: Kevin Hilman <khilman@kernel.org>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Acked-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      44773ba1
  14. 05 4月, 2018 1 次提交
  15. 20 3月, 2018 2 次提交
  16. 01 3月, 2018 6 次提交
  17. 28 2月, 2018 3 次提交
    • D
      ARM: OMAP2+: pm33xx-core: Add platform code needed for PM · 41d9d44d
      Dave Gerlach 提交于
      Most of the PM code needed for am335x and am437x can be moved into a
      module under drivers but some core code must remain in mach-omap2 at the
      moment. This includes some internal clockdomain APIs and low-level ARM
      APIs which are also not exported for use by modules.
      
      Implement a few functions that handle these low-level platform
      operations can be passed to the pm33xx module through the use of
      platform data.
      
      In addition to this, to be able to share data structures between C and
      the sleep33xx and sleep43xx assembly code, we can automatically generate
      all of the C struct member offsets and sizes as macros by processing
      pm-asm-offsets.c into assembly code and then extracting the relevant
      data as is done for the generated platform asm-offsets.h files.
      
      Finally, add amx3_common_pm_init to create a dummy platform_device for
      pm33xx so that our soon to be introduced pm33xx module can probe on
      am335x and am437x platforms to enable basic suspend to mem and standby
      support.
      Signed-off-by: NDave Gerlach <d-gerlach@ti.com>
      Acked-by: NSantosh Shilimkar <ssantosh@kernel.org>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      41d9d44d
    • D
      ARM: OMAP2+: Introduce low-level suspend code for AM43XX · 41d37e61
      Dave Gerlach 提交于
      Although similar to AM33XX, introduce a new low-level asm file for
      suspend containing new context save and restore paths for EMIF and l2
      cache disabling and enabling.
      Signed-off-by: NDave Gerlach <d-gerlach@ti.com>
      Acked-by: NSantosh Shilimkar <ssantosh@kernel.org>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      41d37e61
    • D
      ARM: OMAP2+: Introduce low-level suspend code for AM33XX · 8a94cd7e
      Dave Gerlach 提交于
      In preparation for suspend-resume support for AM33XX, add
      the assembly file with the code which is copied to internal
      memory (OCMC RAM) during bootup and runs from there.
      
      As part of the low power entry (DeepSleep0 mode in AM33XX TRM),
      the code running from OCMC RAM does the following
      1. Calls routine to store the EMIF configuration
      2. Calls routine to place external memory in self-refresh
      3. Disables EMIF clock
      4. Executes WFI after writing to MPU_CLKCTRL register.
      
      If no interrupts have come, WFI execution on MPU gets registered
      as an interrupt with the WKUP-M3. WKUP-M3 takes care of disabling
      some clocks which MPU should not (L3, L4, OCMC RAM etc) and takes
      care of clockdomain and powerdomain transitions as part of the
      DeepSleep0 mode entry.
      
      In case a late interrupt comes in, WFI ends up as a NOP and MPU
      continues execution from internal memory. The 'abort path' code
      undoes whatever was done as part of the low power entry and indicates
      a suspend failure by passing a non-zero value to the cpu_resume routine.
      
      The 'resume path' code is similar to the 'abort path' with the key
      difference of MMU being enabled in the 'abort path' but being
      disabled in the 'resume path' due to MPU getting powered off.
      Signed-off-by: NDave Gerlach <d-gerlach@ti.com>
      Acked-by: NSantosh Shilimkar <ssantosh@kernel.org>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      8a94cd7e