Commit graph

75101 commits

Author SHA1 Message Date
Tony Lindgren 558a0780b0 Convert the OMAP2+ clock code and data to rely on the common
clock framework for internal bookkeeping and the driver API.
 
 Basic test logs for this branch on top of Tony's cleanup-prcm branch
 at commit c9d501e5cb are here:
 
 http://www.pwsan.com/omap/testlogs/common_clk_devel_3.8_rebase/20121112192516/
 
 However, cleanup-prcm at c9d501e5 does not include some fixes
 that are needed for a successful test.  With several reverts,
 fixes, and workarounds applied, the following test logs were
 obtained:
 
 http://www.pwsan.com/omap/testlogs/TEST_common_clk_devel_3.8_rebase/20121112192300/
 
 which indicate that the series tests cleanly.
 
 N.B. The common clock data addition patches result in many
 checkpatch warnings of the form "WARNING: static const char *
 array should probably be static const char * const".  However, it
 appears that resolving these would require changes to the CCF
 itself.  So the resolution of these warnings is being postponed
 until that can be coordinated.
 
 These patches result in a ~55KiB increase in runtime kernel memory
 usage when booting omap2plus_defconfig kernels.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQonKoAAoJEMePsQ0LvSpLjesQAKwgh4WWzYGnlysAJ+QBUS0d
 Gx4mmHLIFIhz0j/8Wh7NISjhjfqvT/JgPzszMUB9QGIZALhqjVlSeOs4AdcwPEvI
 YJhrE5osBQl2IufcflHgZzhlSqSNWczrECZQCQ+lWbBoibGB3g936l7YxFg4G1ua
 kjvaF7afDnVEuQ276276gA4JHWsd0BITe/qUfDFiBOQRqdKN+TanWSqyc+3j+hws
 7fTaQLE+B/Okoiye4iycaJUL++pCquJIVklewaCOyQhtQ0MsCfIDVvn/amd8Xh6V
 pEFuXaGK8O4C/CaLIvsee/+/86A4pJo5ahh42Q3a3jE/hBP6Fa2JKWE+hFd3owdc
 FMAOoSBtxXrHXSiempkHnYM5lXdTZImW0DTfSKuc6V1plRT4cbxuC9a2IHOP3otU
 b669JE3xg/xYBqWIwDFHWFiPkBchO1UOH1q/Rieb7NYsYwx8yzNIp6oNxbPqCsy3
 pmWWMxSrGm0/H/uvQHzHBCW8q4Qp4cFTiewPJz53t5W9wUw4L/AkL1uRsmu4I7Xy
 fdceSnhq1/fud02RCBrpt5PW9PAeLit9AU6IQxx8HTZCsrUU0r580dxVhJwwjX8I
 CmGJ1iNS7vhaf0Q7asdvIRg7e9DrM/RWdJ4UU0+Dki7S2WUPrrlA5pAZtRtivP1Y
 KCT3xkyLdIdEVXYVtiBD
 =VWPp
 -----END PGP SIGNATURE-----

Merge tag 'omap-cleanup-c-for-3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/pjw/omap-pending into omap-for-v3.8/clock

Convert the OMAP2+ clock code and data to rely on the common
clock framework for internal bookkeeping and the driver API.

Basic test logs for this branch on top of Tony's cleanup-prcm branch
at commit c9d501e5cb are here:

http://www.pwsan.com/omap/testlogs/common_clk_devel_3.8_rebase/20121112192516/

However, cleanup-prcm at c9d501e5 does not include some fixes
that are needed for a successful test.  With several reverts,
fixes, and workarounds applied, the following test logs were
obtained:

http://www.pwsan.com/omap/testlogs/TEST_common_clk_devel_3.8_rebase/20121112192300/

which indicate that the series tests cleanly.

N.B. The common clock data addition patches result in many
checkpatch warnings of the form "WARNING: static const char *
array should probably be static const char * const".  However, it
appears that resolving these would require changes to the CCF
itself.  So the resolution of these warnings is being postponed
until that can be coordinated.

These patches result in a ~55KiB increase in runtime kernel memory
usage when booting omap2plus_defconfig kernels.

Conflicts:
	arch/arm/mach-omap2/clock33xx_data.c
	arch/arm/mach-omap2/clock3xxx_data.c
	arch/arm/mach-omap2/clock44xx_data.c
