summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/clkt_dpll.c
AgeCommit message (Collapse)AuthorFilesLines
2015-06-02clk: ti: move generic OMAP DPLL implementation under drivers/clkTero Kristo1-370/+0
With the legacy clock data now gone, we can start moving OMAP clock type implementations under clock driver. Start this with moving the generic OMAP DPLL clock type under TI clock driver. Signed-off-by: Tero Kristo <t-kristo@ti.com>
2015-06-02ARM: OMAP2+: clock: export driver API to setup/get clock featuresTero Kristo1-7/+7
As most of the clock driver support code is going to be moved under drivers/clk/ti, an API for setting / getting the SoC specific clock features is needed. This patch provides this API and changes the existing code to use it. Signed-off-by: Tero Kristo <t-kristo@ti.com>
2014-08-09Merge tag 'omap-for-v3.17/soc-fixes' of ↵Olof Johansson1-7/+21
git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes Merge "few omap fixes for v3.17 merge window" from Tony Lindgren: Few fixes for the v3.17 merge window: - Fix for DPLL rate rounding - Fix for omap3 ES3.1.2 suspend - Few coding style fixes * tag 'omap-for-v3.17/soc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: OMAP3: Fix coding style problems in arch/arm/mach-omap2/control.c ARM: OMAP3: Fix choice of omap3_restore_es function in OMAP34XX rev3.1.2 case. ARM: OMAP2+: clock: allow omap2_dpll_round_rate() to round to next-lowest rate Signed-off-by: Olof Johansson <olof@lixom.net>
2014-07-29Merge tag 'for-v3.17/omap-clock-b' of ↵Tony Lindgren1-7/+21
git://git.kernel.org/pub/scm/linux/kernel/git/pjw/omap-pending into omap-for-v3.17/soc Modify OMAP PLL rate rounding function to round to the exact rate requested or the next one below it. This is intended to resolve some DSS problems. Basic build, boot, and PM test results are available here: http://www.pwsan.com/omap/testlogs/clock-b-v3.17/20140725061121/
2014-07-25ARM: OMAP2+: clock: allow omap2_dpll_round_rate() to round to next-lowest ratePaul Walmsley1-7/+21
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: Paul Walmsley <paul@pwsan.com>
2014-07-21Merge tag 'omap-for-v3.17/soc-cleanup' of ↵Olof Johansson1-53/+45
git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/cleanup Merge "omap soc clean-up for v3.17 merge window" from Tony Lindgren: SoC specific omap clean-up for v3.17 merge window: - Changes to PRM and clock related code to help move things to drivers - Removal of unused ctrl module defines that no longer are needed with things moving to .dts files and drivers * tag 'omap-for-v3.17/soc-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: (23 commits) ARM: OMAP2+: clock/interface: remove some headers from clkt_iclk.c file ARM: OMAP2+: clock/dpll: remove unused header includes from dpll3xxx.c ARM: OMAP2+: clock/dpll: remove unused header includes from clkt_dpll.c ARM: OMAP2+: clock/interface: add a clk_features definition for idlest value ARM: OMAP2+: clock/dpll: add jitter correction behind clk_features ARM: OMAP2+: clock/dpll: convert bypass check to use clk_features ARM: OMAP2+: clock/dpll: add private API for checking if DPLL is in bypass ARM: OMAP2+: clock: add fint values to the ti_clk_features struct ARM: OMAP2+: clock: introduce ti_clk_features flags ARM: OMAP4+: dpll44xx: remove cm-regbits-44xx.h and clock44xx.h includes ARM: OMAP4+: dpll: remove cpu_is_omap44xx checks ARM: OMAP4+: clock: remove DEFINE_CLK_OMAP_HSDIVIDER macro ARM: OMAP4: Ctrl module register define diet ARM: OMAP3: control: isolate control module init to its own function ARM: OMAP3: PRM: move modem reset and iva2 idle to PRM driver ARM: OMAP3: control: add API for setting up the modem pads ARM: OMAP3: PRM: move PRM init code from PM core to the driver ARM: OMAP24xx: PRM: add API for clearing wakeup status bits ARM: OMAP3: PRM: add API for saving PRM scratchpad contents ARM: OMAP3: PRM: add API for checking and clearing cold reset status ... Signed-off-by: Olof Johansson <olof@lixom.net>
2014-07-15ARM: OMAP2+: clock/dpll: remove unused header includes from clkt_dpll.cTero Kristo1-3/+0
Some of the machine specific header includes are no longer used, so remove these from the source file. This allows migration of the file under clock driver. Signed-off-by: Tero Kristo <t-kristo@ti.com> Reviewed-by: Mike Turquette <mturquette@linaro.org> Signed-off-by: Paul Walmsley <paul@pwsan.com>
2014-07-15ARM: OMAP2+: clock/dpll: convert bypass check to use clk_featuresTero Kristo1-12/+13
OMAP2 DPLL code for checking whether DPLL is in bypass mode now uses clk_features data provided during boot. This avoids the need to use cpu_is_X type checks runtime, and allows us to eventually move the clock code under the clock driver. Signed-off-by: Tero Kristo <t-kristo@ti.com> Reviewed-by: Mike Turquette <mturquette@linaro.org> Signed-off-by: Paul Walmsley <paul@pwsan.com>
2014-07-15ARM: OMAP2+: clock/dpll: add private API for checking if DPLL is in bypassTero Kristo1-28/+32
Currently, same functionality is copy pasted in two locations. Instead, add a private API for this and get rid of some duplicated code. Signed-off-by: Tero Kristo <t-kristo@ti.com> Reviewed-by: Mike Turquette <mturquette@linaro.org> Signed-off-by: Paul Walmsley <paul@pwsan.com>
2014-07-15ARM: OMAP2+: clock: add fint values to the ti_clk_features structTero Kristo1-22/+12
These are SoC specific and get their init values based on the SoC type. Previously the values were hard coded within the DPLL clock code, but having them inside the clock features avoids runtime cpu_is_X type checks. Signed-off-by: Tero Kristo <t-kristo@ti.com> Reviewed-by: Mike Turquette <mturquette@linaro.org> Signed-off-by: Paul Walmsley <paul@pwsan.com>
2014-07-06ARM: OMAP2+: clock/dpll: fix _dpll_test_fint arithmetics overflowTero Kristo1-1/+1
The divider value provided to the _dpll_test_fint can reach value of 256 with J type DPLLs (USB etc.), which causes an overflow with the u8 datatype. Fix this by changing the parameter to be an int instead. Signed-off-by: Tero Kristo <t-kristo@ti.com> [paul@pwsan.com: changed type of 'n' to unsigned int] Signed-off-by: Paul Walmsley <paul@pwsan.com>
2014-04-11ARM: AM43xx: fix dpll init in bypass modeTomi Valkeinen1-2/+2
On AM43xx, if a PLL is in bypass at kernel init, the code in omap2_get_dpll_rate() will not realize this and will try to calculate the clock rate using the multiplier and the divider, resulting in errors. omap2_init_dpll_parent() has similar issue. Add the missing soc_is_am43xx() check to make the code work on AM43xx. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Sathya Prakash M R <sathyap@ti.com> Signed-off-by: Paul Walmsley <paul@pwsan.com>
2014-02-28ARM: OMAP2+: clock: fix rate printsTomi Valkeinen1-3/+3
Printing with unsigned long rates with %ld gives wrong result if the rate is high enough. Fix this by using %lu. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Paul Walmsley <paul@pwsan.com>
2014-01-17ARM: OMAP2+: clock: use driver API instead of direct memory read/writeTero Kristo1-3/+3
Clock nodes shall use the services provided by underlying drivers to access the hardware registers instead of direct memory read/write. Thus, change all the code to use the new omap2_clk_readl / omap2_clk_writel APIs for this. Signed-off-by: Tero Kristo <t-kristo@ti.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Mike Turquette <mturquette@linaro.org>
2012-11-12ARM: OMAP2+: clock: Cleanup !CONFIG_COMMON_CLK partsMike Turquette1-50/+0
Clean all #ifdef's added to common clock code. This code is no longer needed due to migration to the common clock framework. Signed-off-by: Mike Turquette <mturquette@ti.com> [paul@pwsan.com: clean up new ifdefs added in clockdomain.c] Signed-off-by: Paul Walmsley <paul@pwsan.com>
2012-11-12ARM: OMAP4: clock: Convert to common clkMike Turquette1-1/+53
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: Rajendra 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: Mike 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: Paul Walmsley <paul@pwsan.com>
2012-10-18ARM: OMAP: remove plat/clock.hPaul Walmsley1-2/+0
Remove arch/arm/plat-omap/include/plat/clock.h by merging it into arch/arm/mach-omap1/clock.h and arch/arm/mach-omap2/clock.h. The goal here is to facilitate ARM single image kernels by removing includes via the "plat/" symlink. Signed-off-by: Paul Walmsley <paul@pwsan.com> [tony@atomide.com: fixed to remove duplicate clock.h includes] Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-09-23Merge branch 'clock_devel_3.7' into hwmod_prcm_clock_a_3.7Paul Walmsley1-11/+15
Conflicts: arch/arm/mach-omap2/clkt34xx_dpll3m2.c arch/arm/mach-omap2/clkt_clksel.c arch/arm/mach-omap2/clock.c
2012-09-23Merge tag 'omap-devel-am33xx-for-v3.7' into test_v3.6-rc6_ocb3.7_cff3.7_odaf3.7Paul Walmsley1-2/+2
From Paul Walmsley <paul@pwsan.com>: AM33xx hwmod data and miscellaneous clock and hwmod fixes. AM33xx should now boot on mainline after this is applied, according to Vaibhav.
2012-09-23Merge tag 'cleanup-fixes-for-v3.7' into test_v3.6-rc6_ocb3.7_cff3.7_odaf3.7Paul Walmsley1-1/+1
These fixes are needed to fix non-omap build breakage for twl-core driver and to fix omap1_defconfig compile when led driver changes and omap sparse IRQ changes are merged together. Also fix warnings for omaps not using pinctrl framework yet.
2012-09-22ARM: OMAP2+: clock: Remove all direct dereferencing of struct clkRajendra Nayak1-11/+15
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: Rajendra Nayak <rnayak@ti.com> [paul@pwsan.com: simplified some compound expressions; reformatted some messages] Signed-off-by: Paul Walmsley <paul@pwsan.com> Cc: Mike Turquette <mturquette@linaro.org>
2012-09-12Merge tag 'omap-devel-a2-for-3.7' of ↵Tony Lindgren1-2/+2
git://git.kernel.org/pub/scm/linux/kernel/git/pjw/omap-pending into devel-am33xx AM33xx hwmod data and miscellaneous clock and hwmod fixes. AM33xx should now boot on mainline after this is applied, according to Vaibhav. This second version includes trailing commas at the end of structure records at Tony's request. It also adds a OMAP_INTC_START macro expansion to each IRQ number to make the sparseirq conversion easier. Basic build, boot, and PM test transcripts are here: http://www.pwsan.com/omap/testlogs/am33xx_hwmod_clock_devel_3.7/20120912165952/
2012-09-12ARM: OMAP: Split plat/hardware.h, use local soc.h for omap2+Tony Lindgren1-1/+1
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: Wim Van Sebroeck <wim@iguana.be> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-09-12ARM: OMAP2+: dpll: Add missing soc_is_am33xx() check for common functionsVaibhav Hiremath1-2/+2
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: Vaibhav Hiremath <hvaibhav@ti.com> Cc: Rajendra Nayak <rnayak@ti.com> Cc: Paul Walmsley <paul@pwsan.com> Signed-off-by: Paul Walmsley <paul@pwsan.com>
2012-09-12ARM: OMAP: unwrap stringsPaul Walmsley1-4/+4
Find and unwrap wrapped strings in the style: pr_debug("clockdomain: hardware cannot set/clear wake up of " "%s when %s wakes up\n", clkdm1->name, clkdm2->name); Keeping these strings contiguous seems to be the current Linux kernel policy. The offending lines were found with the following command: pcregrep -rnM '"\s*$\s*"' arch/arm/*omap* While here, some messages have been clarified, some pr_warning( ... calls have been converted to pr_warn( ..., and some printk(KERN_* ... have been converted to pr_*. Signed-off-by: Paul Walmsley <paul@pwsan.com>
2012-02-24ARM: OMAP: Remove plat/io.h by splitting it into mach/io.h and mach/hardware.hTony Lindgren1-0/+1
This is needed to minimize io.h so the SoC specific io.h for ARMs can removed. Note that minimal driver changes for DSS and RNG are needed to include cpu.h for SoC detection macros. Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Matt Mackall <mpm@selenic.com> Cc: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Tony Lindgren <tony@atomide.com>
2011-10-07ARM: OMAP3+: Update DPLL Fint range for OMAP36xx and OMAP4xxx devicesJon Hunter1-16/+35
The OMAP36xx and OMAP4xxx DPLLs have a different internal reference clock frequency (fint) operating range than OMAP3430. Update the dpll_test_fint() function to check for the correct frequency ranges for OMAP36xx and OMAP4xxx. For OMAP36xx and OMAP4xxx devices, DPLLs fint range is 0.5MHz to 2.5MHz for j-type DPLLs and otherwise it is 32KHz to 52MHz for all other DPLLs. Signed-off-by: Jon Hunter <jon-hunter@ti.com> Signed-off-by: Paul Walmsley <paul@pwsan.com>
2011-03-10Merge remote branches 'remotes/origin/pwrdm_clkdm_b_2.6.39', ↵Paul Walmsley1-68/+23
'remotes/origin/pwrdm_add_can_lose_context_fns_2.6.39', 'remotes/origin/omap_device_a_2.6.39', 'remotes/origin/mmc_a_2.6.39', 'remotes/origin/hwmod_b_2.6.39', 'remotes/origin/dmtimer_a_2.6.39', 'remotes/origin/pwrdm_clkdm_a_2.6.39', 'remotes/origin/clkdm_statdep_omap4_2.6.39', 'remotes/origin/clk_a_2.6.39', 'remotes/origin/clk_autoidle_a_2.6.39', 'remotes/origin/clk_autoidle_b_2.6.39', 'remotes/origin/clk_b_2.6.39', 'remotes/origin/clk_clkdm_a_2.6.39', 'remotes/origin/misc_a_2.6.39', 'remotes/origin/for_2.6.39/omap3_hwmod_data' and 'remotes/origin/wdtimer_a_2.6.39' into tmp-integration-2.6.39-20110310-024
2011-03-07OMAP2+: clock: remove the DPLL rate tolerance codePaul Walmsley1-68/+23
Remove the DPLL rate tolerance code that is called during rate rounding. As far as I know, this code is never used, since it's been more important for callers of the DPLL round_rate()/set_rate() functions to obtain an exact rate than it is to save a relatively small amount of power. Signed-off-by: Paul Walmsley <paul@pwsan.com>
2011-02-22OMAP2/3: clock: fix fint calculation for DPLL_FREQSELJohn Ogness1-1/+1
In OMAP35X TRM Rev 2010-05 Figure 7-18 "DPLL With EMI Reduction Feature", it is shown that the internal frequency is calculated by CLK_IN/(N+1). However, the value passed to _dpll_test_fint() is already "N+1" since Linux is using the values to divide by. In the technical reference manual, "N" is referring to the divider's register value (0-127). During power management testing, it was observed that programming the wrong jitter correction value can cause the system to become unstable and eventually crash. Signed-off-by: John Ogness <john.ogness@linutronix.de> [paul@pwsan.com: added second paragraph to commit message] Signed-off-by: Paul Walmsley <paul@pwsan.com>
2010-12-21OMAP2/3: PRCM: split OMAP2/3-specific PRCM code into OMAP2/3-specific filesPaul Walmsley1-1/+0
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: Paul 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: Omar Ramirez Luna <omar.ramirez@ti.com> Cc: Felipe Contreras <felipe.contreras@gmail.com> Acked-by: Felipe Contreras <felipe.contreras@gmail.com> Cc: Greg Kroah-Hartman <greg@kroah.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Reviewed-by: Kevin Hilman <khilman@deeprootsystems.com> Tested-by: Kevin Hilman <khilman@deeprootsystems.com> Tested-by: Rajendra Nayak <rnayak@ti.com> Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
2010-02-24OMAP2/3/4 clock: fix DPLL multiplier value errors; also copyrights, ↵Paul Walmsley1-1/+1
includes, documentation 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: Paul Walmsley <paul@pwsan.com> Cc: Benoît Cousson <b-cousson@ti.com> Cc: Rajendra Nayak <rnayak@ti.com>
2010-01-26OMAP2/3/4 clock: move DPLL clock functions into mach-omap2/clkt_dpll.cPaul Walmsley1-0/+386
Move all DPLL-related clock functions from mach-omap2/clock.c to mach-omap2/clkt_dpll.c. This is intended to make the clock code easier to understand, since all of the functions needed to manage DPLLs 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 DPLLs 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 moved to the plat-omap/ directory to be shared. Thanks to Alexander Shishkin <virtuoso@slind.org> for his comments to improve the patch description. Signed-off-by: Paul Walmsley <paul@pwsan.com> Cc: Alexander Shishkin <virtuoso@slind.org>