29 Jun, 2011

1 commit


28 Jun, 2011

2 commits

  • Fix the section mismatch warning:

    WARNING: vmlinux.o(.text+0x21118): Section mismatch
    in reference from the function pm_dbg_init() to the
    function .init.text:pwrdms_setup()
    The function pm_dbg_init() references
    the function __init pwrdms_setup().
    This is often because pm_dbg_init lacks a __init
    annotation or the annotation of pwrdms_setup is wrong.

    Signed-off-by: Sanjeev Premi
    Signed-off-by: Kevin Hilman

    Sanjeev Premi
     
  • Remove OMAP3-specific register dumping feature from PM debug layer.
    This is removed because:

    - it's ugly
    - it's OMAP3-specific, and will obviously not scale to OMAP4+
    - userspace /dev/mem-based tools (like omapconf) can do this much better

    Tested-by: Santosh Shilimkar
    Acked-by: Santosh Shilimkar
    Acked-by: Jean Pihet
    Signed-off-by: Kevin Hilman

    Kevin Hilman
     

21 Jun, 2011

2 commits

  • Tested-by: Santosh Shilimkar
    Acked-by: Santosh Shilimkar
    Signed-off-by: Kevin Hilman

    Kevin Hilman
     
  • Remove the OMAP-specific PM debug 'sleep_while_idle' feature which is
    currently available as an OMAP-specific debugfs entry.

    This duplicates existing ARM-generic functionality available as a
    boot-time option using the boot cmdline option 'hohlt'.

    If runtime configuration of this is needed, then adding a debugfs
    entry for the ARM-generic hlt/nohlt interface should be added.

    Tested-by: Santosh Shilimkar
    Acked-by: Santosh Shilimkar
    Acked-by: Jean Pihet
    Signed-off-by: Kevin Hilman

    Kevin Hilman
     

20 Jun, 2011

1 commit


07 Jun, 2011

1 commit

  • WARNING: arch/arm/mach-omap2/built-in.o(.text+0x423c): Section mismatch in reference from the function pm_dbg_regset_init() to the function .init.text:pm_dbg_init()
    The function pm_dbg_regset_init() references
    the function __init pm_dbg_init().
    This is often because pm_dbg_regset_init lacks a __init
    annotation or the annotation of pm_dbg_init is wrong.

    Signed-off-by: Russell King
    Signed-off-by: Kevin Hilman

    Russell King
     

05 Feb, 2011

1 commit


22 Dec, 2010

