1
linux/arch/arm/mach-omap2
Paul Walmsley 88b8ba9057 ARM: OMAP2: Clock: New OMAP2/3 DPLL rate rounding algorithm
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: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2008-07-03 12:24:46 +03:00
..
board-2430sdp.c ARM: OMAP: Add calls to omap2_set_globals_*() 2008-05-09 10:25:02 -07:00
board-apollon.c ARM: OMAP: Add calls to omap2_set_globals_*() 2008-05-09 10:25:02 -07:00
board-generic.c ARM: OMAP: Add calls to omap2_set_globals_*() 2008-05-09 10:25:02 -07:00
board-h4.c ARM: OMAP: Add calls to omap2_set_globals_*() 2008-05-09 10:25:02 -07:00
clock24xx.c ARM: OMAP2: Clock: New OMAP2/3 DPLL rate rounding algorithm 2008-07-03 12:24:46 +03:00
clock24xx.h ARM: OMAP2: Clock: New OMAP2/3 DPLL rate rounding algorithm 2008-07-03 12:24:46 +03:00
clock34xx.c ARM: OMAP2: Clock: Add OMAP3 DPLL autoidle functions 2008-07-03 12:24:45 +03:00
clock34xx.h ARM: OMAP2: Clock: New OMAP2/3 DPLL rate rounding algorithm 2008-07-03 12:24:46 +03:00
clock.c ARM: OMAP2: Clock: New OMAP2/3 DPLL rate rounding algorithm 2008-07-03 12:24:46 +03:00
clock.h ARM: OMAP2: Clock: New OMAP2/3 DPLL rate rounding algorithm 2008-07-03 12:24:46 +03:00
cm-regbits-24xx.h ARM: OMAP2: Add common register access for 24xx and 34xx 2008-04-14 10:27:25 -07:00
cm-regbits-34xx.h ARM: OMAP2: Clock: Add OMAP3 DPLL autoidle functions 2008-07-03 12:24:45 +03:00
cm.h ARM: OMAP2: Clock: Add OMAP3 DPLL autoidle functions 2008-07-03 12:24:45 +03:00
control.c ARM: OMAP: Introduce omap_globals and prcm access functions for multi-omap 2008-07-03 12:24:44 +03:00
devices.c ARM: OMAP: Add minimal OMAP2430 support 2007-09-20 09:59:20 -07:00
gpmc.c ARM: OMAP: Correcting the gpmc prefetch control register address 2008-06-06 15:44:12 -07:00
id.c ARM: OMAP: Add OMAP chip type structure; clean up mach-omap2/id.c 2008-07-03 12:24:45 +03:00
io.c ARM: OMAP2: Register the L4 io bus to boot OMAP2 2008-03-06 13:28:06 +02:00
irq.c ARM: OMAP: Optimize INTC register accesses and enable autoidling 2007-09-20 09:59:19 -07:00
Kconfig ARM: OMAP: Add minimal OMAP2430 support 2007-09-20 09:59:20 -07:00
mailbox.c ARM: OMAP: Fix Unbalanced enable for IRQ in omap mailbox 2008-05-09 10:25:03 -07:00
Makefile ARM: OMAP: McBSP: Add support for mcbsp on mach-omap2 2008-07-03 12:24:40 +03:00
Makefile.boot
mcbsp.c ARM: OMAP: McBSP: Add support for mcbsp on mach-omap2 2008-07-03 12:24:40 +03:00
memory.c ARM: OMAP: Introduce omap_globals and prcm access functions for multi-omap 2008-07-03 12:24:44 +03:00
memory.h ARM: OMAP2: Change 24xx to use shared clock code and new reg access 2008-04-14 10:29:38 -07:00
mux.c ARM: OMAP: Introduce omap_globals and prcm access functions for multi-omap 2008-07-03 12:24:44 +03:00
pm.c ARM: OMAP2: Remove old 24xx PM code 2008-04-14 10:29:37 -07:00
prcm-common.h ARM: OMAP: SRAM: Split sram24xx.S into sram242x.S and sram243x.S 2008-07-03 12:24:38 +03:00
prcm.c ARM: OMAP: Turn CM and PRM access into functions 2008-07-03 12:24:44 +03:00
prm-regbits-24xx.h ARM: OMAP2: Add common register access for 24xx and 34xx 2008-04-14 10:27:25 -07:00
prm-regbits-34xx.h ARM: OMAP2: Add register access for 34xx 2008-04-14 10:29:37 -07:00
prm.h ARM: OMAP: Turn CM and PRM access into functions 2008-07-03 12:24:44 +03:00
sdrc.h ARM: OMAP: Introduce omap_globals and prcm access functions for multi-omap 2008-07-03 12:24:44 +03:00
serial.c
sleep.S ARM: OMAP2: Change 24xx to use new register access 2008-04-14 10:29:37 -07:00
sram242x.S ARM: OMAP: SRAM: Split sram24xx.S into sram242x.S and sram243x.S 2008-07-03 12:24:38 +03:00
sram243x.S ARM: OMAP: SRAM: Split sram24xx.S into sram242x.S and sram243x.S 2008-07-03 12:24:38 +03:00
timer-gp.c ARM: OMAP: DMTimer: Optimize by adding load and start 2008-07-03 12:24:30 +03:00
usb-tusb6010.c ARM: OMAP: TUSB EVM init 2007-09-20 09:59:21 -07:00