Skip to content
  1. Sep 12, 2012
    • Paul Walmsley's avatar
      ARM: OMAP: clean up some smatch warnings, fix some printk(KERN_ERR ... · a032d33b
      Paul Walmsley authored
      
      
      Resolve the following warnings from smatch:
      
      arch/arm/mach-omap2/gpmc.c:282 gpmc_cs_set_timings() info: why not propagate 'div' from gpmc_cs_calc_divider() instead of -1?
      arch/arm/mach-omap2/serial.c:328 omap_serial_init_port() error: 'pdev' dereferencing possible ERR_PTR()
      arch/arm/mach-omap2/timer.c:213 omap2_gp_clockevent_init() Error invalid range 4096 to -1
      arch/arm/mach-omap2/gpio.c:63 omap2_gpio_dev_init() warn: possible memory leak of 'pdata'
      arch/arm/mach-omap2/omap_hwmod.c:1478 _assert_hardreset() warn: assigning -22 to unsigned variable 'ret'
      arch/arm/mach-omap2/omap_hwmod.c:1487 _assert_hardreset() warn: 4294963201 is more than 255 (max '(ret)' can be) so this is always the same.
      arch/arm/mach-omap2/omap_hwmod.c:1545 _read_hardreset() warn: assigning -22 to unsigned variable 'ret'
      arch/arm/mach-omap2/omap_hwmod.c:1554 _read_hardreset() warn: 4294963201 is more than 255 (max '(ret)' can be) so this is always the same.
      arch/arm/mach-omap2/dpll3xxx.c:629 omap3_clkoutx2_recalc() error: we previously assumed 'pclk' could be null (see line 627)
      arch/arm/mach-omap2/board-n8x0.c:422 n8x0_mmc_late_init() Error invalid range 14 to 13
      arch/arm/mach-omap1/leds-h2p2-debug.c:71 h2p2_dbg_leds_event() error: potentially derefencing uninitialized 'fpga'.
      arch/arm/plat-omap/mux.c:79 omap_cfg_reg() Error invalid range 4096 to -1
      
      Thanks to Tony Lindgren <tony@atomide.com> for pointing out that BUG()
      can be disabled.  The changes in the first version that removed the
      subsequent return() after BUG() states have been dropped.
      
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Cc: Tony Lindgren <tony@atomide.com>
      a032d33b
  2. Aug 23, 2012
    • Arnd Bergmann's avatar
      ARM: omap: allow building omap44xx without SMP · c7a9b09b
      Arnd Bergmann authored
      
      
      The new omap4 cpuidle implementation currently requires
      ARCH_NEEDS_CPU_IDLE_COUPLED, which only works on SMP.
      
      This patch makes it possible to build a non-SMP kernel
      for that platform. This is not normally desired for
      end-users but can be useful for testing.
      
      Without this patch, building rand-0y2jSKT results in:
      
      drivers/cpuidle/coupled.c: In function 'cpuidle_coupled_poke':
      drivers/cpuidle/coupled.c:317:3: error: implicit declaration of function '__smp_call_function_single' [-Werror=implicit-function-declaration]
      
      It's not clear if this patch is the best solution for
      the problem at hand. I have made sure that we can now
      build the kernel in all configurations, but that does
      not mean it will actually work on an OMAP44xx.
      
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      Tested-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      Cc: Kevin Hilman <khilman@ti.com>
      Cc: Tony Lindgren <tony@atomide.com>
      c7a9b09b
  3. Aug 09, 2012
  4. Aug 07, 2012
    • Kevin Hilman's avatar
      Revert "ARM: OMAP3: PM: call pre/post transition per powerdomain" · e0e29fd7
      Kevin Hilman authored
      
      
      This reverts commit 58f0829b.
      
      Converstion to per-pwrdm per/post transition calls was a bit
      premature.  Only tracking MPU, PER & CORE in the idle path means we
      lose the accounting for all the other powerdomains which may also
      transition in idle.  On OMAP3, due to autodeps, several powerdomains
      transition along with MPU (e.g. DSS, USBHOST), and the accounting for
      these was lost with this patch.  Since the accounting includes the
      context loss counters, drivers for devices in those power domains
      would never notice context lost, so would likely hang after any
      off-mode transitions.
      
      This patch should be revisited when the upcoming clkdm/pwrmdm/voltdm
      use-counting seires is merged since then we can properly do accounting
      without relying on a call in the idle path.
      
      In addition, the original patch had another bug because the PER
      powerdomain accounting was not updated until after the GPIO resume
      hook is called.  Since gpio_resume_after_idle() checks the context
      loss count (which is not yet updated) it would not properly restore
      context, leaving the GPIO banks in an undefined state.
      
      Cc: Jean Pihet <jean.pihet@newoldbits.com>
      Cc: Tero Kristo <t-kristo@ti.com>
      Cc: Rajendra Nayak <rnayak@ti.com>
      Reported-by: default avatarPaul Walmsley <paul@pwsan.com>
      Signed-off-by: default avatarKevin Hilman <khilman@ti.com>
      e0e29fd7
    • Kevin Hilman's avatar
      ARM: OMAP3: TWL4030: ensure sys_nirq1 is mux'd and wakeup enabled · 265a2bc8
      Kevin Hilman authored
      
      
      The SYS_NIRQ1 pin is the interupt line for the PMIC part of the TWL6030
      and interrupts from the PMIC are needed as wakeup sources.
      
      Ensure this pin is mux'd as input and has wakeup enabled so PMIC
      interupts (e.g. RTC) can be used as wakeup sources.
      
      Tested on 3430/n900, OMAP3530/Overo Fire, 3730/Overo FireSTORM,
      3730/Beagle-xM.
      
      Signed-off-by: default avatarKevin Hilman <khilman@ti.com>
      265a2bc8
    • Michael Jones's avatar
      omap2: mux: remove comment for nonexistent member · 36b547aa
      Michael Jones authored
      
      
      remove comment for nonexistent member
      
      Signed-off-by: default avatarMichael Jones <michael.jones@matrix-vision.de>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      36b547aa
    • Santosh Shilimkar's avatar
      OMAP2+: Fix random config build break with !ARM_CPU_SUSPEND · acb11fe8
      Santosh Shilimkar authored
      
      
      The random config builds with PM and !ARM_CPU_SUSPEND breaks with below
      error on omap2plus_defconfig.
      
      arch/arm/mach-omap2/sleep44xx.S:323: undefined reference to `cpu_resume'
      arch/arm/mach-omap2/omap-mpuss-lowpower.c:278: undefined reference to `cpu_suspend'
      
      This is because recently merged OMAP5 platform shares the common files
      with OMAP4 but doesn't select ARM_CPU_SUSPEND. Without the ARM_CPU_SUSPEND
      the sleep code is meaningless.
      
      Fix the same by adding ARM_CPU_SUSPEND for OMAP5. The suggestion came from
      Russell King in an off-list discussion.
      
      Cc: Russell King <rmk+kernel@arm.linux.org.uk>
      Cc: Kevin Hilman <khilman@ti.com>
      Reported-by: default avatarTony Lindgren <tony@atomide.com>
      Signed-off-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      acb11fe8
    • Javier Martinez Canillas's avatar
      ARM: OMAP3: igep0020: set GPIO mode for mux mcspi1_cs2 pin · a71eb61c
      Javier Martinez Canillas authored
      
      
      According to the IGEPv2 Rev.C data-sheet the LAN9221i pin 14 (IRQ) is
      connected to the OMAP3730 mcspi1_cs2 pin. Since this omap mux pin acts
      as an IRQ line, it has to be configured as an input GPIO.
      
      IGEPv2 platform code sets the smsc911x_cfg->gpio_irq to GPIO 176 but
      since the mux pin default mode is MODE7 (safe_mode) the driver fails
      when trying to register the IRQ with the following error message:
      
      [    1.994598] smsc911x: Driver version 2008-10-21
      [    3.704162] irq 272: nobody cared (try booting with the "irqpoll" option)
      [    3.711364] [<c001a114>] (unwind_backtrace+0x0/0xf0) from [<c009a0d4>] (__report_bad_irq+0x20/0xbc)
      [    3.720916] [<c009a0d4>] (__report_bad_irq+0x20/0xbc) from [<c009a41c>] (note_interrupt+0x1d8/0x238)
      [    3.730560] [<c009a41c>] (note_interrupt+0x1d8/0x238) from [<c0098234>] (handle_irq_event_percpu+0xc0/0x260)
      [    3.740936] [<c0098234>] (handle_irq_event_percpu+0xc0/0x260) from [<c0098410>] (handle_irq_event+0x3c/0x5c)
      [    3.751312] [<c0098410>] (handle_irq_event+0x3c/0x5c) from [<c009abe0>] (handle_level_irq+0xac/0x10c)
      [    3.761047] [<c009abe0>] (handle_level_irq+0xac/0x10c) from [<c0097a34>] (generic_handle_irq+0x30/0x48)
      [    3.770935] [<c0097a34>] (generic_handle_irq+0x30/0x48) from [<c02a6b74>] (gpio_irq_handler+0x180/0x1d4)
      [    3.780944] [<c02a6b74>] (gpio_irq_handler+0x180/0x1d4) from [<c0097a34>] (generic_handle_irq+0x30/0x48)
      [    3.790954] [<c0097a34>] (generic_handle_irq+0x30/0x48) from [<c0013e18>] (handle_IRQ+0x4c/0xac)
      [    3.800231] [<c0013e18>] (handle_IRQ+0x4c/0xac) from [<c000858c>] (omap3_intc_handle_irq+0x60/0x74)
      [    3.809783] [<c000858c>] (omap3_intc_handle_irq+0x60/0x74) from [<c04979e4>] (__irq_svc+0x44/0x60)
      [    3.819213] Exception stack(0xee42fde0 to 0xee42fe28)
      [    3.824554] fde0: 00000001 00000001 00000000 00000000 60000013 c06cce14 c06cce14 00000110
      [    3.833190] fe00: 00000000 c06ccdf4 60000013 ee41d000 fb058064 ee42fe28 c0089e08 c04976b4
      [    3.841796] fe20: 20000013 ffffffff
      [    3.845489] [<c04979e4>] (__irq_svc+0x44/0x60) from [<c04976b4>] (_raw_spin_unlock_irqrestore+0x34/0x44)
      [    3.855499] [<c04976b4>] (_raw_spin_unlock_irqrestore+0x34/0x44) from [<c0099744>] (__setup_irq+0x1b8/0x3f0)
      [    3.865875] [<c0099744>] (__setup_irq+0x1b8/0x3f0) from [<c0099a34>] (request_threaded_irq+0xb8/0x140)
      [    3.875701] [<c0099a34>] (request_threaded_irq+0xb8/0x140) from [<c0487950>] (smsc911x_drv_probe+0x75c/0x11a4)
      [    3.886260] [<c0487950>] (smsc911x_drv_probe+0x75c/0x11a4) from [<c02e9bcc>] (platform_drv_probe+0x18/0x1c)
      [    3.906707] [<c02e89b8>] (driver_probe_device+0x90/0x210) from [<c02e8bcc>] (__driver_attach+0x94/0x98)
      [    3.916625] [<c02e8bcc>] (__driver_attach+0x94/0x98) from [<c02e7298>] (bus_for_each_dev+0x50/0x7c)
      [    3.926177] [<c02e7298>] (bus_for_each_dev+0x50/0x7c) from [<c02e81d4>] (bus_add_driver+0x184/0x248)
      [    3.935821] [<c02e81d4>] (bus_add_driver+0x184/0x248) from [<c02e909c>] (driver_register+0x78/0x12c)
      [    3.945465] [<c02e909c>] (driver_register+0x78/0x12c) from [<c0008648>] (do_one_initcall+0x34/0x178)
      [    3.955108] [<c0008648>] (do_one_initcall+0x34/0x178) from [<c066e8f4>] (kernel_init+0xfc/0x1c0)
      [    3.964385] [<c066e8f4>] (kernel_init+0xfc/0x1c0) from [<c00140b0>] (kernel_thread_exit+0x0/0x8)
      [    3.973632] handlers:
      [    3.976043] [<c034e2cc>] smsc911x_irqhandler
      [    3.980560] Disabling IRQ #272
      
      Signed-off-by: default avatarJavier Martinez Canillas <javier@dowhile0.org>
      Acked-by: default avatarEnric Balletbo i Serra <eballetbo@gmail.com>
      Tested-by: default avatarEnric Balletbo i Serra <eballetbo@gmail.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      a71eb61c
  5. Aug 06, 2012
    • Igor Grinberg's avatar
      Revert "ARM: OMAP3530evm: set pendown_state and debounce time for ads7846" · c31cc1b7
      Igor Grinberg authored
      
      
      1) The above commit introduced a common ->get_pendown_state() function
      into the generic code, but that function was board-specific for the
      OMAP3EVM and thus broke most other boards using this code.
      
      2) The above commit was mis-merged introducing another bug which
      prevents the ads7846 driver probe function to succeed.
      The omap_ads7846_init() function frees the pendown GPIO in case there is
      no ->get_pendown_state() function set by the caller (board specific
      code), so it can be requested later by the ads7846 driver.
      The above commit add a common ->get_pendown_state() function without
      removing the gpio_free() call and thus once the ads7846 driver tries
      to use the pendown GPIO, it crashes as the pendown GPIO has not been
      requested.
      
      3) The above commit introduces NO new functionality as
      get_pendown_state() function is already implemented in a suitable way by
      the ads7846 driver and the debounce time handling has already been
      fixed by commit 97ee9f01 (ARM: OMAP: fix the ads7846 init code).
      
      This reverts commit 16aced80.
      
      Conflicts:
      	arch/arm/mach-omap2/common-board-devices.c
      
      Solved by taking the working version prior to the above commit.
      
      Cc: Zumeng Chen <zumeng.chen@windriver.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarIgor Grinberg <grinberg@compulab.co.il>
      Reviewed-by: default avatarKevin Hilman <khilman@ti.com>
      Tested-by: default avatarKevin Hilman <khilman@ti.com>
      Signed-off-by: default avatarKevin Hilman <khilman@ti.com>
      c31cc1b7
  6. Jul 31, 2012
  7. Jul 25, 2012
    • Santosh Shilimkar's avatar
      ARM: OMAP4: CPUidle: Open broadcast clock-event device. · b93d70ae
      Santosh Shilimkar authored
      OMAP4 idle driver uses CLOCK_EVT_NOTIFY_BROADCAST_[ENTER/EXIT]
      for broadcast clock events. But _ENTER/_EXIT doesn't really open
      broadcast clock events and to explicitly setup the broadcast device,
      CLOCK_EVT_NOTIFY_BROADCAST_ON should be used.
      
      Add the missing CLOCK_EVT_NOTIFY_BROADCAST_ON clockevent notifications.
      This will setup the broadcast timer in either periodic/oneshot modes
      correctly. Recent clockevent infrastructure change 77b0d60c {leave the
      broadcast device in shutdown mode when not needed} exposed this bug
      leading to boot hangs in oneshot mode. Prior to this, periodic broadcast
      mode was also broken. This change fixes both the periodic/oneshot broadcast
      modes.
      
      Discussion thread :
      	https://lkml.org/lkml/2012/4/9/13
      
      
      
      Signed-off-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      Signed-off-by: default avatarKevin Hilman <khilman@ti.com>
      b93d70ae
    • Kevin Hilman's avatar
      ARM: OMAP4: CPUidle: add synchronization for coupled idle states · 5b4d5bcc
      Kevin Hilman authored
      
      
      With coupled idle states, a failure for any CPU to hit a low power
      state must be coordinated such that all CPUs abort.
      
      On OMAP4, when entering a coupled state, CPU0 has to wait for CPU1 to
      enter its low power state before it can enter its low power state.
      
      This is implemented by letting CPU0 wait for the CPU1 powerdomain to
      hit off.  However, there are conditions where CPU1 might abort/fail
      and not hit off while CPU0 is waiting for it.  For example, a CPU1
      wakeup or a failed attempt to hit off due to hardware conditions.
      
      To avoid the deadlock where CPU0 would continually wait for CPU1 to
      hit off-mode, this patch adds a flag to signal when each CPU has come
      out of its low-power state.  CPU0 then checks whether CPU1 has hit off
      *or* has already completed its attempt to hit off.  If the latter,
      CPU0 must abort its attempt to hit a low-power state so the coupled
      state enter method can return.
      
      In addition, cpuidle_coupled_parallel_barrier() is used to ensure the
      clearing of the 'done' flag is synchronized on all CPUs.
      
      Signed-off-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      Signed-off-by: default avatarKevin Hilman <khilman@ti.com>
      5b4d5bcc
    • Santosh Shilimkar's avatar
      ARM: OMAP4: CPUidle: Use coupled cpuidle states to implement SMP cpuidle. · dd3ad97c
      Santosh Shilimkar authored
      
      
      OMAP4 CPUDILE driver is converted mainly based on notes from the
      coupled cpuidle patch series.
      
      The changes include :
      - Register both CPUs and C-states to cpuidle driver.
      - Set struct cpuidle_device.coupled_cpus
      - Set struct cpuidle_device.safe_state to non coupled state.
      - Set CPUIDLE_FLAG_COUPLED in struct cpuidle_state.flags for each
        state that affects multiple cpus.
      - Separate ->enter hooks for coupled & simple idle.
      - CPU0 wait loop for CPU1 power transition.
      - CPU1 wakeup mechanism for the idle exit.
      - Enabling ARCH_NEEDS_CPU_IDLE_COUPLED for OMAP4.
      
      Thanks to Kevin Hilman and Colin Cross on the suggestions/fixes
      on the intermediate version of this patch.
      
      Signed-off-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      Signed-off-by: default avatarKevin Hilman <khilman@ti.com>
      dd3ad97c
    • Santosh Shilimkar's avatar
      ARM: OMAP: timer: allow gp timer clock-event to be used on both cpus · 11d6ec2e
      Santosh Shilimkar authored
      
      
      For coupled cpuidle to work when both cpus are active, it needs a global timer
      that can handle events for both cpus.  This timer is used as the broadcast
      clock-event when the per-cpu timer hardware stop in low power states.
      Set the cpumask of clockevent_gpt to all cpus, set the rating correctly, and
      set the irq to allow the clockevent core to determine the affinity of the
      timer.
      
      Signed-off-by: default avatarColin Cross <ccross@android.com>
      Signed-off-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      Signed-off-by: default avatarKevin Hilman <khilman@ti.com>
      11d6ec2e
  8. Jul 20, 2012
  9. Jul 10, 2012
  10. Jul 09, 2012
  11. Jul 06, 2012
    • Zumeng Chen's avatar
      ARM: OMAP3530evm: set pendown_state and debounce time for ads7846 · 16aced80
      Zumeng Chen authored
      
      
      Currently most ads7846 config definitions for OMAP3 series boards have
      been moved to common-board-devices.c, and it is transparent for init.
      And it's no very proper to do gpio_request based on get_pendown_state
      since omap_ads7846_init knows everything about ads7846_config.
      
      So it's more fit to request gpio according to the right gpio_pendown
      and set debounce time conditionally. If we don't set proper debouce
      time, there are flooded interrupt counters of ads7846 responding to
      one time touch on screen, then the driver couldn't work very well.
      
      This patch has been validated on 3530evm.
      
      Signed-off-by: default avatarZumeng Chen <zumeng.chen@windriver.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      16aced80
    • Zumeng Chen's avatar
      ARM: omap3evm: enable VBUS switch for EHCI tranceiver · cb8ca589
      Zumeng Chen authored
      
      
      This was chosen by following the trace on the schematic from component U131
      and U134 to the CPEN pin on the USB3320 device.
      
      TWL4030.GPIO2-...->(T2_GPIO2_3V3)U131-..>nUSB2_EN-..>U134-..>EXP_nUSB2_1V8
      which starts EHCI tranceiver USB3320.
      
      This will set TWL4030.GPIO2 as output pin to drive EHCI tranceiver.
      
      Signed-off-by: default avatarZumeng Chen <zumeng.chen@windriver.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      cb8ca589
    • Zumeng Chen's avatar
      ARM: OMAP3EVM: Adding USB internal LDOs board file · 497af1f3
      Zumeng Chen authored
      
      
      EHCI PHY requires these regulators:
              EVM Rev >=E  --> VAUX2
              EVM Rev < E  --> VUSB1V5, VUSB1V8
      
      Adding USB internal LDOs (vusb1v5 & vusb1v8) and VAUX2 to omap3evm
      board file. Also removing vaux2_{1/2/3} supplies as they are not
      used on omap3 evm.
      
      But we need not to add vaux2 in twl4030_platform_data since it will
      be added conditionally.
      
      Signed-off-by: default avatarAjay Kumar Gupta <ajay.gupta@ti.com>
      Signed-off-by: default avatarVaibhav Hiremath <hvaibhav@ti.com>
      Signed-off-by: default avatarZumeng Chen <zumeng.chen@windriver.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      497af1f3
    • Zumeng Chen's avatar
    • Tarun Kanti DebBarma's avatar
      ARM: OMAP2+: dmtimer: cleanup fclk usage · ae6df418
      Tarun Kanti DebBarma authored
      
      
      With omap_hwmod_get_main_clk() now available, this can be passed to
      clk_get() to extract the fclk and thus avoid construction of fclk name.
      Corrected the timer fck name mis-match between clock44xx_data.c and
      omap_hwmod_44xx_data.c. For other platforms this is already taken care.
      
      Cc: Cousson, Benoit <b-cousson@ti.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Kevin Hilman <khilman@ti.com>
      Cc: Rajendra Nayak <rnayak@ti.com>
      Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
      Signed-off-by: default avatarTarun Kanti DebBarma <tarun.kanti@ti.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      ae6df418
    • Tony Lindgren's avatar
      ARM: OMAP2+: Fix mismerge for omap_hwmod_get_main_clk() API · 68c9a95e
      Tony Lindgren authored
      
      
      Commit ac5b0ea3 (Merge tag 'omap-devel-f-for-3.6'...) had a merge
      conflict that somehow got incorrecly resolved in a lossy way for
      commit bed9d1bb (ARM: OMAP2+: hwmod: add omap_hwmod_get_main_clk() API).
      Fix the issue by applying the missing pieces.
      
      Reported-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      68c9a95e
    • Paul Walmsley's avatar
      ARM: OMAP2+: hwmod code/clockdomain data: fix 32K sync timer · 006c7f18
      Paul Walmsley authored
      Kevin discovered that commit c8d82ff6
      ("ARM: OMAP2/3: hwmod data: Add 32k-sync timer data to hwmod
      database") broke CORE idle on OMAP3.  This prevents device low power
      states.
      
      The root cause is that the 32K sync timer IP block does not support
      smart-idle mode[1], and so the hwmod code keeps the IP block in
      no-idle mode while it is active.  This in turn prevents the WKUP
      clockdomain from transitioning to idle.  There is a hardcoded sleep
      dependency that prevents the CORE_L3 and CORE_CM clockdomains from
      transitioning to idle when the WKUP clockdomain is active[2], so the
      chip cannot enter any device low power states.
      
      It turns out that there is no need to take the 32k sync timer out of
      idle.  The IP block itself probably does not have any native idle
      handling at all, due to its simplicity.  Furthermore, the PRCM will
      never request target idle for this IP block while the kernel is
      running, due to the sleep dependency that prevents the WKUP
      clockdomain from idling while the CORE_L3 clockdomain is active.  So
      we can safely leave the 32k sync timer in target-force-idle mode, even
      while we continue to access it.
      
      This workaround is implemented by defining a new clockdomain flag,
      CLKDM_ACTIVE_WITH_MPU, that indicates that the clockdomain is
      guaranteed to be active whenever the MPU is inactive.  If an IP
      block's main functional clock exists inside this clockdomain, and the
      IP block does not support smart-idle modes, then the hwmod code will
      place the IP block into target force-idle mode even when enabled.  The
      WKUP clockdomains on OMAP3/4 are marked with this flag.  (On OMAP2xxx,
      no OCP header existed on the 32k sync timer.)   Other clockdomains also
      should be marked with this flag, but those changes are deferred until
      a later merge window, to create a minimal fix.
      
      Another theoretically clean fix for this problem would be to implement
      PM runtime-based control for 32k sync timer accesses.  These PM
      runtime calls would need to located in a custom clocksource, since the
      32k sync timer is currently used as an MMIO clocksource.  But in
      practice, there would be little benefit to doing so; and there would
      be some cost, due to the addition of unnecessary lines of code and the
      additional CPU overhead of the PM runtime and hwmod code - unnecessary
      in this case.
      
      Another possible fix would have been to modify the pm34xx.c code to
      force the IP block idle before entering WFI.  But this would not have
      been an acceptable approach: we are trying to remove this type of
      centralized IP block idle control from the PM code.
      
      This patch is a collaboration between Kevin Hilman <khilman@ti.com>
      and Paul Walmsley <paul@pwsan.com>.
      
      Thanks to Vaibhav Hiremath <hvaibhav@ti.com> for providing comments on
      an earlier version of this patch.  Thanks to Tero Kristo
      <t-kristo@ti.com> for identifying a bug in an earlier version of this
      patch.  Thanks to Benoît Cousson <b-cousson@ti.com> for identifying
      some bugs in several versions of this patch and for implementation
      comments.
      
      References:
      
      1. Table 16-96 "REG_32KSYNCNT_SYSCONFIG" of the OMAP34xx TRM Rev. ZU
         (SWPU223U), available from:
         http://www.ti.com/pdfs/wtbu/OMAP34x_ES3.1.x_PUBLIC_TRM_vzU.zip
      
      
      
      2. Table 4-72 "Sleep Dependencies" of the OMAP34xx TRM Rev. ZU
         (SWPU223U)
      
      3. ibid.
      
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Vaibhav Hiremath <hvaibhav@ti.com>
      Cc: Benoît Cousson <b-cousson@ti.com>
      Cc: Tero Kristo <t-kristo@ti.com>
      Tested-by: default avatarKevin Hilman <khilman@ti.com>
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Signed-off-by: default avatarKevin Hilman <khilman@ti.com>
      006c7f18
  12. Jul 05, 2012
Loading