5 commits

  • For devices which have not (yet) been converted to use omap_device,
    implement the context loss counter using the "brutal method" as
    originally proposed by Paul Walmsley[1].

    The dummy context loss counter is incremented every time it is
    checked, but only when off-mode is enabled. When off-mode is
    disabled, the dummy counter stops incrementing.

    Tested on 36xx/Zoom3 using MMC driver, which is currently the
    only in-tree user of this API.

    This patch should be reverted after all devices are converted to using
    omap_device.

    [1] http://marc.info/?l=linux-omap&m=129176260000626&w=2

    Signed-off-by: Kevin Hilman
    [paul@pwsan.com: fixed compile warning; fixed to compile on OMAP1]
    Signed-off-by: Paul Walmsley

    Kevin Hilman
     
  • The OMAP powerdomain code and data is all OMAP2+-specific. This seems
    unlikely to change any time soon. Move plat-omap/include/plat/powerdomain.h
    to mach-omap2/powerdomain.h. The primary point of doing this is to remove
    the temptation for unrelated upper-layer code to access powerdomain code
    and data directly.

    As part of this process, remove the references to powerdomain data
    from the GPIO "driver" and the OMAP PM no-op layer, both in plat-omap.
    Change the DSPBridge code to point to the new location for the
    powerdomain headers. The DSPBridge code should not be including the
    powerdomain headers; these should be removed.

    Signed-off-by: Paul Walmsley
    Cc: Kevin Hilman
    Cc: Omar Ramirez Luna
    Cc: Felipe Contreras
    Cc: Greg Kroah-Hartman

    Paul Walmsley
     
  • The OMAP clockdomain code and data is all OMAP2+-specific. This seems
    unlikely to change any time soon. Move plat-omap/include/plat/clockdomain.h
    to mach-omap2/clockdomain.h. The primary point of doing this is to remove
    the temptation for unrelated upper-layer code to access clockdomain code
    and data directly.

    DSPBridge also uses the clockdomain headers for some reason, so,
    modify it also. The DSPBridge code should not be including the
    clockdomain headers; these should be removed.

    Signed-off-by: Paul Walmsley
    Cc: Kevin Hilman
    Cc: Omar Ramirez Luna
    Cc: Felipe Contreras
    Cc: Greg Kroah-Hartman
    Tested-by: Rajendra Nayak
    Tested-by: Santosh Shilimkar

    Paul Walmsley
     
  • Now that OMAP4-specific PRCM functions have been added, distinguish the
    existing OMAP2/3-specific PRCM functions by prefixing them with "omap2_".

    This patch should not result in any functional change.

    Signed-off-by: Paul Walmsley
    Cc: Kevin Hilman
    Cc: Jarkko Nikula
    Cc: Peter Ujfalusi
    Cc: Liam Girdwood
    Cc: Mark Brown
    Tested-by: Santosh Shilimkar
    Tested-by: Rajendra Nayak

    Paul Walmsley
     
  • In preparation for adding OMAP4-specific PRCM accessor/mutator
    functions, split the existing OMAP2/3 PRCM code into OMAP2/3-specific
    files. Most of what was in mach-omap2/{cm,prm}.{c,h} has now been
    moved into mach-omap2/{cm,prm}2xxx_3xxx.{c,h}, since it was
    OMAP2xxx/3xxx-specific.

    This process also requires the #includes in each of these files to be
    changed to reference the new file name. As part of doing so, add some
    comments into plat-omap/sram.c and plat-omap/mcbsp.c, which use
    "sideways includes", to indicate that these users of the PRM/CM includes
    should not be doing so.

    Thanks to Felipe Contreras for comments on this
    patch.

    Signed-off-by: Paul Walmsley
    Cc: Jarkko Nikula
    Cc: Peter Ujfalusi
    Cc: Liam Girdwood
    Cc: Omar Ramirez Luna
    Acked-by: Omar Ramirez Luna
    Cc: Felipe Contreras
    Acked-by: Felipe Contreras
    Cc: Greg Kroah-Hartman
    Acked-by: Mark Brown
    Reviewed-by: Kevin Hilman
    Tested-by: Kevin Hilman
    Tested-by: Rajendra Nayak
    Tested-by: Santosh Shilimkar

    Paul Walmsley
     

03 Dec, 2010

1 commit


09 Oct, 2010

1 commit

  • This patch fixes sparse warnings due to non declaration of
    static structures and variables.

    Sparse warning logs fixed:
    arch/arm/mach-omap2/control.c:88:6: warning: symbol 'omap3_secure_ram_storage' was not declared. Should it be static?
    n
    arch/arm/mach-omap2/timer-gp.c:50:22: warning: symbol 'gptimer_wakeup' was not declared. Should it be static?
    arch/arm/mach-omap2/timer-gp.c:240:18: warning: symbol 'omap_timer' was not declared. Should it be static?
    arch/arm/mach-omap2/prcm.c:121:24: warning: symbol 'prcm_context' was not declared. Should it be static?
    arch/arm/mach-omap2/mux2420.c:510:29: warning: symbol 'omap2420_pop_ball' was not declared. Should it be static?
    arch/arm/mach-omap2/mux2430.c:589:29: warning: symbol 'omap2430_pop_ball' was not declared. Should it be static?
    arch/arm/mach-omap2/mux34xx.c:934:28: warning: symbol 'omap3_cus_subset' was not declared. Should it be static?
    arch/arm/mach-omap2/mux34xx.c:1080:29: warning: symbol 'omap3_cus_ball' was not declared. Should it be static?
    arch/arm/mach-omap2/mux34xx.c:1272:28: warning: symbol 'omap3_cbb_subset' was not declared. Should it be static?
    arch/arm/mach-omap2/mux34xx.c:1393:29: warning: symbol 'omap3_cbb_ball' was not declared. Should it be static?
    arch/arm/mach-omap2/mux34xx.c:1603:28: warning: symbol 'omap36xx_cbp_subset' was not declared. Should it be static?
    arch/arm/mach-omap2/mux34xx.c:1821:29: warning: symbol 'omap36xx_cbp_ball' was not declared. Should it be static?
    arch/arm/mach-omap2/pm-debug.c:165:15: warning: symbol 'pm_dbg_dir' was not declared. Should it be static?
    arch/arm/mach-omap2/board-omap3evm.c:587:30: warning: symbol 'ads7846_config' was not declared. Should it be static?
    arch/arm/mach-omap2/board-omap3evm.c:606:23: warning: symbol 'omap3evm_spi_board_info' was not declared. Should it be static?
    arch/arm/mach-omap2/board-rx51-sdram.c:46:25: warning: symbol 'rx51_sdrc_params' was not declared. Should it be static?
    arch/arm/mach-omap2/board-rx51-sdram.c:211:25: warning: symbol 'rx51_get_sdram_timings' was not declared. Should it be static?
    arch/arm/mach-omap2/board-omap3touchbook.c:64:15: warning: symbol 'touchbook_revision' was not declared. Should it be static?
    arch/arm/mach-omap2/board-am3517evm.c:350:24: warning: symbol 'am3517_evm_dss_device' was not declared. Should it be static?
    arch/arm/mach-omap2/board-omap3stalker.c:567:23: warning: symbol 'omap3stalker_spi_board_info' was not declared. Should it be static?

    Signed-off-by: Manjunath Kondaiah G
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: Nishanth Menon
    Signed-off-by: Tony Lindgren

    Manjunath Kondaiah G
     

