1. 25 2月, 2010 6 次提交
    • P
      OMAP2 clock: split OMAP2420, OMAP2430 clock data into their own files · 81b34fbe
      Paul Walmsley 提交于
      In preparation for multi-OMAP2 kernels, split
      mach-omap2/clock2xxx_data.c into mach-omap2/clock2420_data.c and
      mach-omap2/clock2430_data.c.  2430 uses a different device space
      physical memory layout than past or future OMAPs, and we use a
      different virtual memory layout as well, which causes trouble for
      architecture-level code/data that tries to support both.  We tried
      using offsets from the virtual base last year, but those patches never
      made it upstream; so after some discussion with Tony about the best
      all-around approach, we'll just grit our teeth and duplicate the
      structures.  The maintenance advantages of a single kernel config that
      can compile and boot on OMAP2, 3, and 4 platforms are simply too
      compelling.
      
      This approach does have some nice benefits beyond multi-OMAP 2 kernel
      support.  The runtime size of OMAP2420-specific and OMAP2430-specific
      kernels is smaller, since unused clocks for the other OMAP2 chip will
      no longer be compiled in.  (At some point we will mark the clock data
      __initdata and allocate it during registration, which will eliminate
      the runtime memory advantage.)  It also makes the clock trees slightly
      easier to read, since 2420-specific and 2430-specific clocks are no
      longer mixed together.
      
      This patch also splits 2430-specific clock code into its own file,
      mach-omap2/clock2430.c, which is only compiled in for 2430 builds -
      mostly for organizational clarity.
      
      While here, fix a bug in the OMAP2430 clock tree: "emul_ck" was
      incorrectly marked as being 2420-only, when actually it is present on
      both OMAP2420 and OMAP2430.
      
      Thanks to Tony for some good discussions about how to approach this
      problem.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Richard Woodruff <r-woodruff2@ti.com>
      81b34fbe
    • P
      OMAP clock: drop .id field; ensure each clock has a unique name · b92c170d
      Paul Walmsley 提交于
      After the clkdev conversion, the struct clk.id field became
      superfluous, so, drop it.  Bring the clock names closer to the TRMs
      and ensure they are unique for debugfs.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      b92c170d
    • P
      OMAP2 clock: drop CONFIG_PARTICIPANT clock flag · 1a337717
      Paul Walmsley 提交于
      It turns out that the only purpose of the CONFIG_PARTICIPANT clock
      flag is to prevent omap2_clk_set_rate() and omap2_clk_set_parent()
      from being executed on clocks with that flag set.  The rate-changing
      component can be more directly accomplished by dropping the .set_rate
      and .round_rate function pointers from those CONFIG_PARTICIPANT struct
      clks.  As far as the parent-changing component is concerned, it turns
      out that none of the CONFIG_PARTICIPANT clocks have multiple parent
      choices, so all that is necessary is for omap2_clk_set_parent() to
      bail out early if the new parent is equal to the old parent.
      Implement this change and get rid of the flag, which has always had a
      confusing name (it appears to be a Kconfig option, falsely).
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Richard Woodruff <r-woodruff2@ti.com>
      1a337717
    • P
      OMAP2xxx clock: drop DELAYED_APP flag from non-clksel clocks · 17d09273
      Paul Walmsley 提交于
      The DELAYED_APP flag is effective only with clksel clocks, so drop it from
      clocks that are not rate-changeable or that use non-clksel rate changing code
      (e.g., virt_prcm_set).
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Richard Woodruff <r-woodruff2@ti.com>
      17d09273
    • P
      OMAP2xxx clock: GFX functional clock rates are not independently changeable · 94297784
      Paul Walmsley 提交于
      According to the OMAP242x TRM Rev X Figure 5-15 "Clock Output Control
      - Functional Clocks 2", the GFX functional clocks should be marked
      both DELAYED_APP and CONFIG_PARTICIPANT, meaning that their rates must
      be reprogrammed as part of a larger OPP set change.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Richard Woodruff <r-woodruff2@ti.com>
      94297784
    • 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
  2. 30 1月, 2010 1 次提交
    • P
      OMAP2/3/4 clock: rename and clean the omap2_clk_init() functions · e80a9729
      Paul Walmsley 提交于
      Rename the omap2_clk_init() in the OMAP2, 3, and 4 clock code to be
      omap2xxx_clk_init(), omap3xxx_clk_init(), etc.  Remove all traces of
      the (commented) old virt_prcm_set code from omap3xxx_clk_init() and
      omap4xxx_clk_init(), since this will be handled with the OPP code that
      is cooking in the PM branch.
      
      After this patch, there should be very little else in the clock code
      that blocks a multi-OMAP 2+3 kernel.  (OMAP2420+OMAP2430 still has some
      outstanding issues that need to be resolved; this is pending on some
      additions to the hwmod data.)
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      e80a9729
  3. 29 1月, 2010 1 次提交
    • P
      OMAP2xxx clock: move sys_clk code into mach-omap2/clkt2xxx_sys.c · 44da0a51
      Paul Walmsley 提交于
      Move the sys_clk clock functions from clock2xxx.c to
      mach-omap2/clkt2xxx_sys.c.  This is intended to make the clock code
      easier to understand, since all of the functions needed to manage the
      sys_clk are now located in their own file, rather than being mixed
      with other, unrelated functions.
      
      Clock debugging is also now more finely-grained, since the DEBUG
      macro can now be defined for the sys_clk clock alone.  This
      should reduce unnecessary console noise when debugging.
      
      Also, if at some future point the mach-omap2/ directory is split into
      OMAP2/3/4 variants, this clkt file can be placed in the mach-omap2xxx/
      directory, rather than shared with other chip types that don't use
      this clock type.
      
      Thanks to Alexander Shishkin <virtuoso@slind.org> for his comments to
      improve the patch description.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Alexander Shishkin <virtuoso@slind.org>
      44da0a51
  4. 27 1月, 2010 1 次提交
  5. 12 12月, 2009 2 次提交
    • P
      OMAP2 clock: convert clock24xx.h to clock2xxx_data.c, opp2xxx* · d8a94458
      Paul Walmsley 提交于
      The OMAP2 clock code currently #includes a large .h file full of static
      data structures.  Instead, define the data in a .c file.
      
      Russell King <linux@arm.linux.org.uk> proposed this new arrangement:
      
          http://marc.info/?l=linux-omap&m=125967425908895&w=2
      
      This patch also deals with most of the flagrant checkpatch violations.
      
      While here, separate the prcm_config data structures out into their own
      files, opp2xxx.h and opp24{2,3}0_data.c, and only build in the OPP tables
      for the target device.  This should save some memory.  In the long run,
      these prcm_config tables should be replaced with OPP code.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Richard Woodruff <r-woodruff2@ti.com>
      Cc: Nishanth Menon <nm@ti.com>
      d8a94458
    • P
      OMAP2 clock: APLL code shouldn't rely on static clocks in its local namespace · 06b16939
      Paul Walmsley 提交于
      Similar to the previous patch, the APLL code relied on the presence of the
      static struct clks in its own namespace.  The APLL code didn't use them for
      validation, however - it adjusted its own internal state depending on
      the struct clk * that called it.  Now that static struct clks are
      leaving the clock24xx.c namespace, use a more durable method: split the
      omap2_clk_fixed_enable() function into omap2_clk_apll96_enable() and
      omap2_clk_apll54_enable().  They still share a disable function.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      06b16939
  6. 25 7月, 2009 1 次提交
    • P
      OMAP2 clock: 2430 I2CHS uses non-standard CM_IDLEST register · 3dc21975
      Paul Walmsley 提交于
      OMAP2430 I2CHS CM_IDLEST bits are in CM_IDLEST1_CORE, but the CM_*CLKEN bits
      are in CM_{I,F}CLKEN2_CORE [1].  Fix by implementing a custom clkops
      .find_idlest function to return the correct slave IDLEST register.
      
      ...
      
      1. OMAP2430 Multimedia Device Package-on-Package (POP) Silicon Revision 2.1
         (Rev. V) Technical Reference Manual, tables 4-99 and 4-105.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      3dc21975
  7. 26 5月, 2009 4 次提交
  8. 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
  9. 20 2月, 2009 1 次提交
    • R
      [ARM] omap: add support for bypassing DPLLs · c0bf3132
      Russell King 提交于
      This roughly corresponds with OMAP commits: 7d06c48, 3241b19,
      88b5d9b, 18a5500, 9c909ac, 5c6497b, 8b1f0bd, 2ac1da8.
      
      For both OMAP2 and OMAP3, we note the reference and bypass clocks in
      the DPLL data structure.  Whenever we modify the DPLL rate, we first
      ensure that both the reference and bypass clocks are enabled.  Then,
      we decide whether to use the reference and DPLL, or the bypass clock
      if the desired rate is identical to the bypass rate, and program the
      DPLL appropriately.  Finally, we update the clock's parent, and then
      disable the unused clocks.
      
      This keeps the parents correctly balanced, and more importantly ensures
      that the bypass clock is running whenever we reprogram the DPLL.  This
      is especially important because the procedure for reprogramming the DPLL
      involves switching to the bypass clock.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      c0bf3132
  10. 14 2月, 2009 1 次提交
    • R
      [ARM] omap: arrange for clock recalc methods to return the rate · 8b9dbc16
      Russell King 提交于
      linux-omap source commit 33d000c99ee393fe2042f93e8422f94976d276ce
      introduces a way to "dry run" clock changes before they're committed.
      However, this involves putting logic to handle this into each and
      every recalc function, and unfortunately due to the caching, led to
      some bugs.
      
      Solve both of issues by making the recalc methods always return the
      clock rate for the clock, which the caller decides what to do with.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      8b9dbc16
  11. 09 2月, 2009 5 次提交
  12. 08 2月, 2009 5 次提交
  13. 02 2月, 2009 2 次提交
  14. 11 12月, 2008 1 次提交
    • T
      omap mmc: Add better MMC low-level init · d8874665
      Tony Lindgren 提交于
      This will simplify the MMC low-level init, and make it more
      flexible to add support for a newer MMC controller in the
      following patches.
      
      The patch rearranges platform data and gets rid of slot vs
      controller confusion in the old data structures. Also fix
      device id numbering in the clock code.
      
      Some code snippets are based on an earlier patch by
      Russell King <linux@arm.linux.org.uk>.
      
      Cc: Pierre Ossman <drzeus-mmc@drzeus.cx>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      
      
      
      
      
      d8874665
  15. 22 11月, 2008 1 次提交
  16. 19 8月, 2008 1 次提交
  17. 03 7月, 2008 2 次提交
    • P
      ARM: OMAP2: Clock: New OMAP2/3 DPLL rate rounding algorithm · 88b8ba90
      Paul Walmsley 提交于
      This patch adds a new rate rounding algorithm for DPLL clocks on the
      OMAP2/3 architecture.
      
      For a desired DPLL target rate, there may be several
      multiplier/divider (M, N) values which will generate a sufficiently
      close rate.  Lower N values result in greater power economy.  However,
      lower N values can cause the difference between the rounded rate and
      the target rate ("rate error") to be larger than it would be with a
      higher N.  This can cause downstream devices to run more slowly than
      they otherwise would.
      
      This DPLL rate rounding algorithm:
      
      - attempts to find the lowest possible N (DPLL divider) to reach the
        target_rate (since, according to Richard Woodruff <r-woodruff@ti.com>,
        lower N values save more power than higher N values).
      
      - allows developers to set an upper bound on the error between the
        rounded rate and the desired target rate ("rate tolerance"), so an
        appropriate balance between rate fidelity and power savings can be
        set.  This maximum rate error tolerance is set via
        omap2_set_dpll_rate_tolerance().
      
      - never returns a rounded rate higher than the target rate.
      
      The rate rounding algorithm caches the last rounded M, N, and rate
      computation to avoid rounding the rate twice for each clk_set_rate()
      call.  (This patch does not yet implement set_rate for DPLLs; that
      follows in a future patch.)
      
      The algorithm trades execution speed for rate accuracy.  It will find
      the (M, N) set that results in the least rate error, within a
      specified rate tolerance.  It does this by evaluating each divider
      setting - on OMAP3, this involves 128 steps.  Another approach to DPLL
      rate rounding would be to bail out as soon as a valid rate is found
      within the rate tolerance, which would trade rate accuracy for
      execution speed.  Alternate implementations welcome.
      
      This code is not yet used by the OMAP24XX DPLL clock, since it
      is currently defined as a composite clock, fusing the DPLL M,N and the
      M2 output divider.  This patch also renames the existing OMAP24xx DPLL
      programming functions to highlight that they program both the DPLL and
      the DPLL's output multiplier.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      88b8ba90
    • E
      ARM: OMAP: McBSP: Add support for mcbsp on mach-omap1 · 44ec9a33
      Eduardo Valentin 提交于
      This patch adds support for mach-omap1 based on current
      mcbsp platform driver.
      Signed-off-by: NEduardo Valentin <eduardo.valentin@indt.org.br>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      44ec9a33
  18. 15 4月, 2008 4 次提交