2012-11-13 13:32:24 -08:00
Tony Lindgren 89ab216b33 Merge branch 'omap-for-v3.8/pm' into omap-for-v3.8/clock 2012-11-13 13:25:38 -08:00
Mike Turquette f9ae32a74f ARM: OMAP2+: clock: Cleanup !CONFIG_COMMON_CLK parts
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-12 19:18:51 -07:00
Paul Walmsley f51e0f9862 ARM: OMAP2xxx: clock: drop obsolete clock data
Drop the now-obsolete OMAP2420/2430 original OMAP clock data.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Mike Turquette <mturquette@ti.com>
2012-11-12 19:18:51 -07:00
Rajendra Nayak d037e100d1 ARM: OMAP2: clock: Cleanup !CONFIG_COMMON_CLK parts
Clean all #ifdef's added to OMAP2 clock code to make it COMMON clk
ready, not that CONFIG_COMMON_CLK is enabled.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
[paul@pwsan.com: also drop CONFIG_COMMON_CLK tests around APLL recalc_rate
 functions]
Signed-off-by: Mike Turquette <mturquette@ti.com>
[paul@pwsan.com: remove some ifdefs in mach-omap2/io.c]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
2012-11-12 19:18:51 -07:00
Paul Walmsley 455db9c9b2 ARM: OMAP3+: DPLL: drop !CONFIG_COMMON_CLK sections
Remove all of the code that is compiled when CONFIG_COMMON_CLK=n in the
OMAP3+ DPLL handling code.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Mike Turquette <mturquette@ti.com>
Cc: Rajendra Nayak <rnayak@ti.com>
2012-11-12 19:18:50 -07:00
Paul Walmsley e127539fb3 ARM: AM33xx: clock: drop obsolete clock data
Drop the now-obsolete AM33xx original OMAP clock data.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Mike Turquette <mturquette@ti.com>
2012-11-12 19:18:50 -07:00
Paul Walmsley 368edee33e ARM: OMAP3xxx: clk: drop obsolete clock data
Drop the now-obsolete OMAP3xxx original OMAP clock data.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Mike Turquette <mturquette@ti.com>
2012-11-12 19:18:50 -07:00
Rajendra Nayak 25f4214e38 ARM: OMAP3: clock: Cleanup !CONFIG_COMMON_CLK parts
Clean all #ifdef's added to OMAP3 clock code to make it COMMON clk
ready, not that CONFIG_COMMON_CLK is enabled.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Mike Turquette <mturquette@ti.com>
[paul@pwsan.com: remove some ifdefs in mach-omap2/io.c]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
2012-11-12 19:18:50 -07:00
Paul Walmsley 13a5b62286 ARM: OMAP44xx: clock: drop obsolete clock data
Drop the now-obsolete OMAP44xx original OMAP clock data.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Mike Turquette <mturquette@ti.com>
2012-11-12 19:18:50 -07:00
Rajendra Nayak 91c5b6d243 ARM: OMAP4: clock: Cleanup !CONFIG_COMMON_CLK parts
Clean all #ifdef's added to OMAP4 clock code to make it COMMON clk
ready, now that CONFIG_COMMON_CLK is enabled.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Mike Turquette <mturquette@ti.com>
[paul@pwsan.com: remove some ifdefs in mach-omap2/io.c]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
2012-11-12 19:18:50 -07:00
Rajendra Nayak c4a1ea2c62 ARM: OMAP: hwmod: Cleanup !CONFIG_COMMON_CLK parts
Clean all #ifdef's added as part of fixing the clkdm
accesses from hwmod.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Mike Turquette <mturquette@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
2012-11-12 19:18:50 -07:00
Rajendra Nayak f7f73aab3d ARM: OMAP: clock: Switch to COMMON clk
Select COMMON_CLK for all OMAP2+ SoCs and switch over to using new
data files for OMAP2/3/4.

The older data files will get removed in subsequent patches.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
[paul@pwsan.com: move 'select COMMON_CLK' from ARCH_OMAP2PLUS_TYPICAL to
 the per-SoC and per-"arch" Kconfig sections]
[mturquette@ti.com: fixed up #ifdef mismatch in clock.h in previous
  patch which drops that change from this patch]