24 Sep, 2010

2 commits


22 Sep, 2010

1 commit

  • This patch removes omap3 hardcodings from pm-debug.c
    so that enabling PM debugfs support does break compilation
    for other OMAP's. This is a preparatory patch for supporting
    OMAP4 pm entries through PM debugfs.

    Signed-off-by: Thara Gopinath
    Signed-off-by: Kevin Hilman

    Thara Gopinath
     

13 May, 2010

1 commit


30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

25 Feb, 2010

1 commit

  • This patch adds counters to keep track of whether the powerdomain
    logic or software controllable memory banks are turned off when
    the power domain enters retention. During power domain retention
    if logic gets turned off, the scenario is known as Open Switch Retention.
    Also during retention s/w controllable memory banks of a power
    domain can be chosen to be kept in retention or off.

    This patch adds one counter per powerdomain to track the power domain
    logic state during retention. Number of memory bank state counters
    added depends on the number of software controllable memory banks
    of the powerdomain. To view these counters do
    cat ../debug/pm_debug/count

    Signed-off-by: Thara Gopinath
    [paul@pwsan.com: conditional expressions simplified; counter increment
    code moved to its own function]
    Signed-off-by: Paul Walmsley

    Thara Gopinath
     

27 Jan, 2010

3 commits

  • OMAP clockdomains and powerdomains are currently defined statically,
    only registered at boot, and never unregistered, so we can remove the
    unregister function and the locking. A variant of this was originally
    suggested a while ago by Dmitry Baryshkov .
    This version of this patch contains an additional fix from Kevin Hilman
    to address one of the pwrdm_for_each_nolock()
    users in mach-omap2/pm-debug.c. Thanks Kevin.

    Signed-off-by: Paul Walmsley
    Cc: Dmitry Baryshkov
    Cc: Kevin Hilman

    Paul Walmsley
     
  • Here the ".clkstctrl_reg" field is added to the clockdomain stucture
    as the module offsets for OMAP4 do not map one to one for powerdomains
    and clockdomains as it used to for OMAP3. Hence we need to use absolute
    addresses to access the control registers. Some of the clock domains have
    modules falling in the address space of PRM partition. Hence necessitating
    the use of absolute adresses.

    Signed-off-by: Abhijit Pagare
    Signed-off-by: Paul Walmsley
    Cc: Benoit Cousson
    Cc: Rajendra Nayak

    Abhijit Pagare
     
  • Module offsets were same for OMAP2 and OMAP3 while they differ for OMAP4.
    Hence we need different macros for identifying platform specific offsets.

    Signed-off-by: Abhijit Pagare
    Signed-off-by: Paul Walmsley
    Cc: Benoit Cousson
    Cc: Rajendra Nayak

    Abhijit Pagare
     

