1. 25 7月, 2014 1 次提交
    • P
      ARM: OMAP2+: clock: allow omap2_dpll_round_rate() to round to next-lowest rate · 0a263444
      Paul Walmsley 提交于
      Change the behavior of omap2_dpll_round_rate() to round to either the
      exact rate requested, or the next lowest rate that the clock is able to
      provide.
      
      This is not an ideal fix, but is intended to provide a relatively safe
      way for drivers to set PLL rates, until a better solution can be
      implemented.
      
      For the time being, omap3_noncore_dpll_set_rate() is still allowed to
      set its rate to something other than what the caller requested; but will
      warn when this occurs.
      
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Mike Turquette <mturquette@linaro.org>
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      0a263444
  2. 16 7月, 2014 2 次提交
  3. 07 6月, 2014 1 次提交
    • A
      ARM: OMAP5+: dpll: support Duty Cycle Correction(DCC) · ce369a54
      Andrii Tseglytskyi 提交于
      Duty Cycle Correction(DCC) needs to be enabled if the MPU is to run at
      frequencies beyond 1.4GHz for OMAP5, DRA75x, DRA72x.
      
      MPU DPLL has a limitation on the maximum frequency it can be locked
      at. Duty Cycle Correction circuit is used to recover a correct duty
      cycle for achieving higher frequencies (hardware internally switches
      output to M3 output(CLKOUTHIF) from M2 output (CLKOUT)).
      
      For further information, See the note on OMAP5432 Technical Reference
      Manual(SWPU282U) chapter 3.6.3.3.1 "DPLLs Output Clocks Parameters",
      and also the "OMAP543x ES2.0 DM Operating Conditions Addendum v0.5"
      chapter 2.1 "Micro Processor Unit (MPU)". Equivalent information is
      present in relevant DRA75x, 72x documentation(SPRUHP2E, SPRUHI2P).
      Signed-off-by: NAndrii Tseglytskyi <andrii.tseglytskyi@ti.com>
      Signed-off-by: NTaras Kondratiuk <taras@ti.com>
      Signed-off-by: NJ Keerthy <j-keerthy@ti.com>
      Signed-off-by: NNishanth Menon <nm@ti.com>
      [t-kristo@ti.com: added TRM / DM references for DCC clock rate]
      Signed-off-by: NTero Kristo <t-kristo@ti.com>
      ce369a54
  4. 01 3月, 2014 1 次提交
  5. 20 2月, 2014 1 次提交
  6. 18 1月, 2014 1 次提交
  7. 01 4月, 2013 1 次提交
    • R
      ARM: OMAP: dpll: enable bypass clock only when attempting dpll bypass · 469d633d
      Rajendra Nayak 提交于
      omap3_noncore_dpll_set_rate() attempts an enable of bypass clk as well
      as ref clk for every .set_rate attempt on a noncore DPLL, regardless of
      whether the .set_rate results in the DPLL being locked or put in bypass.
      Early at boot, while some of these DPLLs are programmed and locked
      (using .set_rate for the DPLL), this causes an ordering issue.
      
      For instance, on OMAP5, the USB DPLL derives its bypass clk from ABE DPLL.
      If a .set_rate of USB DPLL which programmes the M,N and locks it is called
      before the one for ABE, the enable of USB bypass clk (derived from ABE DPLL)
      then attempts to lock the ABE DPLL and fails as the M,N values for ABE
      are yet to be programmed.
      
      To get rid of this ordering needs, enable bypass clk for a DPLL as part
      of its .set_rate only when its being put in bypass, and only enable the
      ref clk when its locked.
      Reported-by: NRoger Quadros <rogerq@ti.com>
      Signed-off-by: NRajendra Nayak <rnayak@ti.com>
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      469d633d
  8. 19 3月, 2013 1 次提交
  9. 01 2月, 2013 1 次提交
  10. 18 12月, 2012 1 次提交
  11. 15 12月, 2012 1 次提交
    • J
      ARM: OMAP4: Enhance support for DPLLs with 4X multiplier · 3ff51ed8
      Jon Hunter 提交于
      On OMAP4 devices, the ABE DPLL has an internal 4X multiplier that can
      be enabled or disabled in addition to the standard configurable
      multiplier (M) for OMAP DPLLs. When configuring the ABE DPLL the 4X
      multiplier is accounted for by checking to see whether it is enabled or
      not. However, when calculating a new rate we only check to see if the
      rate can be achieved with the current setting for the 4X multiplier.
      Enhance the round_rate() function for such DPLLs to see if the rate
      can be achieved with the 4X multiplier if it cannot be achieved without
      the 4X multiplier.
      
      This change is necessary, because when using the 32kHz clock as the
      source clock for the ABE DPLL, the default DPLL frequency for the ABE
      DPLL cannot be achieved without enabling the 4X multiplier.
      
      When using the 32kHz clock as the source clock for the ABE DPLL and
      attempting to lock the DPLL to 98.304MHz (default frequency), it was
      found that the DPLL would fail to lock if the low-power mode for the DPLL
      was not enabled. From reviewing boot-loader settings that configure the
      ABE DPLL it was found that the low-power mode is enabled when using the
      32kHz clock source, however, the documentation for OMAP does not state
      that this is a requirement. Therefore, introduce a new function for
      OMAP4 devices to see if low-power mode can be enabled when calculating a
      new rate to ensure the DPLL will lock.
      
      New variables for the last calculated 4X multiplier and low-power
      setting have been added to the dpll data structure as well as variables
      defining the bit mask for enabling these features via the DPLL's
      control_reg. It is possible that we could eliminate these bit masks from
      the dpll data structure as these bit masks are not unique to OMAP4, if
      it is preferred.
      
      The function omap3_noncore_program_dpll() has been updated to avoid
      passing the calculated values for the multiplier (M) and divider (N) as
      these are stored in the clk structure.
      Signed-off-by: NJon Hunter <jon-hunter@ti.com>
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      3ff51ed8
  12. 13 11月, 2012 2 次提交
    • P
      ARM: OMAP3+: DPLL: drop !CONFIG_COMMON_CLK sections · 455db9c9
      Paul Walmsley 提交于
      Remove all of the code that is compiled when CONFIG_COMMON_CLK=n in the
      OMAP3+ DPLL handling code.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Mike Turquette <mturquette@ti.com>
      Cc: Rajendra Nayak <rnayak@ti.com>
      455db9c9
    • M
      ARM: OMAP4: clock: Convert to common clk · 32cc0021
      Mike Turquette 提交于
      Convert all OMAP4 specific platform files to use COMMON clk
      and keep all the changes under the CONFIG_COMMON_CLK macro check
      so it does not break any existing code. At a later point switch
      to COMMON clk and get rid of all old/legacy code.
      
      This converts all apis which will be called directly from COMMON
      clk to take a struct clk_hw parameter, and all the internal platform
      apis to take a struct clk_hw_omap parameter.
      
      Changes are based off the original patch from Mike Turquette.
      Signed-off-by: NRajendra Nayak <rnayak@ti.com>
      [paul@pwsan.com: created new omap2_clksel_find_parent_index() rather than
       modifying omap2_init_clksel_parent(); moved clkhwops_iclk_wait to
       clkt_iclk.c to fix OMAP4-only builds; added clk-provider.h include to clock.h
       to try to fix some 3430-builds]
      [mturquette@ti.com: squash patch for omap2_clkops_{en,dis}able_clkdm;
       omap2_dflt_clk_is_enabled should not enable clocks]
      Signed-off-by: NMike Turquette <mturquette@ti.com>
      [paul@pwsan.com: fix compiler warning; update to apply; added kerneldoc on
       non-trivial new functions; added the dpll3xxx clockdomain modifications]
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      32cc0021
  13. 19 10月, 2012 1 次提交
  14. 23 9月, 2012 1 次提交
    • R
      ARM: OMAP2+: clock: Remove all direct dereferencing of struct clk · 5dcc3b97
      Rajendra Nayak 提交于
      While we move to Common Clk Framework (CCF), direct deferencing of struct
      clk wouldn't be possible anymore. Hence get rid of all such instances
      in the current clock code and use macros/helpers similar to the ones that
      are provided by CCF.
      
      While here also concatenate some strings split across multiple lines
      which seem to be needed anyway.
      Signed-off-by: NRajendra Nayak <rnayak@ti.com>
      [paul@pwsan.com: simplified some compound expressions; reformatted some
       messages]
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Mike Turquette <mturquette@linaro.org>
      5dcc3b97
  15. 13 9月, 2012 2 次提交
    • T
      ARM: OMAP: Split plat/hardware.h, use local soc.h for omap2+ · dbc04161
      Tony Lindgren 提交于
      As the plat and mach includes need to disappear for single zImage work,
      we need to remove plat/hardware.h.
      
      Do this by splitting plat/hardware.h into omap1 and omap2+ specific files.
      
      The old plat/hardware.h already has omap1 only defines, so it gets moved
      to mach/hardware.h for omap1. For omap2+, we use the local soc.h
      that for now just includes the related SoC headers to keep this patch more
      readable.
      
      Note that the local soc.h still includes plat/cpu.h that can be dealt
      with in later patches. Let's also include plat/serial.h from common.h for
      all the board-*.c files. This allows making the include files local later
      on without patching these files again.
      
      Note that only minimal changes are done in this patch for the
      drivers/watchdog/omap_wdt.c driver to keep things compiling. Further
      patches are needed to eventually remove cpu_is_omap usage in the drivers.
      
      Also only minimal changes are done to sound/soc/omap/* to remove the
      unneeded includes and to define OMAP44XX_MCPDM_L3_BASE locally so there's
      no need to include omap44xx.h.
      
      While at it, also sort some of the includes in the standard way.
      
      Cc: linux-watchdog@vger.kernel.org
      Cc: alsa-devel@alsa-project.org
      Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
      Cc: Jarkko Nikula <jarkko.nikula@bitmer.com>
      Cc: Liam Girdwood <lrg@ti.com>
      Acked-by: NWim Van Sebroeck <wim@iguana.be>
      Acked-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      dbc04161
    • V
      ARM: OMAP2+: dpll: Add missing soc_is_am33xx() check for common functions · 78da2640
      Vaibhav Hiremath 提交于
      Add missing soc_is_am33xx() check for DPLL common control & clock
      related functions, without this dpll programmability would be broken
      for am33xx family of devices.
      Signed-off-by: NVaibhav Hiremath <hvaibhav@ti.com>
      Cc: Rajendra Nayak <rnayak@ti.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      78da2640
  16. 12 9月, 2012 1 次提交
    • P
      ARM: OMAP: clean up some smatch warnings, fix some printk(KERN_ERR ... · a032d33b
      Paul Walmsley 提交于
      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: NPaul Walmsley <paul@pwsan.com>
      Cc: Tony Lindgren <tony@atomide.com>
      a032d33b
  17. 05 7月, 2012 1 次提交
  18. 04 7月, 2012 1 次提交
  19. 08 5月, 2012 1 次提交
  20. 07 10月, 2011 3 次提交
    • J
      ARM: OMAP3+: dpll: use DPLLs recalc function instead of omap2_get_dpll_rate · 49642ac8
      Jon Hunter 提交于
      This is a continuation of Mike Turquette's patch "OMAP3+: use
      DPLL's round_rate when setting rate".
      
      omap3_noncore_dpll_set_rate() and omap3_noncore_dpll_enable() call
      omap2_get_dpll_rate() explicitly. It may be necessary for some
      DPLLs to use a different function and so use the DPLLs recalc()
      function pointer instead.
      
      An example is the DPLL_ABE on OMAP4 which can have a 4X multiplier
      in addition to the usual MN multipler and dividers and therefore
      uses a different round_rate and recalc function.
      Signed-off-by: NJon Hunter <jon-hunter@ti.com>
      Cc: Mike Turquette <mturquette@ti.com>
      Cc: Misael Lopez Cruz <misael.lopez@ti.com>
      [paul@pwsan.com: merged this patch with Mike's "use clock's recalc in DPLL
       handling" patch; also reported by Misael]
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      49642ac8
    • M
      ARM: OMAP3+: dpll: assign clk rate from rounded rate during rate set · 273a1ce9
      Mike Turquette 提交于
      The rounded rate can differ from target rate, so to better reflect
      reality set clk->rate equal to the rounded rate when setting DPLL frequency.
      This avoids issues where the DPLL frequency is slightly different than what
      debugfs clock tree reports using the old target rate.
      
      An example of a clock that requires this is DPLL_ABE on OMAP4 which
      can have a 4x multiplier on top of the usual MN dividers depending on
      register settings.  This requires a special round_rate function that
      might yield a rate different from the initial target.
      Signed-off-by: NMike Turquette <mturquette@ti.com>
      Signed-off-by: NJon Hunter <jon-hunter@ti.com>
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      273a1ce9
    • M
      ARM: OMAP3+: dpll: use DPLL's round_rate when setting rate · addf888c
      Mike Turquette 提交于
      omap3_noncore_dpll_set_rate uses omap2_dpll_round_rate explicitly.  Instead
      use the struct clk pointer's round_rate function to allow for DPLL's with
      special needs.
      
      An example of a clock that requires this is DPLL_ABE on OMAP4 which
      can have a 4x multiplier on top of the usual MN dividers depending on
      register settings.  This requires a special round_rate function that
      might yield a rate different from the initial target.
      Signed-off-by: NMike Turquette <mturquette@ti.com>
      Signed-off-by: NJon Hunter <jon-hunter@ti.com>
      [paul@pwsan.com: split rate assignment portion into a separate patch]
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      addf888c
  21. 22 12月, 2010 2 次提交
    • J
      OMAP: clock: fix configuration of J-Type DPLLs to work for OMAP3 and OMAP4 · a36795c1
      Jon Hunter 提交于
      J-Type DPLLs have additional configuration parameters that need to
      be programmed when setting the multipler and divider for the DPLL.
      These parameters being the sigma delta divider (SD_DIV) for the DPLL
      and the digital controlled oscillator (DCO) to be used by the DPLL.
      
      The current code is implemented specifically to configure the
      OMAP3630 PER J-Type DPLL. The OMAP4430 USB DPLL is also a J-Type DPLL
      and so this code needs to be updated to work for both OMAP3 and OMAP4
      devices and any other future devices that have J-TYPE DPLLs.
      
      For the OMAP3630 PER DPLL both the SD_DIV and DCO paramenters are
      used but for the OMAP4430 USB DPLL only the SD_DIV field is used.
      The current implementation will only program the SD_DIV and DCO
      fields if the DPLL has both and hence this does not work for
      OMAP4430.
      
      In order to make the code more generic add two new fields to the
      dpll_data structure for the SD_DIV field and DCO field bit-masks
      and only program these fields if the masks are defined for a specific
      DPLL. This simplifies the code and allows us to remove the flag
      DPLL_NO_DCO_SEL.
      
      Tested on OMAP36xx Zoom3 and OMAP4 Blaze.
      Signed-off-by: NJon Hunter <jon-hunter@ti.com>
      [paul@pwsan.com: removed explicit inlining and added '_' prefix on lookup_*()
       functions; added testing info to commit message; added 35xx comments back in]
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      a36795c1
    • P
      OMAP2/3: PRCM: split OMAP2/3-specific PRCM code into OMAP2/3-specific files · 59fb659b
      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 <felipe.contreras@gmail.com> for comments on this
      patch.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Jarkko Nikula <jhnikula@gmail.com>
      Cc: Peter Ujfalusi <peter.ujfalusi@nokia.com>
      Cc: Liam Girdwood <lrg@slimlogic.co.uk>
      Cc: Omar Ramirez Luna <omar.ramirez@ti.com>
      Acked-by: NOmar Ramirez Luna <omar.ramirez@ti.com>
      Cc: Felipe Contreras <felipe.contreras@gmail.com>
      Acked-by: NFelipe Contreras <felipe.contreras@gmail.com>
      Cc: Greg Kroah-Hartman <greg@kroah.com>
      Acked-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Reviewed-by: NKevin Hilman <khilman@deeprootsystems.com>
      Tested-by: NKevin Hilman <khilman@deeprootsystems.com>
      Tested-by: NRajendra Nayak <rnayak@ti.com>
      Tested-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
      59fb659b
  22. 26 11月, 2010 1 次提交
  23. 17 6月, 2010 1 次提交
  24. 25 2月, 2010 3 次提交
    • P
      OMAP2/3/4 clock: fix DPLL multiplier value errors; also copyrights, includes, documentation · 93340a22
      Paul Walmsley 提交于
      The maximum DPLL multiplier (M) values for OMAP2xxx and OMAP3xxx are
      one increment higher than they should be.  See for example the
      OMAP242x TRM Rev X Section 5.10.6 "Clock Generator Registers" and the
      OMAP36xx TRM Rev C Table 3-202 "CM_CLKSEL1_PLL".  Programming a 0 into
      the DPLL's M register bitfield is valid for OMAP2/3 and indicates that
      the DPLL should enter MN-bypass mode.  Also, increase the minimum
      multiplier (M) value for the DPLL rate rounding code from 1 to 2, to
      ensure that it does not inadvertently put the DPLL into bypass.
      
      Note that the register documentation in the OMAP2xxx and OMAP3xxx TRMs
      does not make clear that the actual DPLL divider value (the "N") is
      the content of the appropriate register bitfield for the N value,
      _plus one_.  (In other words, an N register bitfield of 0 indicates a
      DPLL divider value of 1.)  This is only clearly documented in the
      OMAP4430 TRM, in, for example, OMAP4430 TRM Rev A Table 3-1167
      "CM_CLKSEL_DPLL_USB".
      
      While here, update copyrights, add kerneldoc for struct dpll_data,
      drop the unused struct dpll_data.max_tolerance field, remove some
      unnecessary #includes in DPLL-related code, and replace the #include
      of <linux/module.h> with <linux/list.h>, which is what was really
      needed.  The OMAP4 clock autogenerator script has been updated
      accordingly.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Benoît Cousson <b-cousson@ti.com>
      Cc: Rajendra Nayak <rnayak@ti.com>
      93340a22
    • R
      OMAP3 clock: introduce DPLL4 Jtype · 358965d7
      Richard Woodruff 提交于
      DPLL4 for 3630 introduces a changed block called j type dpll, requiring
      special divisor bits and additional reg fields. To allow for silicons to
      use this, this is introduced as a flag and is enabled for 3630 silicon.
      OMAP4 also has j type dpll for usb.
      
      Tested with 3630 ZOOM3 and OMAP3430 ZOOM2
      Signed-off-by: NRichard Woodruff <r-woodruff2@ti.com>
      Signed-off-by: NNishanth Menon <nm@ti.com>
      Signed-off-by: NVishwanath BS <Vishwanath.bs@ti.com>
      [paul@pwsan.com: added some comments; updated copyrights and credits; fixed
       some style issues]
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      358965d7
    • V
      OMAP3 clock: Remove FreqSel for 3630 · 5eb75f55
      Vishwanath BS 提交于
      DPLL_FREQSEL field in CLKEN_PLL register is no longer valid for
      OMAP3630. So remove references to that.
      Signed-off-by: NVishwanath BS <vishwanath.bs@ti.com>
      Cc: Sergei Shtylyov <sshtylyov@mvista.com>
      [paul@pwsan.com: added comment fix from Sergei Shtylyov]
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      5eb75f55
  25. 30 1月, 2010 1 次提交
  26. 27 1月, 2010 1 次提交
  27. 12 12月, 2009 5 次提交
  28. 09 12月, 2009 1 次提交