Signed-off-by: Mike Turquette <mturquette@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
2012-11-12 19:18:50 -07:00
Rajendra Nayak 6ab9f69e7e ARM: OMAP2: clock: Add 24xx data using common struct clk
The patch is the output from a python script which converts
from the old OMAP clk format to COMMON clk format using a
JSON parser in between which was developed by Paul Walmsley.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
[paul@pwsan.com: replace omap2_init_clksel_parent() with
 omap2_clksel_find_parent_index(); reflowed macros; dropped 243x clkdev
 aliases in 242x file; added recalc_rate fn ptrs to APLL clocks;
 fixed some checkpatch warnings]
[mturquette@ti.com: removed deprecated variables from omap24x0_clk_init]
Signed-off-by: Mike Turquette <mturquette@ti.com>
[paul@pwsan.com: fixed boot crash due to missing clock init code; added twl.fck
 alias; fix DPLL rate initialization; fix APLL clocks and virt_prcm_set
 initialization]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
2012-11-12 19:18:49 -07:00
Rajendra Nayak 99e7938def ARM: OMAP3: clock: Add 3xxx data using common struct clk
The patch is the output from a python script which converts
from the old OMAP clk format to COMMON clk format using a
JSON parser in between which was developed by Paul Walmsley.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
[paul@pwsan.com: AM3517/05: dropped bogus hsotgusb "ick" and "fck"
 clkdev aliases; added hsotgusb_fck alias; added emac_ick and emac_fck
 aliases; replace omap2_init_clksel_parent() with
 omap2_clksel_find_parent_index(); reflow macros and parent name
 lists; add clkdm_name argument to DEFINE_STRUCT_CLK_HW_OMAP macros]
Signed-off-by: Mike Turquette <mturquette@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
2012-11-12 19:18:49 -07:00
Vaibhav Hiremath b4c6329537 ARM: AM33XX: clock: add clock data in common clock format
OMAP2/3/4 clock-tree data is migrated to common-clock framework,
so it is needed to do same for AM33XX device.

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Cc: Rajendra Nayak <rnayak@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Benoit Cousson <b-cousson@ti.com>
[paul@pwsan.com: replace omap2_init_clksel_parent() with
 omap2_clksel_find_parent_index(); modified to not use the AM33xx common
 clock data yet; updated patch description; reflowed the macros;
 updated DEFINE_STRUCT_CLK_HW_OMAP usage to include clkdm_name]
Signed-off-by: Mike Turquette <mturquette@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
2012-11-12 19:18:49 -07:00
Rajendra Nayak cb26867ee2 ARM: OMAP4: clock: Add 44xx data using common struct clk
This patch is output from updated omap hw data autogeneration scripts
mostly contributed by Mike Turquette, with some later fixes from me.
All data is added into a new cclock44xx_data.c file which will be
switched with clock44xx_data.c file in a later patch.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
[paul@pwsan.com: replace omap2_init_clksel_parent() with
 omap2_clksel_find_parent_index(); reflowed macros; updated
 DEFINE_STRUCT_CLK_HW_OMAP macro to include clkdm_name;
 use macros for clksel mux+gate clocks; many other fixes]
[mturquette@ti.com: converted DPLL outputs to HSDIVIDER macro; trace_clk_div_ck
 has clkdm ops]
Signed-off-by: Mike Turquette <mturquette@ti.com>
[paul@pwsan.com: fixed the omap-gpmc.fck alias per commit a2e5b90b; fixed
 several checkpatch issues; moved the dpll3xxx.c clockdomain modifications to
 another patch]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
2012-11-12 19:10:20 -07:00
Paul Walmsley 8c725dcd22 ARM: OMAP2+: clock: add OMAP CCF convenience macros to mach-omap2/clock.h
Define four convenience macros to be used in the upcoming OMAP2+
common clock framework port.  Although the use of these macros will
make the data somewhat more difficult to read, they significantly reduce
the number of lines in the output patch data.

Most of these were created by Rajendra Nayak and Mike Turquette, as
far as I know.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
[mturquette@ti.com: added DEFINE_CLK_OMAP_HSDIVIDER macro]
Signed-off-by: Mike Turquette <mturquette@ti.com>
Cc: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
2012-11-12 19:10:20 -07:00
Rajendra Nayak b6827ad5b6 ARM: OMAP: clock: Get rid of some clkdm assocations within clks
It's suspected that some of the clockdomain associations with clocks
can be removed from the clock data.  Drop several of these
associations to save diffstat and improve performance.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
[paul@pwsan.com: removed most of the changes in this patch; modified patch
 description]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Mike Turquette <mturquette@ti.com>