21 Jan, 2010

3 commits

  • Fix following warning when CONFIG_DEBUG_FS wasn't selected:

    arch/arm/mach-omap2/pm-debug.c:57: warning: 'pm_dbg_init' declared 'static' but never defined

    Signed-off-by: Sergio Aguirre
    Signed-off-by: Kevin Hilman

    Sergio Aguirre
     
  • val is an u64 pointer, we need an int to check the error.

    Signed-off-by: Roel Kluin
    Signed-off-by: Kevin Hilman

    Roel Kluin
     
  • The PM debug code fails to build on when CONFIG_DEBUG_FS is not
    enabled.

    Build error log:
    arch/arm/mach-omap2/built-in.o: In function `omap_sram_idle':
    arch/arm/mach-omap2/pm34xx.c:449: undefined reference to `pm_dbg_regset_save'
    arch/arm/mach-omap2/pm34xx.c:460: undefined reference to `pm_dbg_regset_save'
    arch/arm/mach-omap2/built-in.o: In function `configure_vc':
    arch/arm/mach-omap2/pm34xx.c:1237: undefined reference to `pm_dbg_regset_init'
    arch/arm/mach-omap2/pm34xx.c:1238: undefined reference to `pm_dbg_regset_init'
    make: *** [.tmp_vmlinux1] Error 1

    This patch fixes the above errors.

    Kernel booting is tested on omap zoom2 and zoom3 boards.

    Signed-off-by: Manjunatha GK
    Signed-off-by: Kevin Hilman

    Manjunatha GK
     

12 Dec, 2009

1 commit


12 Nov, 2009

2 commits

  • Using debugfs, export a configurable wakeup timer to be used to
    wakeup system from suspend.

    If a non-zero value is written to
    /debug/pm_debug/wakeup_timer_seconds, A timer wakeup event will wake
    the system and resume after the configured number of seconds.

    Signed-off-by: Kevin Hilman

    Kevin Hilman
     
  • Allow enable/disable of low-power states during idle. To
    enable low-power idle:

    echo 1 > /debug/pm_debug/sleep_while_idle

    to disable:

    echo 0 > /debug/pm_debug/sleep_while_idle

    Also allow enable/disable of OFF-mode. To enable:

    echo 1 > /debug/pm_debug/enable_off_mode

    to disable:

    echo 0 > /debug/pm_debug/enable_off_mode

    Signed-off-by: Kevin Hilman

    Kevin Hilman
     

21 Oct, 2009

1 commit

  • Move the remaining headers under plat-omap/include/mach
    to plat-omap/include/plat. Also search and replace the
    files using these headers to include using the right path.

    This was done with:

    #!/bin/bash
    mach_dir_old="arch/arm/plat-omap/include/mach"
    plat_dir_new="arch/arm/plat-omap/include/plat"
    headers=$(cd $mach_dir_old && ls *.h)
    omap_dirs="arch/arm/*omap*/ \
    drivers/video/omap \
    sound/soc/omap"
    other_files="drivers/leds/leds-ams-delta.c \
    drivers/mfd/menelaus.c \
    drivers/mfd/twl4030-core.c \
    drivers/mtd/nand/ams-delta.c"

    for header in $headers; do
    old="#include

    Tony Lindgren
     

20 Oct, 2009

1 commit

  • This patch splits OMAP2_IO_ADDRESS to OMAP2_L3_IO_ADDRESS and
    OMAP2_L4_IO_ADDRESS to reclaim more IO space.

    The omap_read*() and omap_write*() functions will work only over
    L4 address space. Current omap kernel stack uses these functions
    only to access registers over L4 io address space

    Note that these macros should only be used when ioremap does
    not work. Please use ioremap instead in all new code.

    Signed-off-by: Santosh Shilimkar
    Signed-off-by: Tony Lindgren

    Santosh Shilimkar
     

06 Oct, 2009

