1. 10 5月, 2012 2 次提交
    • V
      ARM: OMAP: Make OMAP clocksource source selection using kernel param · 1fe97c8f
      Vaibhav Hiremath 提交于
      Current OMAP code supports couple of clocksource options based
      on compilation flag (CONFIG_OMAP_32K_TIMER). The 32KHz sync-timer
      and a gptimer which can run on 32KHz or system clock (e.g 38.4 MHz).
      So there can be 3 options -
      
      1. 32KHz sync-timer
      2. Sys_clock based (e.g 13/19.2/26/38.4 MHz) gptimer
      3. 32KHz based gptimer.
      
      The optional gptimer based clocksource was added so that it can
      give the high precision than sync-timer, so expected usage was 2
      and not 3.
      Unfortunately option 2, clocksource doesn't meet the requirement of
      free-running clock as per clocksource need. It stops in low power states
      when sys_clock is cut. That makes gptimer based clocksource option
      useless for OMAP2/3/4 devices with sys_clock as a clock input.
      So, in order to use option 2, deeper idle state MUST be disabled.
      
      Option 3 will still work but it is no better than 32K sync-timer
      based clocksource.
      
      We must support both sync timer and gptimer based clocksource as
      some OMAP based derivative SoCs like AM33XX does not have the
      sync timer.
      
      Considering above, make sync-timer and gptimer clocksource runtime
      selectable so that both OMAP and AMXXXX continue to use the same code.
      
      And, in order to precisely configure/setup sched_clock for given
      clocksource, decision has to be made early enough in boot sequence.
      
      So, the solution is,
      
      Use standard kernel parameter ("clocksource=") to override
      default 32k_sync-timer, in addition to this, we also use hwmod database
      lookup mechanism, through which at run-time we can identify availability
      of 32k-sync timer on the device, else fall back to gptimer.
      
      Also, moved low-level SoC specific init code to respective files,
      (mach-omap1/timer32k.c and mach-omap2/timer.c)
      Signed-off-by: NVaibhav Hiremath <hvaibhav@ti.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      Reviewed-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
      Acked-by: NKevin Hilman <khilman@ti.com>
      Tested-by: NKevin Hilman <khilman@ti.com>
      Cc: Benoit Cousson <b-cousson@ti.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Tarun Kanti DebBarma <tarun.kanti@ti.com>
      Cc: Ming Lei <tom.leiming@gmail.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      1fe97c8f
    • V
      ARM: OMAP2+: Replace space with underscore in the name field of system timers · f36921be
      Vaibhav Hiremath 提交于
      Depending on the bootloader, passing command-line arguments
      with spaces may have issues. Some bootloaders doesn't seem
      to pass along the quotes, passing only 'gp' part of the string,
      which leads to wrong override configuration.
      
      The only affected kernel parameter configuration for OMAP family
      is "clocksource=", used to override kernel clocksource.
      
      So this patch changes "gp timer" => "gp_timer", for clockevent,
      clocksource and timer irq_handler.
      Signed-off-by: NVaibhav Hiremath <hvaibhav@ti.com>
      Acked-by: NKevin Hilman <khilman@ti.com>
      Tested-by: NKevin Hilman <khilman@ti.com>
      Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
      Cc: Benoit Cousson <b-cousson@ti.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      f36921be
  2. 08 5月, 2012 1 次提交
  3. 19 4月, 2012 1 次提交
  4. 13 3月, 2012 1 次提交
  5. 27 1月, 2012 1 次提交
    • V
      ARM: OMAP2+: timer: Fix crash due to wrong arg to __omap_dm_timer_read_counter · dbc3982a
      Vaibhav Hiremath 提交于
      Commit 2f0778af (ARM: 7205/2: sched_clock: allow sched_clock to be
      selected at runtime) had a typo for the case when CONFIG_OMAP_32K_TIMER
      is not set.
      
      In dmtimer_read_sched_clock(), wrong argument was getting passed to
      __omap_dm_timer_read_counter() function call; instead of "&clksrc",
      we were passing "clksrc.io_base", which results into kernel crash.
      
      To reproduce kernel crash, just disable the CONFIG_OMAP_32K_TIMER config
      option (and DEBUG_LL) and build/boot the kernel.
      This will use dmtimer as a kernel clocksource and lead to kernel
      crash during boot  -
      
      [    0.000000] OMAP clocksource: GPTIMER2 at 26000000 Hz
      [    0.000000] sched_clock: 32 bits at 26MHz, resolution 38ns, wraps every
      165191ms
      [    0.000000] Unable to handle kernel paging request at virtual address
      00030ef1
      [    0.000000] pgd = c0004000
      [    0.000000] [00030ef1] *pgd=00000000
      [    0.000000] Internal error: Oops: 5 [#1] SMP
      [    0.000000] Modules linked in:
      [    0.000000] CPU: 0    Not tainted  (3.3.0-rc1-11574-g0c76665-dirty #3)
      [    0.000000] PC is at dmtimer_read_sched_clock+0x18/0x4c
      [    0.000000] LR is at update_sched_clock+0x10/0x84
      [    0.000000] pc : [<c00243b8>]    lr : [<c0018684>]    psr: 200001d3
      [    0.000000] sp : c0641f38  ip : c0641e18  fp : 0000000a
      [    0.000000] r10: 151c3303  r9 : 00000026  r8 : 76276259
      [    0.000000] r7 : 00028547  r6 : c065ac80  r5 : 431bde82  r4 : c0655968
      [    0.000000] r3 : 00030ef1  r2 : fb032000  r1 : 00000028  r0 : 00000001
      Signed-off-by: NVaibhav Hiremath <hvaibhav@ti.com>
      [tony@atomide.com: updated comments]
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      dbc3982a
  6. 19 12月, 2011 1 次提交
  7. 18 11月, 2011 1 次提交
  8. 05 11月, 2011 1 次提交
  9. 22 9月, 2011 4 次提交
  10. 20 9月, 2011 1 次提交
  11. 10 8月, 2011 1 次提交
  12. 28 6月, 2011 4 次提交
  13. 20 6月, 2011 3 次提交
  14. 01 3月, 2011 1 次提交
    • P
      OMAP2+: clockevent: set up GPTIMER clockevent hwmod right before timer init · 38698bef
      Paul Walmsley 提交于
      Set up the GPTIMER hwmod used for the clockevent source immediately
      before it is used.  This avoids the need to set up all of the hwmods
      until the boot process is further along.  (In general, we want to defer
      as much as possible until late in the boot process.)
      
      This second version fixes a bug pointed out by Santosh Shilimkar
      <santosh.shilimkar@ti.com>, that would cause the kernel to use an
      incorrect timer hwmod name if the selected GPTIMER was not 1 or 12 -
      thanks Santosh.  Also, Tarun Kanti DebBarma <tarun.kanti@ti.com>
      pointed out that the original patch did not apply cleanly; this has
      now been fixed.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Benoît Cousson <b-cousson@ti.com>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Kevin Hilman <khilman@ti.com>
      Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
      Acked-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
      Cc: Tarun Kanti DebBarma <tarun.kanti@ti.com>
      38698bef
  15. 25 2月, 2011 1 次提交
    • P
      OMAP2+: clocksource: fix crash on boot when !CONFIG_OMAP_32K_TIMER · cbc94380
      Paul Walmsley 提交于
      
      OMAP2+ kernels built without CONFIG_OMAP_32K_TIMER crash on boot after the
      2.6.38 sched_clock changes:
      
      [    0.000000] OMAP clockevent source: GPTIMER1 at 13000000 Hz
      [    0.000000] Unable to handle kernel NULL pointer dereference at virtual address 00000000
      [    0.000000] pgd = c0004000
      [    0.000000] [00000000] *pgd=00000000
      [    0.000000] Internal error: Oops: 80000005 [#1] SMP
      [    0.000000] last sysfs file:
      [    0.000000] Modules linked in:
      [    0.000000] CPU: 0    Not tainted  (2.6.38-rc5-00057-g04aa67de #152)
      [    0.000000] PC is at 0x0
      [    0.000000] LR is at sched_clock_poll+0x2c/0x3c
      
      Without CONFIG_OMAP_32K_TIMER, the kernel has an clockevent and
      clocksource resolution about three orders of magnitude higher than
      with CONFIG_OMAP_32K_TIMER set.  The tradeoff is that the lowest
      power consumption states are not available.
      
      Fix by calling init_sched_clock() from the GPTIMER clocksource init code.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      cbc94380
  16. 19 1月, 2011 1 次提交
    • P
      OMAP: counter_32k: init clocksource as part of machine timer init · d8328f3b
      Paul Walmsley 提交于
      After commit dc548fbb ("ARM: omap: convert
      sched_clock() to use new infrastructure"), OMAPs that use the 32KiHz
      "synchronization timer" as their clocksource crash during boot:
      
      [    0.000000] OMAP clockevent source: GPTIMER1 at 32768 Hz
      [    0.000000] Unable to handle kernel NULL pointer dereference at virtual address 00000000
      [    0.000000] pgd = c0004000
      [    0.000000] [00000000] *pgd=00000000
      [    0.000000] Internal error: Oops: 80000005 [#1] SMP
      [    0.000000] last sysfs file:
      [    0.000000] Modules linked in:
      [    0.000000] CPU: 0    Tainted: G        W    (2.6.37-07734-g2467802 #7)
      [    0.000000] PC is at 0x0
      [    0.000000] LR is at sched_clock_poll+0x2c/0x3c
      [    0.000000] pc : [<00000000>]    lr : [<c0060b74>]    psr: 600001d3
      [    0.000000] sp : c058bfd0  ip : c058a000  fp : 00000000
      [    0.000000] r10: 00000000  r9 : 411fc092  r8 : 800330c8
      [    0.000000] r7 : c05a08e0  r6 : c0034c48  r5 : c05ffc40  r4 : c0034c4c
      [    0.000000] r3 : c05ffe6c  r2 : c05a0bc0  r1 : c059f098  r0 : 00000000
      [    0.000000] Flags: nZCv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
      [    0.000000] Control: 10c53c7f  Table: 8000404a  DAC: 00000017
      
      This is due to the recent ARM init_sched_clock() changes and the late
      initialization of the counter_32k clock source.  More information here:
      
         http://marc.info/?l=linux-omap&m=129513468605208&w=2
      
      Fix by initializing the counter_32k clocksource during the machine timer
      initialization.
      Reported-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Tested-by: NThomas Weber <weber@corscience.de>
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      d8328f3b
  17. 23 12月, 2010 1 次提交
  18. 25 11月, 2010 1 次提交
  19. 09 10月, 2010 1 次提交
    • M
      OMAP2plus: Fix static function warnings · 04aeae77
      Manjunath Kondaiah G 提交于
      This patch fixes sparse warnings due non declarations of static functions.
      
      arch/arm/mach-omap2/timer-gp.c:115:12: warning: symbol 'omap2_gp_clockevent_set_gptimer' was not declared. Should it be static?
      arch/arm/mach-omap2/powerdomain.c:993:5: warning: symbol 'pwrdm_set_lowpwrstchange' was not declared. Should it be static?
      arch/arm/mach-omap2/board-flash.c:141:8: warning: symbol 'board_nand_init' was not declared. Should it be static?
      arch/arm/mach-omap2/board-n8x0.c:416:6: warning: symbol 'n8x0_mmc_slot1_cover_handler' was not declared. Should it be static?
      arch/arm/mach-omap2/board-n8x0.c:544:13: warning: symbol 'n8x0_mmc_init' was not declared. Should it be static?
      arch/arm/mach-omap2/board-rx51-peripherals.c:902:13: warning: symbol 'rx51_peripherals_init' was not declared. Should it be static?
      arch/arm/mach-omap2/board-rx51-video.c:107:13: warning: symbol 'rx51_video_mem_init' was not declared. Should it be static?
      arch/arm/mach-omap2/board-zoom-debugboard.c:155:12: warning: symbol 'zoom_debugboard_init' was not declared. Should it be static?
      arch/arm/mach-omap2/board-zoom-peripherals.c:280:13: warning: symbol 'zoom_peripherals_init' was not declared. Should it be static?
      arch/arm/mach-omap2/board-igep0020.c:110:13: warning: symbol 'igep2_flash_init' was not declared. Should it be static?
      arch/arm/mach-omap2/board-am3517evm.c:109:6: warning: symbol 'am3517_evm_ethernet_init' was not declared. Should it be static?
      drivers/mtd/onenand/omap2.c:577:5: warning: symbol 'omap2_onenand_rephase' was not declared. Should it be static?
      Signed-off-by: NManjunath Kondaiah G <manjugk@ti.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: Nishanth Menon <nm@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      04aeae77
  20. 21 9月, 2010 1 次提交
  21. 25 2月, 2010 1 次提交
    • S
      OMAP4: clock: Remove clock hacks from timer-gp.c · ad001f14
      Santosh Shilimkar 提交于
      Now the omap4 clock framework is in mainline and clk_get_rate()
      is functional. Hence reomve the hardcoded clock hacks.
      
      This patch also fixes
      Division by zero in kernel.
      Backtrace:
      [<c0025fb8>] (dump_backtrace+0x0/0x110) from [<c017febc>] (dump_stack+0x18/0x1c)
       r7:60000093 r6:c0641050 r5:c0223e78 r4:c02126b4
      [<c017fea4>] (dump_stack+0x0/0x1c) from [<c00260fc>] (__div0+0x18/0x20)
      [<c00260e4>] (__div0+0x0/0x20) from [<c01431fc>] (Ldiv0+0x8/0x10)
      [<c00318d4>] (omap_dm_timer_stop+0x0/0xb0) from [<c002c148>] (omap2_gp_timer_set_mode+0x1c/0x68)
       r5:c0223e78 r4:00000000
      [<c002c12c>] (omap2_gp_timer_set_mode+0x0/0x68) from [<c0063270>] (clockevents_set_mode+0x30/0x64)
       r5:c020cae0 r4:00000000
      [<c0063240>] (clockevents_set_mode+0x0/0x64) from [<c00632fc>] (clockevents_exchange_device+0x30/0x9c)
       r5:c020cae0 r4:c02146e0
      [<c00632cc>] (clockevents_exchange_device+0x0/0x9c) from [<c00636e0>] (tick_notify+0x17c/0x404)
       r7:00000000 r6:c0641050 r5:00000000 r4:c020cae0
      [<c0063564>] (tick_notify+0x0/0x404) from [<c005d5fc>] (notifier_call_chain+0x34/0x78)
      [<c005d5c8>] (notifier_call_chain+0x0/0x78) from [<c005d684>] (__raw_notifier_call_chain+0x1c/0x24)
      [<c005d668>] (__raw_notifier_call_chain+0x0/0x24) from [<c005d6ac>] (raw_notifier_call_chain+0x20/0x28)
      [<c005d68c>] (raw_notifier_call_chain+0x0/0x28) from [<c0062e78>] (clockevents_do_notify+0x1c/0x24)
      [<c0062e5c>] (clockevents_do_notify+0x0/0x24) from [<c0062f18>] (clockevents_register_device+0x98/0xd0)
      [<c0062e80>] (clockevents_register_device+0x0/0xd0) from [<c001a194>] (percpu_timer_setup+0x80/0x9c)
       r7:00000000 r6:00000002 r5:00000002 r4:00000003
      [<c001a114>] (percpu_timer_setup+0x0/0x9c) from [<c000e9f0>] (smp_prepare_cpus+0xb0/0xe8)
      [<c000e940>] (smp_prepare_cpus+0x0/0xe8) from [<c00084e8>] (kernel_init+0x5c/0x1fc)
       r7:00000000 r6:00000000 r5:00000000 r4:c001b8a4
      [<c000848c>] (kernel_init+0x0/0x1fc) from [<c0046c50>] (do_exit+0x0/0x604)
       r7:00000000 r6:00000000 r5:00000000 r4:00000000
      Signed-off-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      ad001f14
  22. 12 11月, 2009 1 次提交
  23. 21 10月, 2009 1 次提交
    • T
      omap: headers: Move remaining headers from include/mach to include/plat · ce491cf8
      Tony Lindgren 提交于
      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 <mach\/$header"
      	new="#include <plat\/$header"
      	for dir in $omap_dirs; do
      		find $dir -type f -name \*.[chS] | \
      			xargs sed -i "s/$old/$new/"
      	done
      	find drivers/ -type f -name \*omap*.[chS] | \
      		xargs sed -i "s/$old/$new/"
      	for file in $other_files; do
      		sed -i "s/$old/$new/" $file
      	done
      done
      
      for header in $(ls $mach_dir_old/*.h); do
      	git mv $header $plat_dir_new/
      done
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      ce491cf8
  24. 20 10月, 2009 1 次提交
  25. 29 8月, 2009 1 次提交
  26. 09 6月, 2009 1 次提交
  27. 29 5月, 2009 1 次提交
  28. 24 4月, 2009 1 次提交
    • P
      OMAP2/3 GPTIMER: allow system tick GPTIMER to be changed in board-*.c files · f248076c
      Paul Walmsley 提交于
      Add a function omap2_gp_clockevent_set_gptimer() for board-*.c files
      to use in .init_irq functions to configure the system tick GPTIMER.
      Practical choices at this point are GPTIMER1 or GPTIMER12.  Both of
      these timers are in the WKUP powerdomain, and so are unaffected by
      chip power management.  GPTIMER1 can use sys_clk as a source, for
      applications where a high-resolution timer is more important than
      power management.  GPTIMER12 has the special property that it has the
      secure 32kHz oscillator as its source clock, which may be less prone
      to glitches than the off-chip 32kHz oscillator.  But on HS devices, it
      may not be available for Linux use.
      
      It appears that most boards are fine with GPTIMER1, but BeagleBoard
      should use GPTIMER12 when using a 32KiHz timer source, due to hardware bugs
      in revisions B4 and below.  Modify board-omap3beagle.c to use GPTIMER12.
      
      This patch originally used a Kbuild config option to select the GPTIMER,
      but was changed to allow this to be specified in board-*.c files, per
      Tony's request.
      
      Kalle Vallo <kalle.valo@nokia.com> found a bug in an earlier version of
      this patch - thanks Kalle.
      
      Tested on Beagle rev B4 ES2.1, with and without CONFIG_OMAP_32K_TIMER, and
      3430SDP.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Cc: Kalle Valo <kalle.valo@nokia.com>
      f248076c
  29. 22 4月, 2009 1 次提交
  30. 30 1月, 2009 1 次提交
    • A
      ARM: OMAP: gptimer min_delta_ns corrected · df88acbb
      Aaro Koskinen 提交于
      When 32 kHz timer is used the min_delta_ns should be initialized so
      that it reflects the timer programming cost. A write to the timer
      device will be usually posted, but it takes roughly 3 cycles before
      it is effective. If the timer is reprogrammed before that, the CPU
      will stall until the previous write completes. This was pointed out by
      Richard Woodruff.
      
      Since the lower bound for min_delta_ns is 1000, the change is visible
      only with tick rates less than 3 MHz.
      
      Also note that the old value is incorrect for 32 kHz also due to
      a rounding error, and it can cause the timer queue to hang (due to
      clockevent code trying to program the timer with zero ticks).
      Signed-off-by: NAaro Koskinen <Aaro.Koskinen@nokia.com>
      Reviewed-by: NRichard Woodruff <r-woodruff2@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      
      df88acbb
  31. 13 12月, 2008 1 次提交