2012-11-12 19:10:19 -07:00
Mike Turquette d043d87cd3 ARM: OMAP2+: clockdomain: bypass clockdomain handling when disabling unused clks
The OMAP port to the common clk framework[1] resulted in spurious WARNs
while disable unused clocks.  This is due to _clkdm_clk_hwmod_disable
catching clkdm->usecount's with a value of zero.  Even less desirable it
would not allow the clkdm_clk_disable function pointer to get called due
to an early return of -ERANGE.

This patch adds a check for such a corner case by skipping the WARN and
early return in the event that clkdm->usecount and clk->enable_usecount
are both zero.  Presumably this could only happen during the check for
unused clocks at boot-time.

[1] http://article.gmane.org/gmane.linux.ports.arm.omap/88824

Signed-off-by: Mike Turquette <mturquette@ti.com>
[paul@pwsan.com: split the hwmod and clock disable cases; modified the
 code to skip the clockdomain handling during the disable-unused-clocks phase;
 added COMMON_CLK ifdef; removed include of clk-private.h at Mike's request]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
2012-11-12 19:10:19 -07:00
Vaibhav Hiremath b797be1d4c ARM: OMAP2+: hwmod: Invoke init_clkdm before other init functions
Without this kernel would crash, since clkdm inside omap_hwmod
is accessed in some of the init functions like, _init_main_clk.

So call init_clkdm before _init_main_clk().

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Mike Turquette <mturquette@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
2012-11-12 19:10:19 -07:00
Rajendra Nayak 8577413c0a ARM: OMAP: clock: Define a function to enable clocks at init
Platform code can use omap2_clk_enable_init_clocks() to enable a
list of clocks that are needed to be enabled at init.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Mike Turquette <mturquette@ti.com>
[paul@pwsan.com: added kerneldoc to non-trivial new function]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
2012-11-12 19:10:19 -07:00
Rajendra Nayak 23fb8ba3a8 ARM: OMAP: clock: list all clk_hw_omap clks to enable/disable autoidle
Platforms can call omap2_init_clk_hw_omap_clocks() to register a clock
using clk_hw_omap. omap2_clk_enable_autoidle_all() and
omap2_clk_disable_autoidle_all() can then be used to run through
all the clocks which support autoidle to enable/disable them.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Mike Turquette <mturquette@ti.com>
[paul@pwsan.com: added kerneldoc on non-trivial new functions]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
2012-11-12 19:10:18 -07:00
Paul Walmsley 7a2bd1cc39 ARM: OMAP2xxx: clock: add APLL rate recalculation functions
OMAP2420 and OMAP2430 chips each have two on-chip APLLs.  When locked,
one APLL generates a 96 MHz rate; the other, a 54 MHz rate.
Previously we treated these clocks as fixed-rate clocks at the locked
rates, but this isn't quite right.  The locked rate should be returned
when the APLL is locked, and a zero rate should be returned when the
APLL is stopped.  This patch adds the infrastructure that will be used
by the CCF changes.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Mike Turquette <mturquette@ti.com>
Cc: Rajendra Nayak <rnayak@ti.com>
2012-11-12 19:10:18 -07:00
Rajendra Nayak ed1ebc4948 ARM: OMAP2: clock: Convert to common clk
Convert all OMAP2 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.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Mike Turquette <mturquette@ti.com>
[paul@pwsan.com: updated to apply]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
2012-11-12 19:10:18 -07:00
Rajendra Nayak b4777a2138 ARM: OMAP3: clock: Convert to common clk
Convert all OMAP3 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.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Mike Turquette <mturquette@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
2012-11-12 19:10:18 -07:00
Mike Turquette 32cc002116 ARM: OMAP4: clock: Convert to common clk
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-11-12 13:55:50 -07:00
Rajendra Nayak f5dd3bb53c ARM: OMAP: hwmod: Fix up hwmod based clkdm accesses
hwmod uses deferencing the clk pointer to acccess the clkdm.
With COMMON clk hwoever this will need to be deferenced through
the clk_hw_omap pointer, so do the necessary changes.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Mike Turquette <mturquette@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
2012-11-12 13:55:50 -07:00
Rajendra Nayak b5a2366c18 ARM: OMAP: clock: Nuke plat/clock.c & reuse struct clk as clk_hw_omap
plat/clock.c which has most of usecounting/locking infrastructure will
be used only for OMAP1 until that is moved to use COMMON clk.

reuse most of what plat/clock.h has while we move to common clk, and
move most of what 'struct clk' was as 'struct clk_hw_omap' which
will then be used to define platform specific parameters.
All usecounting/locking related variables from 'struct clk' are
dropped as they will not be used with 'struct clk_hw_omap'.

Based on the original changes from Mike Turquette.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Mike Turquette <mturquette@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
2012-11-12 13:55:49 -07:00
Paul Walmsley b99db36cdf ARM: OMAP2+: PRCM: remove obsolete prcm.[ch]
arch/arm/mach-omap2/prcm.c and arch/arm/plat-omap/include/plat/prcm.h
are now completely unused and can be removed.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Tested-by: Vaibhav Hiremath <hvaibhav@ti.com>
2012-11-08 15:09:26 -07:00
Paul Walmsley 2577a4a609 ARM: OMAP2+: hwmod: call to _omap4_disable_module() should use the SoC-specific call
The hwmod code unconditionally calls _omap4_disable_module() on all
SoCs when a module doesn't enable correctly.  This "worked" due to the
weak function omap4_cminst_wait_module_idle() in
arch/arm/mach-omap2/prcm.c, which was a no-op.  But now those weak
functions are going away - they should not be used.  So this patch
will now call the SoC-specific disable_module code, assuming it
exists.

Needs to be done before the weak function is removed, otherwise AM33xx
will crash early in boot.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Tested-by: Vaibhav Hiremath <hvaibhav@ti.com>
2012-11-08 15:09:26 -07:00
Paul Walmsley b13159afb4 ARM: OMAP2+: PRCM: consolidate PRCM-related timeout macros
Consolidate all of the copies of MAX_MODULE_HARDRESET_WAIT and
MAX_MODULE_SOFTRESET_WAIT into one place, arch/arm/mach-omap2/prm.h.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Tested-by: Vaibhav Hiremath <hvaibhav@ti.com>
2012-11-08 15:09:26 -07:00
Paul Walmsley d9a16f9ab9 ARM: OMAP2+: PRCM: split and relocate the PRM/CM globals setup
Split omap2_set_globals_prcm() into PRM, CM, and PRCM_MPU variants, since
these are all separate IP blocks.  This should make it easier to move the
PRM, CM, PRCM_MPU code into drivers/ in future patchsets.

At this point arch/arm/plat-omap/include/plat/prcm.h is empty; a
subsequent patch will remove it, and remove the #include from all the
files that #include it.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Tested-by: Vaibhav Hiremath <hvaibhav@ti.com>
2012-11-08 15:09:26 -07:00
Paul Walmsley 5b78e61b1c ARM: OMAP2+: PRCM: remove omap2_cm_wait_idlest()
Now that all users of mach-omap2/omap2_cm_wait_idlest() have been removed,
delete the function and its supporting macros and prototypes.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Tested-by: Vaibhav Hiremath <hvaibhav@ti.com>
2012-11-08 15:09:26 -07:00
Paul Walmsley c4ceedcb18 ARM: OMAP2+: CM/clock: convert _omap2_module_wait_ready() to use SoC-independent CM functions
Convert the OMAP clock code's _omap2_module_wait_ready() to use
SoC-independent CM functions that are provided by the CM code, rather
than using a deprecated function from mach-omap2/prcm.c.

This facilitates the future conversion of the CM code to a driver, and
also removes a mach-omap2/prcm.c user.  mach-omap2/prcm.c will be removed
by a subsequent patch.

Some modules have IDLEST registers that aren't in the CM module, such
as the AM3517 IDLEST bits.  So we also need a fallback function for
these non-CM odd cases.  Create a temporary one in mach-omap2/clock.c,
intended to exist until the SCM drivers are ready.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Tested-by: Vaibhav Hiremath <hvaibhav@ti.com>
2012-11-08 12:33:08 -07:00
Paul Walmsley b6ffa05091 ARM: OMAP2xxx: APLL/CM: convert to use omap2_cm_wait_module_ready()
Convert the OMAP2xxx APLL code to use omap2_cm_wait_module_ready(),
and move the low-level CM register manipulation functions to
mach-omap2/cm2xxx.c.  The objectives here are to remove the dependency
on the deprecated omap2_cm_wait_idlest() function in
mach-omap2/prcm.c, so that code can be removed later; and move
low-level register accesses to the CM IP block to the CM code, which
will soon be moved into drivers/.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Tested-by: Vaibhav Hiremath <hvaibhav@ti.com>
2012-11-08 12:33:08 -07:00
Paul Walmsley 187e3e06e8 ARM: OMAP2+: board files: use SoC-specific system restart functions
Modify the board files to use the SoC-specific system restart
functions.  At this point it's possible to remove omap_prcm_restart()
from mach-omap2/prcm.c.

While removing the prototypes for the now-unused restart functions, clean
up a few more obsolete prototypes in mach-omap2/clock.h.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Tested-by: Vaibhav Hiremath <hvaibhav@ti.com>
2012-11-08 12:33:08 -07:00
Paul Walmsley 2f334a3896 ARM: OMAP2+: PRCM: create SoC-specific chip restart functions
Split omap_prcm_restart() from mach-omap2/prcm.c into SoC-specific
variants.  These functions need to be able to save the reboot reason
into the scratchpad RAM.  This implies a dependency on both the PRM
and SCM IP blocks, so they've been moved into their own file.  This
will eventually call functions in the PRM and SCM drivers, once those
are created.

Vaibhav Hiremath <hvaibhav@ti.com> identified an unused prototype in
the first version of this patch - now removed.  Tony Lindgren
<tony@atomide.com> noted a compile problem with some RMK Kconfigs;
resolved in this patch.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Vaibhav Hiremath <hvaibhav@ti.com>
Tested-by: Vaibhav Hiremath <hvaibhav@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
2012-11-08 12:33:08 -07:00
Paul Walmsley baa689b8b2 ARM: OMAP2xxx: clock: move virt_prcm_set code into clkt2xxx_virt_prcm_set.c
Collect all of the virt_prcm_set-specific clocktype code into
mach-omap2/clkt2xxx_virt_prcm_set.c.  Remove its dependency on the
'sclk' and 'vclk' global variables.  Those variables will be removed
by subsequent patches.

This is part of the process of cleaning up the OMAP2xxx clock code
and preparing for the removal of the omap_prcm_restart() function.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Tested-by: Vaibhav Hiremath <hvaibhav@ti.com>
2012-11-08 12:33:08 -07:00
Paul Walmsley 5f03937700 ARM: OMAP2xxx: clock: remove global 'dclk' variable
Remove the global 'dclk' variable, instead replacing it with a
variable local to the dpllcore clock type C file.  This removes some
of the special-case code surrounding the OMAP2xxx clock init.

This patch is a prerequisite for the removal of the
omap_prcm_restart() code from arch/arm/mach-omap2/prcm.c.  It also
cleans up some special-case OMAP2xxx clock code in the process.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Tested-by: Vaibhav Hiremath <hvaibhav@ti.com>
2012-11-08 12:33:08 -07:00
Paul Walmsley d08cce6a1d ARM: OMAP2/3: PRM: add SoC reset functions (using the CORE DPLL method)
Add SoC reset functions into the PRM code.  These functions are based
on code from mach-omap2/prcm.c.  They reset the SoC using the CORE DPLL
reset method (as opposed to one of the other two or three chip reset
methods).

Adding them here will facilitate their removal from
arch/arm/mach-omap2/prcm.c.  (prcm.c is deprecated.)

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Tested-by: Vaibhav Hiremath <hvaibhav@ti.com>
2012-11-08 12:33:07 -07:00
Paul Walmsley b6a4226c14 ARM: OMAP2+: common: remove mach-omap2/common.c globals and map_common_io code
Get rid of the mach-omap2/common.c globals by moving the global
initialization for IP block addresses that must occur early into
mach-omap2/io.c.  In the process, remove the *_map_common_io*() and
SoC-specific *set_globals* functions.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Tested-by: Vaibhav Hiremath <hvaibhav@ti.com>
2012-11-08 12:33:07 -07:00
Paul Walmsley 76e0e16d91 ARM: OMAP2+: PRCM: remove omap_prcm_get_reset_sources()
omap_prcm_get_reset_sources() is now unused; so, remove it.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Tested-by: Vaibhav Hiremath <hvaibhav@ti.com>
2012-11-08 12:33:07 -07:00
Tony Lindgren 46bf4a5622 OMAP voltage layer updates towards supporting auto-retention/auto-off
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJQmaAOAAoJEFk3GJrT+8ZlkuEP/0Kb0u/yz54BzH3WMSdtklMS
 Ylmo/gX9I5wUT4RpdBYQCU8L+1DKie8c7ZRJUKJoVBMyGtFkRfry9XBEyU8QamGH
 8hTa1itQdal3V6o9q9ilc5W9HckBxKCY/K23VljgoJO/0RzjASfJ3RO6bf8jQKgs
 RnuRIO+uOev1QDbFSurVcHIPGLsz3m/WserXAxRajY4DJcKOyfJOk11z0hlADWaD
 8SRRqeoV5oGzBXwd98I6QddngOxaE/Nr4jGvW9KwJG0fzDsV3hjd5RbFFVoU0ISo
 Dw0JhFsz7hQ36dXOV1z71BhcxYPNv2PFILlvpkn471DNlG524sc2Eh6to1sDVlDY
 cSR7hDylvf4Do2xyNUk/YgZwf6l5m/Bg/uJ5vrltcHO4uUhM5JFSeNfP9UBC3ups
 r6vJc73XuMCx58G5kuSprVHe4kIWJ8WT8zLjZ7YBk38EB9iYWF9zLVijyKY9fsoT
 qUlrwXsh49HML8k07mRWLF/w2LgomFA28prLzay/CnCv8LfSwA/SpWI42QKFy+Y2
 cme57OkXDsMbAHDt6X1j5QH2HJ4aMhalfHiPbync5UobJx3nYvs1DeqLuqcqVbbD
 5cwaTmFc4KcFqMhDeUujLmNofGOauvVm5R13A1cZrTF/U85SYxq4KuIX7FEC2n02
 W0v+kAvCbY3nX0+0SMdj
 =mE28
 -----END PGP SIGNATURE-----

Merge tag 'for_3.8-pm-voltage' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into omap-for-v3.8/pm

OMAP voltage layer updates towards supporting auto-retention/auto-off
2012-11-06 17:06:37 -08:00
Tony Lindgren b197adabbd OMAP: SmartReflex: pass device-independent data via platform_data
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJQmZ9YAAoJEFk3GJrT+8ZluiAQAKUCzBSLsuPromHdeB734JJ6
 yXYUIXfwg/nFgVjkfcQSDl7q2EOgtY5xyselp7u1zhxoV/PHVzpTS1Eo1mtII+EL
 6DcJeSLnbiHBuhVedj/IUXat6J6scxMnrxO4Rjz2DsX5RmESeSbT86rw41q3pSLq
 IOfW7524sfs+5lIjj3ozoMAkG1cbhIwbnGq7bp/zflEhoN3RvhPsoAxJISc83LVL
 G6YKBpR33BEgyYkP7KP/HL55aAhec/0FTYViIr6VZb524my+Zh8EVv65rWZSzvuy
 RnxxEG4HeILFtxg8cbwgT+1p2nfOgVerO4VYV0JolhK4JxOJvdIWwFB5PNLuDfmj
 WV/EguWHOcB7RsHwyfefRZbxvDMP2kVDhu+EWu/HdJm82JDR+KvP+u0896YOINxq
 N6KOGOZR5R/0q1BBUeZOt62ixrRfcVcA0LYTMjwNawFwEZfkiH6ucwXK0dESONmu
 KXgfAWdgC9Y5U5h+OK9sWv5ac81PrU9BMKDKksSM07SYW2MxbUnBaAN42VAAVVFh
 pLFIONI9z6+X1ZY5p/8i1swXJO9aNV4LjAtI13FMVpEK+ESolzlt9iXCh2I4h5tS
 /Nr8a98n8CBOkHLcDs22CYs+VsdYbJIReWRtyadAF84qx8TWVUehrFfYz/1IWVki
 HeyWk12rsecpsKEaLHMt
 =gOpD
 -----END PGP SIGNATURE-----

Merge tag 'for_3.8-pm-sr' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into omap-for-v3.8/pm

OMAP: SmartReflex: pass device-independent data via platform_data
2012-11-06 17:06:26 -08:00
Tony Lindgren 1d1186f5ca Minor pr_warn() cleanup for OMAP2+ Voltage Processor (VP)
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJQmZ7yAAoJEFk3GJrT+8Zld5gP/i7GNZyjTT7HyWERzBpNLFIK
 0dOt5V/zvqP809sM8wyW/o5hA4S6V72CGUDG39Ev2AJLp0jM44GDGREjhsCkzg1p
 Y2ruy6i96yuIavmsWW7zlnSuwmzrENSUzJdRaBsIwiS5lFLqS/NKK6TuWGHah37w
 mYAhLkzviyB0cRb2T1YPzufVkvKOCPB0kM4/vnL/kwDjlOa0GkM4iJpsoKH5dB3f
 b+xQdeUuuTtw6ca7khZ7I8EwSIMF3Uq8SqmWVAPXQIX6vLwQVoBsVzUyEN1/n1wo
 qL8xaH7wbL0a1IFSFZNYEqdyVlVg0V8G250rxs9PmRhmcYKObjiovMVXUwx3xPAe
 O+I2kkh08HvihS7tYwf7r/8gm55a0CchblZYSVO2VuMy0jLXYVd/YrS7DOIxureA
 0853S+R+slK2WenO3N4kyb3oBmP0IuXYHjve2bSI/TgGxKiMW9fYDVwxbfCHni95
 dfQHjr7KVQZCCTSiAHFYAH/dmvRK+N0uafN2lVacLFq80U5ITvfpaE2ZIgKSSDE+
 C4fIdppNISCAUtW6tchfN/R4kjIZzxoPLXnhrOYyQnVXtBaOMqxgQ72PUhkKEMtj
 duEQ92UvWgAy/yT1cUrM+vu9+dfNfPEfAaxtBrSzCkYS3r2XV/w1QXKi72HKbX8B
 xyDkbSCk6WyUQ7zu06SW
 =yFR+
 -----END PGP SIGNATURE-----

Merge tag 'for_3.8-cleanup-pm' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into omap-for-v3.8/pm

Minor pr_warn() cleanup for OMAP2+ Voltage Processor (VP)
2012-11-06 17:06:12 -08:00
Vishwanath Sripathy df7cded30c ARM: OMAP4: OPP: add OMAP4460 definitions
Add OMAP4460 OPP definitions for voltage and frequencies based on
OMAP4460 ES1.0 DM Operating Condition Addendum Version 0.1

The following exceptions are present:
* Smartreflex support is still on experimental mode: the gains and min
  limits are currently pending characterization data. Currently OMAP4430 values
  are used.
* Efuse offset for core OPP100-OV setting is not clear in documentation.
* IVA OPPs beyond OPP100 are disabled due to the delta between max OMAP4460
  current requirements and Phoenix Max supply on VCORE2 in the default
  configuration - boards which have supply which can support this should
  explicitly call opp_enable and enable the same.
* MPU OPPs > OPPTURBO can easily be detected using a efuse burnt - currently
  disabled pending clock changes to support DCC feature.

[nm@ti.com: cleanups and updates from Datamanual]
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Vishwanath BS <vishwanath.bs@ti.com>
[t-kristo@ti.com: rebased to linux-3.6-rc5]
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-11-05 15:31:49 -08:00
Tero Kristo 83b5b5519c ARM: OMAP4: TWL: enable high speed mode for PMIC communication
With the new parameters, I2C can now be put to high speed mode for
better performance.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-11-05 15:31:14 -08:00
Tero Kristo 00bd228ea9 ARM: OMAP4: VC: setup I2C parameters based on board data
VC code now provides a table of pre-calculated I2C setup parameters,
which will be used based on the capacitance value calculated for the I2C
trace on the PCB. A default trace length of 6.3cm is used unless board
defines its own value during init. The parameters set will be the I2C
internal pull setup and the I2C timing parameters for high speed use
mode. Full speed mode is not supported as of now.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-11-05 15:31:12 -08:00
Tero Kristo 2ceec7b25c ARM: OMAP4: vc: fix channel configuration
RACEN bit should only be set if the voltage and command register addresses
are the same.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-11-05 15:29:46 -08:00