1 commit

  • The 'pwrdm_for_each()' function walks powerdomains with a spinlock
    locked, so the the callbacks cannot do anything which may sleep.
    This patch introduces a 'pwrdm_for_each_nolock()' helper which does
    the same, but without the spinlock locked. This fixes the following
    lockdep warning:

    [ 0.000000] WARNING: at kernel/lockdep.c:2460 lockdep_trace_alloc+0xac/0xec()
    [ 0.000000] Modules linked in:
    (unwind_backtrace+0x0/0xdc) from [] (warn_slowpath_common+0x48/0x60)
    (warn_slowpath_common+0x48/0x60) from [] (lockdep_trace_alloc+0xac/0xec)
    (lockdep_trace_alloc+0xac/0xec) from [] (kmem_cache_alloc+0x1c/0xd0)
    (kmem_cache_alloc+0x1c/0xd0) from [] (d_alloc+0x1c/0x1a4)
    (d_alloc+0x1c/0x1a4) from [] (__lookup_hash+0xd8/0x118)
    (__lookup_hash+0xd8/0x118) from [] (lookup_one_len+0x84/0x94)
    (lookup_one_len+0x84/0x94) from [] (debugfs_create_file+0x8c/0x20c)
    (debugfs_create_file+0x8c/0x20c) from [] (debugfs_create_dir+0x1c/0x20)
    (debugfs_create_dir+0x1c/0x20) from [] (pwrdms_setup+0x60/0x90)
    (pwrdms_setup+0x60/0x90) from [] (pwrdm_for_each+0x30/0x80)
    (pwrdm_for_each+0x30/0x80) from [] (pm_dbg_init+0x7c/0x14c)
    (pm_dbg_init+0x7c/0x14c) from [] (do_one_initcall+0x5c/0x1b8)
    (do_one_initcall+0x5c/0x1b8) from [] (kernel_init+0x90/0x10c)
    (kernel_init+0x90/0x10c) from [] (kernel_thread_exit+0x0/0x8)

    Signed-off-by: Artem Bityutskiy
    Signed-off-by: Kevin Hilman

    Artem Bityutskiy
     

03 Sep, 2009

3 commits

  • Target state can be read / programmed via files under:
    [debugfs]/pm_debug/[pwrdm]/suspend

    Signed-off-by: Tero Kristo
    Signed-off-by: Kevin Hilman

    Tero Kristo
     
  • Allows dumping out current register contents from the debug filesystem, and
    also allows user to add arbitrary register save points into code. Current
    register contents are available under debugfs at:

    [debugfs]/pm_debug/registers/current

    To add a save point, do following:

    From module init (or somewhere before the save call, called only once):
    pm_dbg_init_regset(n); // n=1..4, allocates memory for dump area #n

    From arbitrary code location:
    pm_dbg_regset_save(n); // n=1..4, saves registers to dump area #n

    After this, the register dump can be seen under [debugfs]/pm_debug/registers/n

    Signed-off-by: Tero Kristo
    Signed-off-by: Kevin Hilman

    Tero Kristo
     
  • This patch provides the debugfs entries and a function which will be
    called by the PM code to register the time spent per domain per
    state. Also some new fields are added to the powerdomain struct to
    keep the time information.

    NOTE: As of v2.6.29, using getnstimeofday() after drivers are
    suspended is no longer safe since the timekeeping subsystem is also
    suspended as part of the suspend process. Instead use sched_clock()
    which on OMAP returns the 32k SYNC timer in nanoseconds.

    Also, do not print out status for meta powerdomains (dpll*)

    Signed-off-by: Peter 'p2' De Schrijver
    Signed-off-by: Tero Kristo
    Signed-off-by: Kevin Hilman

    Peter 'p2' De Schrijver
     

29 Aug, 2009

1 commit


29 May, 2009

1 commit

  • This patch is to sync the core linux-omap PM code with mainline. This
    code has evolved and been used for a while the linux-omap tree, but
    the attempt here is to finally get this into mainline.

    Following this will be a series of patches from the 'PM branch' of the
    linux-omap tree to add full PM hardware support from the linux-omap
    tree.

    Much of this PM core code was written by Jouni Hogander with
    significant contributions from Paul Walmsley as well as many others
    from Nokia, Texas Instruments and linux-omap community.

    Signed-off-by: Jouni Hogander
    Cc: Paul Walmsley
    Signed-off-by: Kevin Hilman

    Kevin Hilman