Commit graph

3895 commits

Author SHA1 Message Date
Arnd Bergmann 5fd4d427ed One build fix for recent clean up when CONFIG_PM is not set
and clean up related improvment to the SoC detection.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQo/tPAAoJEBvUPslcq6Vzbe4QAK1skGe8pLpsR8Kd8vKMw/nz
 dJLo3X3RVdZZvOGeClh9eYg3/tSGjH/vG2HVCPJ/IDY1VSBA4zzZCVClhiPVY50V
 00ppjPA/BimoynKbm9iVy7Xl0KQ+stuJOkaRvCDHdOlanRD34dggFXiwRVNNCZ20
 yvZ6e8yqC9LegcsmcSnxj1evHHcNC7XoNfJIDsXgn3p6u1N3R17+O9lBxfiTOdkQ
 Q9KV6UftN6ym7WIkCa/ECz9j0AJovj6Sz/6Ni+xmQ6C/4c2vP5zTe2bMsVBUuT3d
 5v7mnMwxic0TKQSIdX7QpwprSPjv8l2QMVjPi5o/HT+46u2Ng+fIXhCCLwJIXpqR
 oqV2MI1jUdfrM6/HZ0WiOPdF9otP0VsFvJTxvH5yPVFCGW+7RyXfdUTB26EFDBXA
 NtA+4k9EUThkTOmjbeDn08TjJOrIHAHFb4bRRdnE7gj1DlPVTkrB3kzTNQorFBjB
 IbNfb/x46zBr+w44f5IYb6m9t5w7IG2+961Jw+xaPXN53Vx7TJN71dzBkH5zJirI
 wJ2bkxpq95XX1UO7OSaWhvZRgZDHfYoGlzKGDkhfZOrDRxeKJwotSpe+3wPRiKfh
 95H+OjOBJqQNZbJ9JKbG/DmdL5SFWALuMjx6nJoYJcUNYMgmblspGzNvUxX141uA
 XZRE1f4QTfKuF5Uc1r7x
 =ah3t
 -----END PGP SIGNATURE-----

Merge tag 'omap-for-v3.8/cleanup-fixes-part2-v2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/cleanup

From Tony Lindgren <tony@atomide.com>:

One build fix for recent clean up when CONFIG_PM is not set
and clean up related improvment to the SoC detection.

* tag 'omap-for-v3.8/cleanup-fixes-part2-v2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: OMAP4: ID: Improve features detection and check
  ARM: OMAP: Fix compile for OMAP_PM_NOOP if PM is not selected

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2012-11-15 17:33:08 +01:00
Arnd Bergmann a0c726cc2c Board updates for omaps mostly to deal with enabling
display support with device tree until the bindings
 are ready.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQoYVDAAoJEBvUPslcq6VzHngP/iEErRfcECB35+jalgh6r8cS
 AP1GUePv0dCTjBt38mzD/7R6gunV/7Cqw74cmnJtP+gKsexDtvi+XDKaSs+y+Ieq
 ED4uXgF+NDyi4PhrUhsX8JIo/+K3lgsayXeqy9adfozfnElPZDCk5YlkiK0zXGoo
 Ot91ypxLXKiZT8jbYPxlrMcLFK6VhHIyyg1sRe28m2aPr42+mrLQyWI6TsiEObBI
 PqPU9nQsugNxMtj/2ZMFITsuwJ6xlxHAn10K+QzBWc1TP2Ca6Fhtd9iRIyU5QE77
 b54dDPAiAZhuxnA1ilI9LDAx/EnDt1pTu8rBAS2VgKQC3UJvL/iXxck7pWH8ot71
 HWwDzoHC47MRDCmbeAIjMYD9FnkTXSC7ZVjEzBFWzM7STZBSXFcm/brsygpU9LBY
 bVpqIB7xTWaHlgaqApwt4EGKCBYj6fUzHQJYoz+DUmwqkq3lHy62hRe9RXJBTXpv
 q/zfrScNstsP84O+uJuL1O7zBNaosW9ev4kyAqXkyYSPQn47xmPV2/POrAB/Hu+T
 TYctvFkIVJfGlGroJRCfLuv/2Ix7jbwR9rhBuxlV9F6fX5obDOVBSbaYQFUQ53EU
 /ZntYhsAhtKkI56ATXzWx55bJ5Q6F1G8I+jJXSPqdu9dg5zaI6Iaw86In5qG86WP
 Cy4bAEwEKX/ldEVmxR0I
 =XnzE
 -----END PGP SIGNATURE-----

Merge tag 'omap-for-v3.8/board-v2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/boards

From Tony Lindgren <tony@atomide.com>:

Board updates for omaps mostly to deal with enabling
display support with device tree until the bindings
are ready.

* tag 'omap-for-v3.8/board-v2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: OMAP1: use BUG_ON where possible
  OMAP: board-generic: enable DSS for panda & sdp boards
  OMAP: omap4sdp: move display init from board file to dss-common.c
  OMAP: panda: move display init from board file to dss-common.c
  ARM: OMAP2+: Nokia N9/N900/N950 -- mention product names

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2012-11-15 17:16:20 +01:00
Arnd Bergmann cb64babf9e More PRCM cleanups via Paul Walmsley <paul@pwsan.com>:
Second set of OMAP PRCM cleanups for 3.8.
 
 These patches remove the use of omap_prcm_get_reset_sources() from the
 OMAP watchdog driver, and remove mach-omap2/prcm.c and
 plat-omap/include/plat/prcm.h.
 
 Basic test logs for this branch on top of Tony's cleanup-prcm branch
 at commit 7fc54fd308 are here:
 
     http://www.pwsan.com/omap/testlogs/prcm_cleanup_b_3.8/20121108151646/
 
 However, cleanup-prcm at 7fc54fd3 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_prcm_cleanup_b_3.8/20121108151930/
 
 which indicate that the series tests cleanly.
 
 This second pull request updates one of the patches which broke
 with rmk's allnoconfigs, and also updates the tag description to
 indicate that 7fc54fd3 is building cleanly here.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQoY0GAAoJEBvUPslcq6Vza0MQAI0idVoOclIHCC63tpc58YWA
 BpD5OLg4yRu0RUFS1CI/Fq5d+9PfYUspgaWja3TTgUy0EHRDVUUFRaxJdpWdl2NF
 gX7BCuhnQenznTbCE80nEmxvsh7U/dfvs+JYUK2PriypU61f1+TnSu9ZxTRvDJOx
 vbo1cfsioVcLfnBPSDSQVJ1fufbafklpeQkDNeRI8UDsCVeXwnxhNsXB3utoJMf0
 5gaDaCdRBoimkLnAaLi41OnHYC7IbNCnl/VX0i/xffROsINfL7LDkBPfUOnR5vle
 jTCV49UEB/P5ekk2cvKKj8IOQZdimiCppWMLit6DObX7LbltTKuXx6T0PclgxQ14
 hhav5O+f8NYA4yDAY/xxPlTvShMr8rQcYV6pg1G1OgD+dcq7cbbWNJAvbUJ03hH8
 dqZ+ypLYkazb3Mm5XtpFr47gkoaFnCQbgZLXpjJ8+L01aGNrF2L6aE789So1N81+
 X1s0ENjRxzDLNcqwxqhcoph0YQe7GlyiviYb7ev25MTSC3/TjrupTViZbKocZmLt
 Ad9m4SOktbHthAw0jdA48vOmPiSvmYzFiqzMhz/ryeNbyyV6rRxe5w4JUjPzHPxc
 U7NraSGIAzpqM3EKEp7Rb0yOfh6sGzML/FH9bS25+Rv37yKW0huc6ENIRgatZpY2
 blLzsxaKfQgLeqKT82mj
 =tS2z
 -----END PGP SIGNATURE-----

Merge tag 'omap-for-v3.8/cleanup-prcm-part2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/cleanup

From Tony Lindgren <tony@atomide.com>:

More PRCM cleanups via Paul Walmsley <paul@pwsan.com>:

Second set of OMAP PRCM cleanups for 3.8.

These patches remove the use of omap_prcm_get_reset_sources() from the
OMAP watchdog driver, and remove mach-omap2/prcm.c and
plat-omap/include/plat/prcm.h.

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

    http://www.pwsan.com/omap/testlogs/prcm_cleanup_b_3.8/20121108151646/

However, cleanup-prcm at 7fc54fd3 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_prcm_cleanup_b_3.8/20121108151930/

which indicate that the series tests cleanly.

This second pull request updates one of the patches which broke
with rmk's allnoconfigs, and also updates the tag description to
indicate that 7fc54fd3 is building cleanly here.

* tag 'omap-for-v3.8/cleanup-prcm-part2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: (27 commits)
  ARM: OMAP2: Fix compillation error in cm_common
  ARM: OMAP2+: PRCM: remove obsolete prcm.[ch]
  ARM: OMAP2+: hwmod: call to _omap4_disable_module() should use the SoC-specific call
  ARM: OMAP2+: PRCM: consolidate PRCM-related timeout macros
  ARM: OMAP2+: PRCM: split and relocate the PRM/CM globals setup
  ARM: OMAP2+: PRCM: remove omap2_cm_wait_idlest()
  ARM: OMAP2+: CM/clock: convert _omap2_module_wait_ready() to use SoC-independent CM functions
  ARM: OMAP2xxx: APLL/CM: convert to use omap2_cm_wait_module_ready()
  ARM: OMAP2+: board files: use SoC-specific system restart functions
  ARM: OMAP2+: PRCM: create SoC-specific chip restart functions
  ARM: OMAP2xxx: clock: move virt_prcm_set code into clkt2xxx_virt_prcm_set.c
  ARM: OMAP2xxx: clock: remove global 'dclk' variable
  ARM: OMAP2/3: PRM: add SoC reset functions (using the CORE DPLL method)
  ARM: OMAP2+: common: remove mach-omap2/common.c globals and map_common_io code
  ARM: OMAP2+: PRCM: remove omap_prcm_get_reset_sources()
  watchdog: OMAP: use standard GETBOOTSTATUS interface; use platform_data fn ptr
  ARM: OMAP2+: WDT: move init; add read_reset_sources pdata function pointer
  ARM: OMAP1: CGRM: fix omap1_get_reset_sources() return type
  ARM: OMAP2+: PRM: create PRM reset source API for the watchdog timer driver
  ARM: OMAP1: create read_reset_sources() function (for initial use by watchdog)
  ...

Conflicts:
	arch/arm/mach-omap2/cm33xx.c
	arch/arm/mach-omap2/io.c
	arch/arm/mach-omap2/prm_common.c

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2012-11-15 17:08:51 +01:00
Mugunthan V N 70384a6af0 ARM: OMAP3+: hwmod: Add AM33XX HWMOD data for davinci_mdio module
This patch adds hwmod entry for davinci MDIO module,
creating parent<->child relationship between CPSW and MDIO module.

This Parent-child relation is required in order to use common resources
like, clock, but still maintaining the logical separation between them.

CPGMAC SubSystem consist of various sub-modules, like, mdio, cpdma,
cpsw, etc... These sub-modules are also used in some of Davinci
family of devices, so separate and independent platform devices &
drivers for CPSW and MDIO is implemented.
In case of AM33XX, the resources are shared and common register
bit-field is provided to control module/clock enable/disable,
makes it difficult to handle common resources from both drivers.

So the solution is, create parent<->child relationship between
CPGMAC & MDIO modules.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-11-14 22:09:06 -05:00
Kevin Hilman 74d29168e9 ARM: OMAP2+: voltage: fixup oscillator handling when CONFIG_PM=n
commit 908b75e8 (ARM: OMAP: add support for oscillator setup) added a new
API for oscillator setup, but is broken when CONFIG_PM=n.

The new functions have dummy definitions when CONFIG_PM=n, but also have
full implementations available, which conflict.

To fix, wrap the PM implmentations in #ifdef CONFIG_PM.

Cc: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-11-14 17:21:15 -08:00
Kevin Hilman 9364073587 ARM: OMAP4: PM: fix errata handling when CONFIG_PM=n
commit c9621844 (ARM: OMAP4: PM: add errata support) introduced errata
handling for OMAP4, but was broken when CONFIG_PM=n.

When CONFIG_PM=n, pm44xx.c is not compiled, yet that is where pm44xx_errata
is defined.  However, these errata are needed for the SMP boot/hotplug case
also, and are primarily used in omap-smp.c.

Move the definition of pm44xx_errata to omap-smp.c so that it's available
even in the CONFIG_PM=n case.

Cc: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-11-14 17:06:20 -08:00
Tony Lindgren 6515b0f75a Merge branch 'omap-for-v3.8/pm' into omap-for-v3.8/pm-part2 2012-11-14 14:50:36 -08:00
Ivan Khoronzhuk 42a1cc9c0e ARM: OMAP4: ID: Improve features detection and check
Replaces several flags bearing the same meaning. There is no need
to set flags due to different omap types here, it can be checked
in appropriate places as well.

Cc: Tony Lindgren <tony@atomide.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-omap@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Acked-by: Nishanth Menon <nm@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-11-14 12:10:37 -08:00
Tony Lindgren 0b4b61c0dc ARM: OMAP: Fix compile for OMAP_PM_NOOP if PM is not selected
Commit 6e740f9a8 (ARM: OMAP: Move omap-pm-noop.c local to mach-omap2)
moved omap-pm-noop to be local to mach-omap2. However, the makefile
entry got placed within ifeq ($(CONFIG_PM),y) which was not the
case earlier.

Fix the issue by moving it out of the ifeq ($(CONFIG_PM),y) in
the makefile as these stubs are needed also when PM is not set.

Reported-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-11-14 09:41:54 -08:00
Shubhrajyoti D 2c88ab8c5a ARM: i2c: omap: Remove the i207 errata flag
The commit [i2c: omap: use revision check for OMAP_I2C_FLAG_APPLY_ERRATA_I207]
uses the revision id instead of the flag. So the flag can be safely removed.

Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
2012-11-14 17:44:40 +01:00
Tero Kristo 4fd7a41233 ARM: OMAP4: USB: power down MUSB PHY during boot
Commit c9e4412ab8 removed all of the USB
PHY functions for OMAP4, but this causes a problem with core retention
as the MUSB module remains enabled if omap-usb2 phy driver is not used.
This keeps the USB DPLL enabled and prevents l3_init pwrdm from idling.

Fixed by adding a minimal function back that disables the USB PHY during
boot.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-11-13 15:57:09 -08:00
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
Tomi Valkeinen e8ead7b50d OMAP: RX51: remove use of vram
As omapfb no longer uses omap specific vram allocator we can remove the
vram pre-allocation from rx51 board file.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
2012-11-13 09:52:29 +02: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
Jon Hunter b153883219 ARM: OMAP: Remove __omap_dm_timer_set_source function
The __omap_dm_timer_set_source() function is only used by the system timer
(clock-events and clock-source) code for OMAP2+ devices. Therefore, we can
remove this code from the dmtimer driver and move it to the system timer
code for OMAP2+ devices.

The current __omap_dm_timer_set_source() function calls clk_disable() before
calling clk_set_parent() and clk_enable() afterwards. We can avoid these calls
to clk_disable/enable by moving the calls to omap_hwmod_setup_one() and
omap_hwmod_enable() to after the call to clk_set_parent() in
omap_dm_timer_init_one().

The function omap_hwmod_setup_one() will enable the timers functional clock
and therefore increment the use-count of the functional clock to 1.
clk_set_parent() will fail if the use-count is not 0 when called. Hence, if
omap_hwmod_setup_one() is called before clk_set_parent(), we will need to call
clk_disable() before calling clk_set_parent() to decrement the use-count.
Hence, avoid these extra calls to disable and enable the functional clock by
moving the calls to omap_hwmod_setup_one() and omap_hwmod_enable() to after
clk_set_parent().

We can also remove the delay from the __omap_dm_timer_set_source() function
because enabling the clock will now be handled via the HWMOD framework by
calling omap_hwmod_setup_one(). Therefore, by moving the calls to
omap_hwmod_setup_one() and omap_hwmod_enable() to after the call to
clk_set_parent(), we can simply replace __omap_dm_timer_set_source() with
clk_set_parent().

It should be safe to move these hwmod calls to later in the
omap_dm_timer_init_one() because other calls to the hwmod layer that occur
before are just requesting resource information.

Testing includes boot testing on OMAP2420 H4, OMAP3430 SDP and OMAP4430 Blaze
with the following configurations:
1. CONFIG_OMAP_32K_TIMER=y
2. CONFIG_OMAP_32K_TIMER=y and boot parameter "clocksource=gp_timer"
3. CONFIG_OMAP_32K_TIMER not set
4. CONFIG_OMAP_32K_TIMER not set and boot parameter "clocksource=gp_timer"

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
2012-11-12 16:23:57 -06:00
Jon Hunter 10759e823c ARM: OMAP2+: Don't use __omap_dm_timer_reset()
Currently OMAP2+ devices are using the function __omap_dm_timer_reset() to
configure the clock-activity, idle, wakeup-enable and auto-idle fields in the
timer OCP_CFG register. The name of the function is mis-leading because this
function does not actually perform a reset of the timer.

For OMAP2+ devices, HWMOD is responsible for reseting and configuring the
timer OCP_CFG register. Therefore, do not use __omap_dm_timer_reset() for
OMAP2+ devices and rely on HWMOD. Furthermore, some timer instances do not
have the fields clock-activity, wakeup-enable and auto-idle and so this
function could configure the OCP_CFG register incorrectly.

Currently HWMOD is not configuring the clock-activity field in the OCP_CFG
register for timers that have this field. Commit 0f0d080 (ARM: OMAP: DMTimer:
Use posted mode) configures the clock-activity field to keep the f-clk enabled
so that the wake-up capability is enabled. Therefore, add the appropriate flags
to the timer HWMOD structures to configure this field in the same way.

For OMAP2/3 devices all dmtimers have the clock-activity field, where as for
OMAP4 devices, only dmtimer 1, 2 and 10 have the clock-activity field.

Verified on OMAP2420 H4, OMAP3430 Beagle and OMAP4430 Panda that HWMOD is
configuring the dmtimer OCP_CFG register as expected for clock-events timer.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
2012-11-12 16:23:52 -06:00
Jon Hunter f3a13e7246 ARM: OMAP2/3: Define HWMOD software reset status for DMTIMERs
For OMAP2/3 devices, the HWMOD data does not define a software reset status
field for the DMTIMERs. Therefore, when HWMOD performs a soft-reset of the
DMTIMER we don't check and wait for the reset to complete. For OMAP2/3 devices,
the software reset status for a DMTIMER can be read from bit 0 of the DMTIMER
TISTAT register (referred to as the SYSS register in HWMOD). Add the
appropriate HWMOD definitions so that HWMOD will check the software reset
status when performing a software reset of the DMTIMER.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
2012-11-12 16:23:51 -06:00
Jon Hunter 725a8fe312 ARM: OMAP3: Correct HWMOD DMTIMER SYSC register declarations
Currently, the OMAP3 HWMOD data defines two TIOCP_CFG register structures
(referred to as the SYSC register in the HWMOD data) where timers 1, 2 and 10
use one of the defintions and the other timers use the other definition. For
OMAP3 devices the structure of the DMTIMER TIOCP_CFG register is the same for
all 12 instances of the DMTIMER. Please note that this is a difference between
OMAP3 and OMAP4 and could be the source of the confusion.

For OMAP3 devices, the DMTIMER TIOCP_CFG register has the fields,
clock-activity, emufree, idlemode, enwakeup, softreset and autoidle for all
12 timers. Therefore, remove one of the SYSC register definitions for the
DMTIMERs and ensure the appropriate register fields are defined for all
DMTIMERs.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
2012-11-12 16:23:50 -06:00
Jon Hunter bfd6d02112 ARM: OMAP3+: Implement timer workaround for errata i103 and i767
Errata Titles:
i103: Delay needed to read some GP timer, WD timer and sync timer
      registers after wakeup (OMAP3/4)
i767: Delay needed to read some GP timer registers after wakeup (OMAP5)

Description (i103/i767):
If a General Purpose Timer (GPTimer) is in posted mode
(TSICR [2].POSTED=1), due to internal resynchronizations, values read in
TCRR, TCAR1 and TCAR2 registers right after the timer interface clock
(L4) goes from stopped to active may not return the expected values. The
most common event leading to this situation occurs upon wake up from
idle.

GPTimer non-posted synchronization mode is not impacted by this
limitation.

Workarounds:
1). Disable posted mode
2). Use static dependency between timer clock domain and MPUSS clock
    domain
3). Use no-idle mode when the timer is active

Workarounds #2 and #3 are not pratical from a power standpoint and so
workaround #1 has been implemented. Disabling posted mode adds some CPU
overhead for configuring and reading the timers as the CPU has to wait
for accesses to be re-synchronised within the timer. However, disabling
posted mode guarantees correct operation.

Please note that it is safe to use posted mode for timers if the counter
(TCRR) and capture (TCARx) registers will never be read. An example of
this is the clock-event system timer. This is used by the kernel to
schedule events however, the timers counter is never read and capture
registers are not used. Given that the kernel configures this timer
often yet never reads the counter register it is safe to enable posted
mode in this case. Hence, for the timer used for kernel clock-events,
posted mode is enabled by overriding the errata for devices that are
impacted by this defect.

For drivers using the timers that do not read the counter or capture
registers and wish to use posted mode, can override the errata and
enable posted mode by making the following function calls.

	__omap_dm_timer_override_errata(timer, OMAP_TIMER_ERRATA_I103_I767);
	__omap_dm_timer_enable_posted(timer);

Both dmtimers and watchdogs are impacted by this defect this patch only
implements the workaround for the dmtimer. Currently the watchdog driver
does not read the counter register and so no workaround is necessary.

Posted mode will be disabled for all OMAP2+ devices (including AM33xx)
using a GP timer as a clock-source timer to guarantee correct operation.
This is not necessary for OMAP24xx devices but the default clock-source
timer for OMAP24xx devices is the 32k-sync timer and not the GP timer
and so should not have any impact. This should be re-visited for future
devices if this errata is fixed.

Confirmed with Vaibhav Hiremath that this bug also impacts AM33xx
devices.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
2012-11-12 16:23:49 -06:00
Jon Hunter 971d025448 ARM: OMAP: Add DMTIMER definitions for posted mode
For OMAP2+ devices, when using DMTIMERs for system timers (clock-events and
clock-source) the posted mode configuration of the timers is used. To allow
the compiler to optimise the functions for configuring and reading the system
timers, the posted flag variable is hard-coded with the value 1. To make it
clear that posted mode is being used add some definitions so that it is more
readable.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
2012-11-12 16:23:48 -06:00
Kevin Hilman 1ef43369c6 ARM: OMAP4: TWL: mux sys_drm_msecure as output for PMIC
On OMAP4 boards using the TWL6030 PMIC, the sys_drm_msecure is
connected to the MSECURE input of the TWL6030 PMIC.  This signal
controls the secure-mode operation of the PMIC.  If its not mux'd
correctly, some functionality of the PMIC will not be accessible since
the PMIC will be in secure mode.

For example, if the TWL RTC is in secure mode, most of its registers
are read-only, meaning (re)programming the RTC (e.g. for wakeup from
suspend) will fail.

To fix, ensure the signal is properly mux'd as output when TWL is
intialized.

This fix is required when using recent versions of u-boot (>= v2012.04.01)
since u-boot is no longer setting the default mux for this pin.

Signed-off-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-11-12 14:11:47 -08:00
Wei Yongjun e05cf58d50 ARM: OMAP2+: remove duplicated include from board-overo.c
Remove duplicated include.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-11-12 14:02:48 -08:00
Arnd Bergmann 8a6ff8a0a2 arm: at91: mach header cleanup
This first patch serie start the cleanup of the header in mach
 by moving all the platform data to include/linux/platform_data
 
 and move the board header and drivers header next to them
 
 Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
 Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQmQMyAAoJEOrjwV5ZMRf2N8kP/1J2DI26zhNWGIdiTPFX/HXG
 o03lvElDKDDyNtC87gU2DnYkOdjFVRpagZxv089whDs4Lt22A8ClaxEFca9K1oPg
 XO0NtuHbTL3wGlPLJH4C90bpQWY4FyIQLMfPaMeifrP1OpRkeSWAYKfFUB/wOtRC
 KWNl+WmpBt9JN9H1RIezYxpRteC+wUBKpYVZkRdT3OkQ4/oMqDIWzZqkMCTKy+Bb
 Ucs9ZFqkJ/5fSGYjHLG34VpbepFKgCqeDVugz2v+7SHvIkl0/XbRhGOdxJek54GD
 0OW8Gg5Utw47YQ1uYDR3IM00cod41/l9NYMKZm/DIEUdvNP3Mp+/X0Knehov+O+7
 7Xs8eSzBHE0mRAx2as71av08PNptNVAcJh/UAO8PWE5yLGivGrp8kQWzJItnl2ma
 8GmIK26bmMAqGuR+wANrT/pCCW5kxALE8L1JnCMzjhv5TvKE88mjUZuVmNnZGCdY
 SE/hotD2c2asZ15zv52wrGGpOALW6ZaQdlRafuDli1/yHeJ1uPOWec7NKnzytDpL
 A0r22RDyvqR7N2hunFu2aO757ojAsIWS8qfF2Yztr0UaE6rC+aoYKBwTfzvC5yhh
 gaurkH8jCUJ9EHw+GBs1pZQK9wWaK7MrlNj7/mVZ1iXErWCHZYcYNbxlx/xAFzUv
 IoHsmg6lL5By3p3nvElG
 =c5hx
 -----END PGP SIGNATURE-----

Merge tag 'for-3.8-at91_header_clean' of git://github.com/at91linux/linux-at91 into next/headers

From Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>:
arm: at91: mach header cleanup

This first patch serie start the cleanup of the header in mach
by moving all the platform data to include/linux/platform_data

and move the board header and drivers header next to them

* tag 'for-3.8-at91_header_clean' of git://github.com/at91linux/linux-at91:
  arm: at91: move at91rm9200 rtc header in drivers/rtc
  arm: at91: move reset controller header to arm/arm/mach-at91
  arm: at91: move pit define to the driver
  arm: at91: move at91_shdwc.h to arch/arm/mach-at91
  arm: at91: move board header to arch/arm/mach-at91
  arn: at91: move at91_tc.h to arch/arm/mach-at91
  arm: at91 move at91_aic.h to arch/arm/mach-at91
  arm: at91 move board.h to arch/arm/mach-at91
  arm: at91: move platfarm_data to include/linux/platform_data/atmel.h
  arm: at91: drop machine defconfig

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2012-11-12 22:54:08 +01:00
Arnd Bergmann 65829ef5a0 These changes deal with the issues of relative includes
introduced by the earlier clean-up and clean up few more
 things for enabling multiplatform support.
 
 The multiplatform kernel has been booted on omaps on
 top of this branch with the work-in-progress patches
 applied manually.
 
 We cannot yet enable the multiplatform support though.
 We still need the common clock framework patches, some
 solution for dma-omap.h, and serial-omap.h moved before
 we can enable it.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQmaU8AAoJEBvUPslcq6VzbfcQAOEIQpv2zQz68euDDkCndBcG
 rVjDIyAM/wgbxgdqK66FQvCZefQhSUBimBmjqagVwRh/2lIDZOfhIS98N5eMbJEQ
 3UJUuOAPJQLmwR4zyKgbi/hdWZDEjnYvMJEmVSeSpXSmRO844ggtc9F2K22ouQ5m
 CJ0WZE6p55v25bMLDETudLlzCfhrSGiApwV09IUxFAd9va7UeXibYt83oh1A6joo
 U0i6sGbMgxR3uLi/7q7Wlm6dbCVU5N8+EtJ2L/tkoAQDHb+iLmkC8n3N3KPBkrEu
 KpS7o3zuCDS3X6m8bD4w1j8WVeNX3ERA9avWMSBpfTQQcj0OvTPZixe7KC9WwT/4
 nI0bAKQ/JWmFV+Ibo5jtVS151XeEG6ggap6aa+F3wYpkORY+jWcX0djW+1NDwScB
 nGDcRI1n15jogoJJC9SB5wFW7K3wgi6Sb3Mo7nvNVvvQcHXpxiadujPP+tiHm7mn
 mDoMJYHa0oI9jlWPSrAC5E8rfSR1NYRv7A5BLkakGXErEED+MByJ84PR3q4xDivx
 B58HgsXTbJkQQug6o5yFK2vCKQW1Vsi0cdKrm3kY1JuLLfNMXbPFpAihxoLZ9Rp5
 oDTdPpslgdEMMvg346q7XLFYiG9F5Zoz60MaUpYBa5EsmA16WB2ZT0t5bLIpxglx
 0duNMqDZYsBrKc3aYjw3
 =8Nz+
 -----END PGP SIGNATURE-----

Merge tag 'omap-for-v3.8/cleanup-headers-prepare-multiplatform-v3-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/headers

From Tony Lindgren <tony@atomide.com>:

These changes deal with the issues of relative includes
introduced by the earlier clean-up and clean up few more
things for enabling multiplatform support.

The multiplatform kernel has been booted on omaps on
top of this branch with the work-in-progress patches
applied manually.

We cannot yet enable the multiplatform support though.
We still need the common clock framework patches, some
solution for dma-omap.h, and serial-omap.h moved before
we can enable it.

* tag 'omap-for-v3.8/cleanup-headers-prepare-multiplatform-v3-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: OMAP: Remove omap_init_consistent_dma_size()
  ARM: OMAP: Remove NEED_MACH_GPIO_H
  ARM: OMAP: Remove unnecessary mach and plat includes
  ARM: OMAP2+: Fix relative includes for serial.h
  ARM: OMAP: Fix relative includes for fpga.h
  ARM: OMAP1: Remove relative includes
  ARM: OMAP: Remove cpu_is_omap usage from plat-omap/dma.c
  ARM: OMAP: Fix relative includes for debug-devices.h
  ARM: OMAP: Remove plat-omap/common.h
  ARM: OMAP: Move omap-pm-noop.c local to mach-omap2
  ARM: OMAP: Fix relative includes for shared i2c.h file
  ARM: OMAP: Make plat-omap/i2c.c port checks local
  ARM: OMAP: Move omap2+ specific parts of sram.c to mach-omap2
  ARM: OMAP: Move omap1 specific code to local sram.c
  ARM: OMAP: Introduce common omap_map_sram() and omap_sram_reset()
  ARM: OMAP: Split sram.h to local headers and minimal shared header
  ARM: OMAP1: usb: fix sparse warnings

Conflicts:
	arch/arm/mach-omap2/cm33xx.c

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2012-11-12 22:53:22 +01:00
Peter Ujfalusi cc4b1e24b9 ARM: OMAP2: Fix compillation error in cm_common
Fixes the following error:
  CC      arch/arm/mach-omap2/cm_common.o
arch/arm/mach-omap2/cm_common.c: In function ‘cm_register’:
arch/arm/mach-omap2/cm_common.c:42:11: error: ‘EINVAL’ undeclared (first use in this function)
arch/arm/mach-omap2/cm_common.c:42:11: note: each undeclared identifier is reported only once for each function it appears in
arch/arm/mach-omap2/cm_common.c:45:11: error: ‘EEXIST’ undeclared (first use in this function)
arch/arm/mach-omap2/cm_common.c: In function ‘cm_unregister’:
arch/arm/mach-omap2/cm_common.c:66:11: error: ‘EINVAL’ undeclared (first use in this function)
make[1]: *** [arch/arm/mach-omap2/cm_common.o] Error 1
make: *** [arch/arm/mach-omap2] Error 2

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-11-12 13:42:46 -08:00
Arnd Bergmann c9af5b76ef Minor OMAP PM and hwmod fixes for v3.7-rc series via
Kevin Hilman and Paul Walmsley.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQmXAHAAoJEBvUPslcq6Vz3GUP/RRDpRcsJUh0wQMA+MYDdPJf
 dVcYYczUPn7LCZEXsWVHiwOA0BxR+TQ1N7trUyGkj1cgGo3ImUatDHT9Czy1zZQs
 8fpb+2kkNoxhEeWkxYT6LZZ+RuwGfo6mruJSCX1ZCf8oblW8QqduNLjCJGViEc/J
 WFuuFb+ucSvqJWsD5L3Bma4/rkYhAx20MjoLWEh69WUUdVip1/YTZCT9ui7wRFin
 afvq2USSEacQBaPbY+rMOOJU13YK9pNLU5+kgiRyoQ63BIoI4Wl1smDa0NoyYoFO
 S8cIekRtXZQTUCp+r4IDz5ZTJ24Lu7ywMaawrQlHuKShxLaPTHJZAKSxcCg0pEdc
 gDj1FJ65PczSMryos6WR6M0kqInfJK8SGlGVUe9y3wV5kFKOrc/G3e1Vi8/xbBFn
 J9dkriQJ5Xf0w4VpfY4yy1TAQAWnHPunucFUMLKUXWwAnk4eSxRgz/zZBvj7xbey
 6oNre4W/fHXnF8YE1wLIsrqQJq9pOIQc9jz22/knjF0jjhQU1alFyJ6MhyINIH0o
 gJv1rO+VWfhsG/ECYd01E7ChG+9bATWjJpPHHB6brC24VLNgcDUlrJurvuGhNU8d
 5P+/6OKenBj+hHWuiWIpFY+jIkG9NRcq2QIPEkFVIvfDHZ34H5FTB89d1Kw3hLSX
 /0h4NvAA4aK8oJuItOhI
 =pyxl
 -----END PGP SIGNATURE-----

Merge tag 'omap-for-v3.7-rc4/fixes-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes

From Tony Lindgren <tony@atomide.com>:

Minor OMAP PM and hwmod fixes for v3.7-rc series via
Kevin Hilman and Paul Walmsley.

* tag 'omap-for-v3.7-rc4/fixes-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: OMAP4: PM: fix regulator name for VDD_MPU
  ARM: OMAP4: hwmod data: do not enable or reset the McPDM during kernel init
  ARM: OMAP2+: hwmod: add flag to prevent hwmod code from touching IP block during init
  ARM: OMAP: hwmod: wait for sysreset complete after enabling hwmod
  ARM: OMAP2+: clockdomain: Fix OMAP4 ISS clk domain to support only SWSUP
  ARM: OMAP2+: PM: add missing newline to VC warning message

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2012-11-12 22:41:39 +01: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
Tony Lindgren edf8dde393 Merge branch 'linus' into omap-for-v3.8/cleanup-headers-prepare-multiplatform-v3 2012-11-09 14:58:01 -08:00
Tony Lindgren f56f52e02a Merge branch 'omap-for-v3.8/cleanup-headers-prepare-multiplatform-v3' into omap-for-v3.8/dt
Conflicts:
	arch/arm/plat-omap/dmtimer.c

Resolved as suggested by Jon Hunter.
2012-11-09 14:54:17 -08:00
Afzal Mohammed 47acde1672 ARM: OMAP2+: tusb6010: generic timing calculation
Generic gpmc timing calculation helper is available now, use
it instead of custom timing calculation.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
2012-11-09 18:07:23 +05:30
Afzal Mohammed ac2d9ae194 ARM: OMAP2+: smc91x: generic timing calculation
Generic gpmc timing calculation helper is available now, use
it instead of custom timing calculation.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
2012-11-09 18:07:22 +05:30
Afzal Mohammed 4f4426f900 ARM: OMAP2+: onenand: generic timing calculation
Generic gpmc timing calculation helper is available now, use
it instead of custom timing calculation.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
2012-11-09 18:07:12 +05:30
Afzal Mohammed 246da26d37 ARM: OMAP2+: gpmc: generic timing calculation
Presently there are three peripherals that gets it timing
by runtime calculation. Those peripherals can work with
frequency scaling that affects gpmc clock. But timing
calculation for them are in different ways.

Here a generic runtime calculation method is proposed. Input
to this function were selected so that they represent timing
variables that are present in peripheral datasheets. Motive
behind this was to achieve DT bindings for the inputs as is.
Even though a few of the tusb6010 timings could not be made
directly related to timings normally found on peripherals,
expressions used were translated to those that could be
justified.

There are possibilities of improving the calculations, like
calculating timing for read & write operations in a more
similar way. Expressions derived here were tested for async
onenand on omap3evm (as vanilla Kernel does not have omap3evm
onenand support, local patch was used). Other peripherals,
tusb6010, smc91x calculations were validated by simulating
on omap3evm.

Regarding "we_on" for onenand async, it was found that even
for muxed address/data, it need not be greater than
"adv_wr_off", but rather could be derived from write setup
time for peripheral from start of access time, hence would
more be in line with peripheral timings. With this method
it was working fine. If it is required in some cases to
have "we_on" same as "wr_data_mux_bus" (i.e. greater than
"adv_wr_off"), another variable could be added to indicate
it. But such a requirement is not expected though.

It has been observed that "adv_rd_off" & "adv_wr_off" are
currently calculated by adding an offset over "oe_on" and
"we_on" respectively in the case of smc91x. But peripheral
datasheet does not specify so and so "adv_rd(wr)_off" has
been derived (to be specific, made ignorant of "oe_on" and
"we_on") observing datasheet rather than adding an offset.
Hence this generic routine is expected to work for smc91x
(91C96 RX51 board). This was verified on smsc911x (9220 on
OMAP3EVM) - a similar ethernet controller.

Timings are calculated in ps to prevent rounding errors and
converted to ns at final stage so that these values can be
directly fed to gpmc_cs_set_timings(). gpmc_cs_set_timings()
would be modified to take ps once all custom timing routines
are replaced by the generic routine, at the same time
generic timing routine would be modified to provide timings
in ps. struct gpmc_timings field types are upgraded from
u16 => u32 so that it can hold ps values.

Whole of this exercise is being done to achieve driver and
DT conversion. If timings could not be calculated in a
peripheral agnostic way, either gpmc driver would have to
be peripheral gnostic or a wrapper arrangement over gpmc
driver would be required.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
2012-11-09 18:07:11 +05:30
Afzal Mohammed 559d94b00c ARM: OMAP2+: gpmc: handle additional timings
Configure busturnaround, cycle2cycledelay, waitmonitoringtime,
clkactivationtime in gpmc_cs_set_timings(). This is done so
that boards can configure these parameters of gpmc in Kernel
instead of relying on bootloader. Also configure bool type
timings like extradelay.

This needed change to the existing users that were configuring
clk activation time and extra delay by directly writing to
registers. Thanks to Tony for making me aware of users of clk
activation and being kind enough to test the modified one.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
2012-11-09 18:07:11 +05:30
Jon Hunter 2ac29a14a8 ARM: PMU: fix runtime PM enable
Commit 7be2958 (ARM: PMU: Add runtime PM Support) updated the ARM PMU code to
use runtime PM which was prototyped and validated on the OMAP devices. In this
commit, there is no call pm_runtime_enable() and for OMAP devices
pm_runtime_enable() is currently being called from the OMAP PMU code when the
PMU device is created. However, there are two problems with this:

1. For any other ARM device wishing to use runtime PM for PMU they will need
   to call pm_runtime_enable() for runtime PM to work.
2. When booting with device-tree and using device-tree to create the PMU
   device, pm_runtime_enable() needs to be called from within the ARM PERF
   driver as we are no longer calling any device specific code to create the
   device. Hence, PMU does not work on OMAP devices that use the runtime PM
   callbacks when using device-tree to create the PMU device.

Therefore,  call pm_runtime_enable() directly from the ARM PMU driver when
registering the device. For platforms that do not use runtime PM,
pm_runtime_enable() does nothing and for platforms that do use runtime PM but
may not require it specifically for PMU, this will just add a little overhead
when initialising and uninitialising the PMU device.

Tested with PERF on OMAP2420, OMAP3430 and OMAP4460.

Acked-by: Kevin Hilman <khilman@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2012-11-09 11:37:26 +00: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
Afzal Mohammed a1bfdc6020 ARM: OMAP2+: nand: remove redundant rounding
gpmc_cs_set_timings() calculate ticks to be programmed by
rounding time in ns to next tick value. Hence remove
redundant rounding of nanosecond timing.

Signed-off-by: Afzal Mohammed <afzal@ti.com>
2012-11-09 00:59:16 +05:30
Anders Hedlund cbf6bae104 ARM: OMAP3: igep0020: Set WIFI/BT GPIO pins in correct mux mode
Setup the WIFI/BT GPIO pin muxes to enable WIFI/BT functionality.

This is needed to fix regression caused by recent versions of
u-boot that only mux essential pins.

Signed-off-by: Anders Hedlund <anders.j.hedlund@gmail.com>
Cc: Jonas Zetterberg <jozz@jozz.se>
Cc: Enric Balletbo i Serra <eballetbo@gmail.com>
Cc: Javier Martinez Canillas <martinez.javier@gmail.com>
Cc: Matthias Brugger <mbrugger@iseebcn.com>
[tony@atomide.com: updated comments to describe regression]
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-11-07 13:56:25 -08:00
Tomi Valkeinen 63d5fc0c2f OMAP: board-generic: enable DSS for panda & sdp boards
Call the non-DT omapdss setup code from board-generic if the board is
omap4-panda or omap4-sdp. This will give us working omapdss for those
boards when using DT kernel.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-11-07 13:33:49 -08:00
Tomi Valkeinen 86cf29dc5a OMAP: omap4sdp: move display init from board file to dss-common.c
Device tree support for omapdss is still some way in the future.  In an
effort to get a minimal DSS support for DT enabled kernel on selected
OMAP4 boards, we'll go for a temporary solution: We will call the same
non-DT omapdss setup code for OMAP4 SDP and Pandaboards from
board-generic.c, thus enabling DSS for those boards.

This patch moves the display setup code from board-4430sdp.c to
dss-common.c. dss-common.c will be called by the board-4430sdp.c when
running on non-DT kernel, and by board-generic.c when running on DT
enabled kernel.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-11-07 13:26:51 -08:00
Tomi Valkeinen 0191bf368f OMAP: panda: move display init from board file to dss-common.c
Device tree support for omapdss is still some way in the future.  In an
effort to get a minimal DSS support for DT enabled kernel on selected
OMAP4 boards, we'll go for a temporary solution: We will call the same
non-DT omapdss setup code for OMAP4 SDP and Pandaboards from
board-generic.c, thus enabling DSS for those boards.

This patch moves the display setup code from board-omap4panda.c to
dss-common.c. dss-common.c will be called by the board-omap4panda.c when
running on non-DT kernel, and by board-generic.c when running on DT
enabled kernel.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-11-07 13:26:27 -08:00
Kishon Vijay Abraham I 459bc971eb ARM: OMAP: ocp2scp: create omap device for ocp2scp
Platfrom device for ocp2scp is created using omap_device_build in
devices file. This is used for both omap4(musb) and omap5(dwc3).

This is needed to fix MUSB regression caused by commit c9e4412a
(arm: omap: phy: remove unused functions from omap-phy-internal.c)

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
[tony@atomide.com: updated comments for regression info]
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-11-07 10:10:28 -08:00
Kishon Vijay Abraham I 637874ddb9 ARM: OMAP4: add _dev_attr_ to ocp2scp for representing usb_phy
In order to reflect devices(usb_phy) attached to ocp2scp bus, ocp2scp
is assigned a device attribute to represent the attached devices.

This is needed to fix MUSB regression caused by commit c9e4412a
(arm: omap: phy: remove unused functions from omap-phy-internal.c)

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Benoit Cousson <b-cousson@ti.com>
[tony@atomide.com: updated comments for regression info]
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-11-07 10:10:05 -08: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
Tomi Valkeinen 6ba54ab4a4 ARM: OMAP: Remove omap_init_consistent_dma_size()
The only thing omap_init_consistent_dma_size() does is increase the
consistent DMA size if CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE is defined.
Increasing the consistent DMA size should no longer be needed with CMA
in place.

This patch removes omap_init_consistent_dma_size() and also
arch/arm/mach-omap2/io.c:omap_common_init_early() which becomes an empty
function.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
[tony@atomide.com: updated for moved dma.h]
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-11-06 16:01:19 -08:00
Rajendra Nayak 0c7018e232 ARM: OMAP4: suspend: Program all domains to retention
Remove the FIXME's in the suspend sequence since
we now intend to support system level RET support.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
2012-11-06 13:39:43 -08:00
Tony Lindgren 5dfcb3b58c Merge tag 'omap-fixes-b2-for-3.7-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/pjw/omap-pending into omap-for-v3.7-rc4/fixes 2012-11-06 09:55:20 -08:00
Tony Lindgren 55f4851a0b Merge tag 'for_3.7-rc5-fixes-pm' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into omap-for-v3.7-rc4/fixes 2012-11-06 09:53:42 -08:00
Kevin Hilman 73c503cb98 ARM: OMAP4: PM: fix regulator name for VDD_MPU
commit 24d7b40a (ARM: OMAP2+: PM: MPU DVFS: use generic CPU device for
MPU-SS) updated the regulator name used for the MPU regulator, but only
updated OMAP3, not OMAP4.  Fix the OMAP4 name as well, otherwise CPUfreq
fails to find the MPU regulator.

Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-11-05 16:30:29 -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
Tero Kristo d3965191a4 ARM: OMAP3+: voltage: remove unused volt_setup_time parameter
This is no longer needed as the ramp times are calculated from
voltage deltas + slew rates.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-11-05 15:29:17 -08:00
Tero Kristo 5a84dc5bc5 ARM: OMAP: TWL: change the vddmin / vddmax voltages to spec
As vddmin / vddmax voltages for the pmic only describe the pmic
capabilities now, change the voltages to be according to spec.
TWL data manuals give following values:

TWL4030 (SWCS019L) : VDD1: 600mV ... 1450mV, VDD2: 600mV ... 1500mV
TWL5030 (SWCS030E) : VDD1: 600mV ... 1450mV, VDD2: 600mV ... 1500mV
TWL6030 (SWCS045A) : 0V ... 2100mV

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-11-05 15:22:05 -08:00
Tero Kristo d68ff977b8 ARM: OMAP3+: voltage: use oscillator data to calculate setup times
We now use the previously defined oscillator setup / shutdown times
to calculate the register values for CLKSETUP.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-11-05 15:20:59 -08:00
Tero Kristo 085b302500 ARM: OMAP3+: vp: use new vp_params for calculating vddmin and vddmax
Now we select the vddmin and vddmax values based on both pmic and
voltage processor data, this allows usage of different power ICs.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-11-05 15:13:13 -08:00
Tero Kristo 908b75e850 ARM: OMAP: add support for oscillator setup
This contains startup and shutdown times for the oscillator. By default
use ULONG_MAX. Oscillator setup is used for calculating and setting up
latencies for sleep modes that disable oscillator.

Based on a patch from Nishanth Menon <nm@ti.com>.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-11-05 15:12:40 -08:00
Tero Kristo 9a1729cbaa ARM: OMAP4: VC: calculate ramp times
OMAP4 VC code now uses voltage deltas + slew rates for calculating
actual ramp times for voltage changes. Both retention / sleep +
off mode voltage ramp times are setup at the same time during
initialization.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-11-05 15:11:32 -08:00
Tero Kristo 27c16b7026 ARM: OMAP4: voltage: add support for VOLTSETUP_x_OFF register
OMAP4 has two VOLTSETUP registers. One is controlling retention and
sleep voltage setup times, the other one off mode setup times. Both
of these need to be setup for stable behavior of the device.
The code setting up the new register will be added in the next
patch.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-11-05 15:10:38 -08:00
Tero Kristo c589eb3869 ARM: OMAP3: VC: calculate ramp times
OMAP3 VC code now uses voltage deltas + slew rates for calculating actual
ramp times for voltage changes. Previously a static value was used.
Two calculation methods are provided: i2c_timings and off_timings.
I2C timings are used during retention or off mode transition which
is initiated over I2C, and OFF timings are used if PMIC signal
(nsleep) is used to control all the off mode voltages at the same time.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-11-05 15:08:23 -08:00
Tero Kristo 8b5d8c0d71 ARM: OMAP3+: voltage: introduce omap vc / vp params for voltagedomains
These new structs will hold the sleep voltage levels (omap_vc_params)
and voltage processor min / max voltages (omap_vp_params.) Previously
these were part of the PMIC struct, but they do not really belong there,
as they are OMAP chip specific, not PMIC specific parameters. voltdm
code is also changed to use the new structs.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-11-05 15:08:22 -08:00
Tero Kristo b254012b21 ARM: OMAP: voltage: renamed vp_vddmin and vp_vddmax fields
These are now called vddmin and vddmax, as these fields will be used
globally for selecting voltage ranges for a pmic channel, and not
only for voltage processor.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-11-05 15:03:47 -08:00
Nishanth Menon f2a0dfefec ARM: OMAP3+: PM: VP: use uV for max and min voltage limits
Every PMIC has it's own eccentricities, For example, one of the
PMIC has MSB set to 1 for a specific function - voltage enable!
using an hardcoded value specific for TWL when copied over to
such an implementation causes the system to crash as the MSB bit
was 0 and the voltage got disabled!.

Instead we use actual values and depend on the convertion routines
to abstract out the eccentricities of each PMIC.

With this, we can now move the voltages to a common location in
voltage.h as they are no longer dependent on PMICs and expect the
PMIC's conversion routines to set a cap if the voltage is out of
reach for the PMIC.

Reported-by: Jon Hunter <jon-hunter@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Vishwanath BS <vishwanath.bs@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-11-05 15:03:34 -08:00
Colin Cross cd8ce15903 ARM: OMAP4: retrigger localtimers after re-enabling gic
'Workaround for ROM bug because of CA9 r2pX gic control'
register change disables the gic distributor while the secondary
cpu is being booted.  If a localtimer interrupt on the primary cpu
occurs when the distributor is turned off, the interrupt is lost,
and the localtimer never fires again.

Make the primary cpu wait for the secondary cpu to reenable the
gic distributor (with interrupts off for safety), and then
check if the pending bit is set in the localtimer but not the
gic.  If so, ack it in the localtimer, and reset the timer with
the minimum timeout to trigger a new timer interrupt.

Signed-off-by: Colin Cross <ccross@android.com>
[s-jan@ti.com: adapted to k3.4 + validated functionality]
Signed-off-by: Sebastien Jan <s-jan@ti.com>
[t-kristo@ti.com: dropped generic ARM kernel exports from the code, rebased
 to mainline]
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-11-05 14:26:43 -08:00
Santosh Shilimkar ff999b8a09 ARM: OMAP4460: Workaround for ROM bug because of CA9 r2pX GIC control register change.
On OMAP4+ devices, GIC register context is lost when MPUSS hits
the OSWR(Open Switch Retention). On the CPU wakeup path, ROM code
gets executed and one of the steps in it is to restore the
saved context of the GIC. The ROM Code GIC distributor restoration
is split in two parts: CPU specific register done by each CPU and
common register done by only one CPU.

Below is the abstract flow.

...............................................................
- MPUSS in OSWR state.
- CPU0 wakes up on the event(interrupt) and start executing ROM code.

[..]

- CPU0 executes "GIC Restoration:"

[...]

- CPU0 swicthes to non-secure mode and jumps to OS resume code.

[...]

- CPU0 is online in OS
- CPU0 enables the GIC distributor. GICD.Enable Non-secure = 1
- CPU0 wakes up CPU1 with clock-domain force wakeup method.
- CPU0 continues it's execution.
[..]

- CPU1 wakes up and start executing ROM code.

[..]

- CPU1 executes "GIC Restoration:"

[..]

- CPU1 swicthes to non-secure mode and jumps to OS resume code.

[...]

- CPU1 is online in OS and start executing.
[...]   -

GIC Restoration: /* Common routine for HS and GP devices */
{
       if (GICD != 1)  { /* This will be true in OSWR state */
               if (GIC_SAR_BACKUP_STATE == SAVED)
                       - CPU restores GIC distributor
               else
                       - reconfigure GIC distributor to boot values.

               GICD.Enable secure = 1
       }

       if (GIC_SAR_BACKUP_STATE == SAVED)
               - CPU restore its GIC CPU interface registers if saved.
       else
               - reconfigure its GIC CPU interface registers to boot
                       values.
}
...............................................................

So as mentioned in the flow, GICD != 1 condition decides how
the GIC registers are handled in ROM code wakeup path from
OSWR. As evident from the flow, ROM code relies on the entire
GICD register value and not specific register bits.

The assumption was valid till CortexA9 r1pX version since there
was only one banked bit to control secure and non-secure GICD.
Secure view which ROM code sees:
       bit 0 == Enable Non-secure
Non-secure view which HLOS sees:
       bit 0 == Enable secure

But GICD register has changed between CortexA9 r1pX and r2pX.
On r2pX GICD register is composed of 2 bits.
Secure view which ROM code sees:
       bit 1 == Enable Non-secure
       bit 0 == Enable secure
Non-secure view which HLOS sees:
       bit 0 == Enable Non-secure

Hence on OMAP4460(r2pX) devices, if you go through the
above flow again during CPU1 wakeup, GICD == 3 and hence
ROM code fails to understand the real wakeup power state
and reconfigures GIC distributor to boot values. This is
nasty since you loose the entire interrupt controller
context in a live system.

The ROM code fix done on next OMAP4 device (OMAP4470 - r2px) is to
check "GICD.Enable secure != 1" for GIC restoration in OSWR wakeup path.

Since ROM code can't be fixed on OMAP4460 devices, a work around
needs to be implemented. As evident from the flow, as long as
CPU1 sees GICD == 1 in it's wakeup path from OSWR, the issue
won't happen. Below is the flow with the work-around.

...............................................................
- MPUSS in OSWR state.
- CPU0 wakes up on the event(interrupt) and start executing ROM code.

[..]

- CPU0 executes "GIC Restoration:"

[..]

- CPU0 swicthes to non-secure mode and jumps to OS resume code.

[..]

- CPU0 is online in OS.
- CPU0 does GICD.Enable Non-secure = 0
- CPU0 wakes up CPU1 with clock domain force wakeup method.
- CPU0 waits for GICD.Enable Non-secure = 1
- CPU0 coninues it's execution.
[..]

- CPU1 wakes up and start executing ROM code.

[..]

- CPU1 executes "GIC Restoration:"

[..]

- CPU1 swicthes to non-secure mode and jumps to OS resume code.

[..]

- CPU1 is online in OS
- CPU1 does GICD.Enable Non-secure = 1
- CPU1 start executing
[...]
...............................................................

With this procedure, the GIC configuration done between the
CPU0 wakeup and CPU1 wakeup will not be lost but during this
short windows, the CPU0 will not receive interrupts.

The BUG is applicable to only OMAP4460(r2pX) devices.
OMAP4470 (also r2pX) is not affected by this bug because
ROM code has been fixed.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-11-05 14:26:43 -08:00
Tero Kristo c962184459 ARM: OMAP4: PM: add errata support
Added similar PM errata flag support as omap3 has. This should be used
in similar manner, set the flags during init time, and check the flag
values during runtime.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-11-05 14:26:43 -08:00
Tony Lindgren 873e698067 ARM: OMAP: Remove NEED_MACH_GPIO_H
Omap no longer needs this option, mach/gpio.h is
empty.

Also remove mach/irqs.h from gpio-omap.h and
include it directly from the related omap1
gpio init files.

Otherwise omap2+ build fails for MULTI_PLATFORM.

Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Jarkko Nikula <jarkko.nikula@bitmer.com>
Cc: Liam Girdwood <lrg@ti.com>
Cc: alsa-devel@alsa-project.org
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-11-02 12:00:36 -07:00
Tony Lindgren 7136f8d88c ARM: OMAP: Remove unnecessary mach and plat includes
Now mach/hardware.h is empty for omap2+ and can be
removed except for plat-omap/dmtimer.c for omap1.

Also the include of mach/irqs.h can now be removed
for shared plat-omap/i2c.c as it's no longer needed.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-11-02 12:00:36 -07:00
Jon Hunter 9883f7c8dd ARM: OMAP2+: Add device-tree support for 32kHz counter
For OMAP devices, the 32kHz counter is the default clock-source for the kernel.
However, this is not the only possible clock-source the kernel can use for OMAP
devices.

When booting with device-tree, if the 32kHz counter is the desired clock-source
for the kernel, then parse the device-tree blob to ensure that the counter is
present and if so map memory for the counter using the device-tree of_iomap()
function so we are no longer reliant on the OMAP HWMOD framework to do this for
us.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
2012-11-02 13:16:31 -05:00
Jon Hunter 9725f4451a ARM: OMAP: Add DT support for timer driver
In order to add device-tree support to the timer driver the following changes
were made ...

1. Allocate system timers (used for clock-events and clock-source) based upon
   timer properties rather than using an hard-coded timer instance ID. To allow
   this a new helper function called omap_dmtimer_find_by_property() has been
   added for finding a timer with the particular properties in the device-tree
   blob. Please note that this is an internal helper function for system timers
   only to find a timer in the device-tree blob. This cannot be used by device
   drivers, another API has been added for that (see below). Timers that are
   allocated for system timers are dynamically disabled at boot time by adding
   a status property with the value "disabled" to the timer's device-tree node.

   Please note that when allocating system timers we now pass a timer ID and
   timer property. The timer ID is only be used for allocating a timer when
   booting without device-tree. Once device-tree migration is complete, all
   the timer ID references will be removed.

2. System timer resources (memory and interrupts) are directly obtained from
   the device-tree timer node when booting with device-tree, so that system
   timers are no longer reliant upon the OMAP HWMOD framework to provide these
   resources.

3. If DT blob is present, then let device-tree create the timer devices
   dynamically.

4. When device-tree is present the "id" field in the platform_device structure
   (pdev->id) is initialised to -1 and hence cannot be used to identify a timer
   instance. Due to this the following changes were made ...
   a). The API omap_dm_timer_request_specific() is not supported when using
       device-tree, because it uses the device ID to request a specific timer.
       This function will return an error if called when device-tree is present.
       Users of this API should use omap_dm_timer_request_by_cap() instead.
   b). When removing the DMTIMER driver, the timer "id" was used to identify the
       timer instance. The remove function has been modified to use the device
       name instead of the "id".

5. When device-tree is present the platform_data structure will be NULL and so
   check for this.

6. The OMAP timer device tree binding has the following optional parameters ...
   a). ti,timer-alwon  --> Timer is in an always-on power domain
   b). ti,timer-dsp    --> Timer can generate an interrupt to the on-chip DSP
   c). ti,timer-pwm    --> Timer can generate a PWM output
   d). ti,timer-secure --> Timer is reserved on a secure OMAP device
   Search for the above parameters and set the appropriate timer attribute
   flags.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
2012-11-02 13:16:30 -05:00
Jon Hunter 7dd9d502b6 ARM: OMAP3: Add generic machine descriptor for boards with OMAP3 GP devices
OMAP3 devices may or may not have security features enabled. Security enabled
devices are known as high-secure (HS) and devices without security are known as
general purpose (GP).

Some OMAP3 boards, such as the OMAP3 beagle board, only use GP devices and for
GP devices there is a 12th timer available on-chip that can operate at 32kHz.
The clock for 12th timer is generated by an internal oscillator and is unique
this timer. Boards such as the beagle board use this timer as a 32kHz based
clock-events timer because early versions of the board had a hardware problem
preventing them from using other on-chip timers clocked by a external 32kHz
clock.

When booting with device-tree all OMAP3 devices use timer 1 by default for
the clock-events timer. Therefore, add a generic machine descriptor for boards
with OMAP3 GP devices so that they can use the 12th timer as the clock-events
timer instead of the default.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
2012-11-02 13:16:30 -05:00
Jon Hunter ad24bde8f1 ARM: OMAP3: Dynamically disable secure timer nodes for secure devices
OMAP3 devices may or may not have security features enabled. Security enabled
devices are known as high-secure (HS) and devices without security are known as
general purpose (GP).

For OMAP3 devices there are 12 general purpose timers available. On secure
devices the 12th timer is reserved for secure usage and so cannot be used by
the kernel, where as for a GP device it is available. We can detect the OMAP
device type, secure or GP, at runtime via an on-chip register. Today, when not
using DT, we do not register the 12th timer as a linux device if the device is
secure.

When using device tree, device tree is going to register all the timer devices
it finds in the device tree blob. To prevent device tree from registering 12th
timer on a secure OMAP3 device we can add a status property to the timer
binding with the value "disabled" at boot time. Note that timer 12 on a OMAP3
device has a property "ti,timer-secure" to indicate that it will not be
available on a secure device and so for secure OMAP3 devices, we search for
timers with this property and then disable them. Using the prom_add_property()
function to dynamically add a property was a recommended approach suggested by
Rob Herring [1].

I have tested this on an OMAP3 GP device and faking it to pretend to be a
secure device to ensure that any timers marked with "ti,timer-secure" are not
registered on boot. I have also made sure that all timers are registered as
expected on a GP device by default.

[1] http://comments.gmane.org/gmane.linux.ports.arm.omap/79203

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
2012-11-02 13:16:28 -05:00
Tony Lindgren 2c0b495b7c ARM: OMAP2+: Fix relative includes for serial.h
As discussed on linux-arm-kernel, we want to avoid
relative includes for the arch/arm/*omap* code:

http://www.spinics.net/lists/linux-omap/msg80520.html

Fix serial.h by moving it to mach/serial.h.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-10-31 15:37:14 -07:00
Tony Lindgren 8280960181 ARM: OMAP: Remove cpu_is_omap usage from plat-omap/dma.c
This code will be eventually in drivers, and for the
code in the drivers we don't want to have any cpu_is_omap
usage. Those macros should be private to arch/arm/mach-omap1
and arch/arm/mach-omap2.

To fix this, let's move the define for dma_omap2plus()
to dma-omap.h, and use the existing dma_attr passed in
the platform_data as the revision registers are what they
are.

Note that we can now also remove the relative includes
introduced by the recent clean-up patches.

Cc: Russell King <linux@arm.linux.org.uk>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-10-31 15:37:13 -07:00
Tony Lindgren 32dee01e67 ARM: OMAP: Fix relative includes for debug-devices.h
As discussed on linux-arm-kernel, we want to avoid
relative includes for the arch/arm/*omap* shared code:

http://www.spinics.net/lists/linux-omap/msg80520.html

Let's add plat/debug-devices.h for debug_card_init()
to fix the relative includes.

Note that drivers must not use this header as it will
break build for omap2+ CONFIG_MULTIPLATFORM builds.

Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-10-31 15:37:13 -07:00
Tony Lindgren 5c2e88525b ARM: OMAP: Remove plat-omap/common.h
Most of the prototypes in plat-omap/common.h are not
common to omap1 and omap2+, they are local to omap2+
and should not be in plat-omap/common.h.

The only shared function prototype in this file is
omap_init_clocksource_32k(), let's put that into
counter-32k.h.

Note that the new plat/counter-32k.h must not be
included from drivers, that will break omap2+ build
for CONFIG_MULTIPLATFORM.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-10-31 15:37:13 -07:00
Tony Lindgren 6e740f9a85 ARM: OMAP: Move omap-pm-noop.c local to mach-omap2
This code should be private to mach-omap2.

The only use for it in for omap1 has been in dmtimer.c
to check for context loss. However, omap1 does not
lose context during idle, so the code is not needed.
Further, omap1 timer has OMAP_TIMER_ALWON set, so omap1
was not hitting omap_pm_get_dev_context_loss_count()
test.

Cc: Jon Hunter <jon-hunter@ti.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-10-31 15:37:13 -07:00
Tony Lindgren 01480bad0a ARM: OMAP: Fix relative includes for shared i2c.h file
As discussed on linux-arm-kernel, we want to avoid
relative includes for the arch/arm/*omap* shared code:

http://www.spinics.net/lists/linux-omap/msg80520.html

To fix this for the shared i2c.h, let's re-introduce
a minimal plat/i2c.h.

Note that drivers must not use this header as it will
break build for omap2+ CONFIG_MULTIPLATFORM builds.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-10-31 15:37:13 -07:00
Tony Lindgren c34f7c6962 ARM: OMAP: Make plat-omap/i2c.c port checks local
The common code should not have any omap1 or omap2+
specific code, and should not need to call the cpu_is_omap
macros.

The only remaining user for cpu_is_omap macros is
omap_i2c_nr_ports(). Let's make those checks in
the omap specific implementation of omap_i2c_add_bus()
instead in order to remove cpu_is_omap usage from
the common code.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-10-31 15:37:13 -07:00
Tony Lindgren bb77209432 ARM: OMAP: Move omap2+ specific parts of sram.c to mach-omap2
Let's make the omap2+ specific parts private to mach-omap2.

This leaves just a minimal shared code into plat-omap like
it should be.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-10-31 10:14:14 -07:00
Tony Lindgren bf027ca137 ARM: OMAP: Split sram.h to local headers and minimal shared header
Most of the defines are specific to omap1 and omap2+,
and should be in the local headers. Only minimal function
prototypes need to be shared.

As discussed on linux-arm-kernel, we want to avoid
relative includes for the arch/arm/*omap* shared code:

http://www.spinics.net/lists/linux-omap/msg80520.html

So this patch re-adds a minimal plat/sram.h.

The new plat/sram.h must not be included from drivers,
that will break build for omap2+ CONFIG_MULTIPLATFORM.

Note that this patch temporarily adds two more
relative includes; Those will be removed in the
following patch.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-10-31 10:14:13 -07:00
Paul Walmsley bc05244e65 ARM: OMAP4: hwmod data: do not enable or reset the McPDM during kernel init
Resolve this kernel boot message:

omap_hwmod: mcpdm: cannot be enabled for reset (3)

The McPDM on OMAP4 can only receive its functional clock from an
off-chip source.  This source is not guaranteed to be present on the
board, and when present, it is controlled by I2C.  This would
introduce a board dependency to the early hwmod code which it was not
designed to handle.  Also, neither the driver for this off-chip clock
provider nor the I2C code is available early in boot when the hwmod
code is attempting to enable and reset IP blocks.  This effectively
makes it impossible to enable and reset this device during hwmod init.

At its core, this patch is a workaround for an OMAP hardware problem.
It should be possible to configure the OMAP to provide any IP block's
functional clock from an on-chip source.  (This is true for almost
every IP block on the chip.  As far as I know, McPDM is the only
exception.)  If the kernel cannot reset and configure IP blocks, it
cannot guarantee a sane SoC state.  Relying on an optional off-chip
clock also creates a board dependency which is beyond the scope of the
early hwmod code.

This patch works around the issue by marking the McPDM hwmod record
with the HWMOD_EXT_OPT_MAIN_CLK flag.  This prevents the hwmod
code from touching the device early during boot.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Péter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Benoît Cousson <b-cousson@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
2012-10-31 05:02:31 -06:00
Paul Walmsley 5fb3d522ef ARM: OMAP2+: hwmod: add flag to prevent hwmod code from touching IP block during init
Add HWMOD_EXT_OPT_MAIN_CLK flag to indicate that this IP block is
dependent on an off-chip functional clock that is not guaranteed to be
present during initialization.  IP blocks marked with this flag are
left in the INITIALIZED state during kernel init.

This is a workaround for a hardware problem.  It should be possible to
guarantee that at least one clock source will be present and active
for any IP block's main functional clock.  This ensures that the hwmod
code can enable and reset the IP block.  Resetting the IP block during
kernel init prevents any bogus bootloader, ROM code, or previous OS
configuration from affecting the kernel.  Hopefully a clock
multiplexer can be added on future SoCs.

N.B., at some point in the future, it should be possible to query the
clock framework for this type of information.  Then this flag should
no longer be needed.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Benoît Cousson <b-cousson@ti.com>
2012-10-31 05:02:31 -06:00
Rob Clark 5e3b087499 staging: drm/omap: add support for ARCH_MULTIPLATFORM
Remove usage of plat/cpu.h and get information from platform data
instead.  This enables omapdrm to be built with ARCH_MULTIPLATFORM.

Signed-off-by: Rob Clark <rob@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 11:10:00 -07:00
Tero Kristo 613ad0e98c ARM: OMAP: hwmod: wait for sysreset complete after enabling hwmod
When waking up from off-mode, some IP blocks are reset automatically by
hardware. For this reason, software must wait until the reset has
completed before attempting to access the IP block.

This patch fixes for example the bug introduced by commit
6c31b2150f ("mmc: omap_hsmmc: remove access
to SYSCONFIG register"), in which the MMC IP block is reset during
off-mode entry, but the code expects the module to be already available
during the execution of context restore.

This version includes a fix from Kevin Hilman <khilman@ti.com> for
GPIO problems on the 37xx EVM - thanks Kevin.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Benoit Cousson <b-cousson@ti.com>
Cc: Venkatraman S <svenkatr@ti.com>
Tested-by: Kevin Hilman <khilman@ti.com>
Cc: Kevin Hilman <khilman@ti.com>
[paul@pwsan.com: moved softreset wait code into separate function; call
 from top of _enable_sysc() rather than the bottom; include fix from Kevin
 Hilman for GPIO sluggishness]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
2012-10-29 22:02:13 -06:00
Miguel Vadillo 74549de1e4 ARM: OMAP2+: clockdomain: Fix OMAP4 ISS clk domain to support only SWSUP
Since CAM domain (ISS) has no module wake-up dependency
with any other clock domain of the device and the dynamic
dependency from L3_main_2 is always disabled, the domain
needs to be in force wakeup in order to be able to access
it for configure (sysconfig) it or use it.

Also since there is no clock in the domain managed automatically
by the hardware, there is no use to configure automatic
clock domain transition. SW should keep the SW_WKUP domain
transition as long as a module in the domain is required to
be functional.

Signed-off-by: Miguel Vadillo <vadillo@ti.com>
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
2012-10-29 22:02:13 -06:00
Paul Walmsley 37c67d0398 ARM: OMAP2+: WDT: move init; add read_reset_sources pdata function pointer
The OMAP watchdog timer driver directly calls a function exported by
code in arch/arm/mach-omap2.  This is not good; it tightly couples
this driver to the mach-omap2 integration code.  Instead, add a
temporary platform_data function pointer to abstract this function
call.  A subsequent patch will convert the watchdog driver to use this
function pointer.

This patch also moves the device creation code out of
arch/arm/mach-omap2/devices.c and into arch/arm/mach-omap2/wd_timer.c.
This is another step towards the removal of
arch/arm/mach-omap2/devices.c.

Cc: Wim Van Sebroeck <wim@iguana.be>
Acked-by: Wim Van Sebroeck <wim@iguana.be>
[paul@pwsan.com: skip wd_timer device creation when DT blob is present]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
2012-10-29 20:49:44 -06:00
Tomi Valkeinen ffc81fc5f3 OMAPDSS: split hdmi muxing function
Split the omap4_hdmi_mux_pads() function into two parts, one handles the
tpd12s015 gpio muxing, the other handles the hdmi pins.

This is clearer, as hdmi and tpd12s015 are separate devices, and it also
allows us to mux those separately with DT.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Ricardo Neri <ricardo.neri@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
2012-10-29 12:44:44 +02:00
Tony Lindgren 7fc54fd308 Merge branch 'omap-for-v3.8/cleanup-headers' into omap-for-v3.8/cleanup-prcm 2012-10-26 13:32:22 -07:00
Nishanth Menon 9bb053787d ARM: OMAP2+: PM: VP: minor pr_warn updates
change pr_warnings to pr_warn and ensure a newline
is present in all messages

Cc: linux-omap@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-10-25 14:32:34 -07:00
Tony Lindgren 2da8a79f7d Merge branch 'omap-for-v3.8/cleanup-headers-menelaus' into omap-for-v3.8/cleanup-headers
Conflicts:
	arch/arm/mach-omap2/board-h4.c
	arch/arm/mach-omap2/board-n8x0.c
2012-10-25 12:21:48 -07:00
Kevin Hilman 43993e4af0 ARM: OMAP2+: PM: add missing newline to VC warning message
Add missing newline to warning message to avoid annoying
wrapping problems during kernel boot like this one:

   omap_vc_i2c_init: I2C config for vdd_iva does not match other channels (0).
   omap_vc_i2c_init: I2C config for vdd_mpu does not match other channels (0).Power Management for TI OMAP4.

Reported-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-10-25 10:33:30 -07:00
Tony Lindgren 8634155ef4 The first set of OMAP PRM/CM-related cleanup patches for 3.8.
Prepares for the future move of the PRM/CM code to drivers/.  Also
 includes some prcm.[ch] cleanup patches from the WDTIMER cleanup
 series that don't need external acks.
 
 Basic test logs for this branch on top of v3.7-rc2 are here:
 
 http://www.pwsan.com/omap/testlogs/prcm_cleanup_a_3.8/20121021123719/
 
 But due to the number of unrelated regressions present in v3.7-rc[12],
 it's not particularly usable as a testing base.  With reverts, fixes,
 and workarounds applied as documented in:
 
 http://www.pwsan.com/omap/testlogs/test_v3.7-rc2/20121020134755/README.txt
 
 the following test logs were obtained:
 
 http://www.pwsan.com/omap/testlogs/prcm_cleanup_a_3.8/20121020231757/
 
 which indicate that the series tests cleanly.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQhEVeAAoJEMePsQ0LvSpLXMAP/R823zHuhSBsFYTAzoLpOsBu
 1btfoXY+aTh/ZYQpn2zqbseHyBVoN7JuBNFA25UlgCIB/+tL2o+B62HQE3c31HZi
 zrOlUrSvIl7zYTLhbu8rezULSYGO3RHqtUGLJ9/RUV3su8zIATmHKgzA1f/aYH9x
 2OKVIijXjvK4kKRpHhg8BGlD6stbuFDJbmik2/wgcO+159lKY6ZTRnHsj6PgZVIO
 BjbxpBujLYVBhJRJP0NNLVtGToGK54GvnHZxfVCu9oJ87n2amgaP6RHHHfEX0eMJ
 K65toYNIzZEmMahnazCcsiB+xK2Y2iiSZdOMPhH0FspCPTKTUl+czOlMGq7oyHmU
 xVmDyVHOVd5JRt5d985VlVScDrye06GxjWri557eeGcvOyQrlhJSntjdL2RZZaiu
 bpIhT1PRo8hqxtajcZlqBT7jSaH8kxQIQRXgGqJzY9iYLfUGU6DU7WYoqQTrrev7
 aCZG8SnDbmltXMvhw13owDzy8xpdssCFaT8Fbxaxa6jq1GF1xyfEucDZDQPlZZd7
 vbhdjYCBMiFcgJ3xWAmivboLPR1r5nZQdpwuYJTqoIvuJutB8Y0dJza7Dm0DGehc
 uJw/K/L/2qBdlOatFU4nk1c4AoTXZ+zn+ZVziTFus6ajhdB46C0i/vMLAXF68aDQ
 23ow9fKjRsuHfKqjfzMP
 =asxx
 -----END PGP SIGNATURE-----

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

The first set of OMAP PRM/CM-related cleanup patches for 3.8.
Prepares for the future move of the PRM/CM code to drivers/.  Also
includes some prcm.[ch] cleanup patches from the WDTIMER cleanup
series that don't need external acks.

Basic test logs for this branch on top of v3.7-rc2 are here:

http://www.pwsan.com/omap/testlogs/prcm_cleanup_a_3.8/20121021123719/

But due to the number of unrelated regressions present in v3.7-rc[12],
it's not particularly usable as a testing base.  With reverts, fixes,
and workarounds applied as documented in:

http://www.pwsan.com/omap/testlogs/test_v3.7-rc2/20121020134755/README.txt

the following test logs were obtained:

http://www.pwsan.com/omap/testlogs/prcm_cleanup_a_3.8/20121020231757/

which indicate that the series tests cleanly.

Conflicts:
	arch/arm/mach-omap2/Makefile
	arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
	arch/arm/mach-omap2/pm24xx.c
2012-10-24 17:05:59 -07:00
Tony Lindgren 6d02643d64 Merge branch 'omap-for-v3.8/cleanup-headers-usb' into omap-for-v3.8/cleanup-headers
Conflicts:
	arch/arm/mach-omap1/clock.c
	arch/arm/mach-omap2/board-2430sdp.c
	arch/arm/mach-omap2/board-4430sdp.c
	arch/arm/mach-omap2/board-cm-t35.c
	arch/arm/mach-omap2/board-igep0020.c
	arch/arm/mach-omap2/board-ldp.c
	arch/arm/mach-omap2/board-omap3beagle.c
	arch/arm/mach-omap2/board-omap3logic.c
	arch/arm/mach-omap2/board-omap4panda.c
	arch/arm/mach-omap2/board-overo.c
	arch/arm/mach-omap2/board-rm680.c
	arch/arm/mach-omap2/board-rx51.c
	arch/arm/mach-omap2/twl-common.c
	arch/arm/mach-omap2/usb-host.c
	arch/arm/mach-omap2/usb-musb.c
2012-10-24 15:05:45 -07:00
Felipe Balbi e8c4a7acc9 ARM: OMAP: move OMAP USB platform data to <linux/platform_data/omap-usb.h>
In order to make single zImage work for ARM architecture,
we need to make sure we don't depend on private headers.

Move USB platform_data to <linux/platform_data/omap-usb.h>
and add a minimal drivers/mfd/usb-omap.h.

Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Partha Basak <parthab@india.ti.com>
Cc: Keshava Munegowda <keshava_mgowda@ti.com>
Cc: linux-usb@vger.kernel.org
Signed-off-by: Felipe Balbi <balbi@ti.com>
[tony@atomide.com: updated for local mfd/usb-omap.h]
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-10-24 14:26:55 -07:00
Tony Lindgren 54db6eee06 ARM: OMAP2+: Introduce local usb.h
Let's move what we can from plat/usb.h to the local usb.h
for ARM common zImage support.

This is needed so we can remove plat/usb.h for ARM common
zImage support.

Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Partha Basak <parthab@india.ti.com>
Cc: Keshava Munegowda <keshava_mgowda@ti.com>
Cc: linux-usb@vger.kernel.org
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-10-24 14:26:18 -07:00
Tony Lindgren 3d82cbbb3a ARM: OMAP: Split plat/serial.h for omap1 and omap2+
For omap1, we'll keep mach/serial.h around for 8250.c hardware
workarounds. For omap2+, we no longer need mach/serial.h and
can make it local to mach-omap2.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-10-24 13:34:31 -07:00
Tony Lindgren ede8df1eaa ARM: OMAP: Split uncompress.h to mach-omap1 and mach-omap2
This allows us to eventually move omap2+ to generic
debug code that's configured in Kconfig for the port.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-10-24 13:34:24 -07:00
Tony Lindgren 3e9a6321f9 This is the first set of omap cleanup patches for v3.8 merge
window to remove most of the remaining plat includes to get us
 closer to ARM common zImage support.
 
 To avoid a huge amount of trivial merge conflicts with includes,
 this branch is based on several small topic branches coordinated
 with the driver subsystem maintainers. These branches are based on
 v3.7-rc1 and can also be merged into the related driver subsystem
 branches as needed:
 
 omap-for-v3.8/cleanup-headers-prepare   few trivial driver changes
 omap-for-v3.8/cleanup-headers-dma       move of the DMA header
 omap-for-v3.8/cleanup-headers-gpmc      GPMC and MTD changes
 omap-for-v3.8/cleanup-headers-mmc       MMC related changes
 omap-for-v3.8/cleanup-headers-dss       DSS related changes
 omap-for-v3.8/cleanup-headers-asoc      ASoC related changes
 
 Note that for the dma-omap.h, it was decided that it should be
 is completed. For the related discussion, please see:
 
 https://patchwork.kernel.org/patch/1519591/#
 
 After these patches we still have a few plat headers remaining
 that will be handled in later pull requests.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQgLn6AAoJEBvUPslcq6VztJIQAMDLmUr4XRa0pV9ASPieMSnP
 LqXQ8Gpr8JP6I2A7mjj5K/PVvU2PCIgefX5/F7PssWeDzPs1p6T5eQc6/Oo88j+k
 6xIaPJtuU6aiMKiH4QJBU9mfFZN4tvKNX8sJZ4YhzAmkKshwSd2XdWQlkSWYV7Ii
 QFRXOdYdX3dgvt3Pv5LYhFMlRDzXlMtCNkdyO0C5yDc038FvT5kxcgpOJ99ndX1F
 aSpNPchDwEXP7WZl3O7uZs732hRHQbKraMkzalVJ5mgvLSwF7VsB+BLdjOgRqFfg
 edpAPt/izpTk7cg7RQiItrW3xz3eSiN/fiAg2wLvxr6ewzB5DguPLa6DNPF+uyup
 BlpQAvNsICIixfKb/qimQBOkB71TTRxqvBnG0Vt/cExS1dTuWlhyCYzA6dhZtl+w
 7ETCo7Mmj+L9T1EfzhMPgjWvMZ4Luli4NHSUYxMl5Cs8nu1y6ytIXxH9e0mnZAbK
 n4ANoIuFE3ZueXWnHAVCOs0YZj2F1OLB+mFkIFg3OVpB4WCXiOTgJuDNsAAQNS3/
 VsYVehNFRB/E/lMWkN293j95LRSwl/sIKbvlpxe7M3XQi4IWh1bDPwcg1YhGPxRV
 HIuQSSMIIzcsFoDqbQYv9qzpvslfee58fBV0L8BzMyXNd1lYzWJ5Af6A8ddSVVFS
 Hh+btZObC1zP/2IKbImk
 =HUTj
 -----END PGP SIGNATURE-----

Merge tag 'omap-for-v3.8/cleanup-headers-signed' into omap-for-v3.8/cleanup-headers-serial-take2

This is the first set of omap cleanup patches for v3.8 merge
window to remove most of the remaining plat includes to get us
closer to ARM common zImage support.

To avoid a huge amount of trivial merge conflicts with includes,
this branch is based on several small topic branches coordinated
with the driver subsystem maintainers. These branches are based on
v3.7-rc1 and can also be merged into the related driver subsystem
branches as needed:

omap-for-v3.8/cleanup-headers-prepare   few trivial driver changes
omap-for-v3.8/cleanup-headers-dma       move of the DMA header
omap-for-v3.8/cleanup-headers-gpmc      GPMC and MTD changes
omap-for-v3.8/cleanup-headers-mmc       MMC related changes
omap-for-v3.8/cleanup-headers-dss       DSS related changes
omap-for-v3.8/cleanup-headers-asoc      ASoC related changes

Note that for the dma-omap.h, it was decided that it should be
is completed. For the related discussion, please see:

https://patchwork.kernel.org/patch/1519591/#

After these patches we still have a few plat headers remaining
that will be handled in later pull requests.
2012-10-24 13:25:44 -07:00
Vaibhav Hiremath 12ac7f9e11 ARM: AM33XX: Fix configuration of dmtimer parent clock by dmtimer driverDate:Wed, 17 Oct 2012 13:55:55 -0500
Add dmtimer clock aliases for AM33XX devices so that the parent clock for
the dmtimer can be set correctly by the dmtimer driver. Without these clock
aliases the dmtimer driver will fail to find the parent clocks for the dmtimer.

Verified that DMTIMERs can be successfully requested on AM335x beagle bone.

Original patch was provided by Vaibhav Hiremath [1]. Changelog and
additional verification performed by Jon Hunter.

[1] http://marc.info/?l=linux-omap&m=134693631608018&w=2

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Tested-by: Jon Hunter <jon-hunter@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-10-23 18:58:21 -07:00
Tony Lindgren 126c414a22 Misc. OMAP PM-related fixes for v3.7-rc
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJQhxRxAAoJEFk3GJrT+8ZlR+8P/07C6AUn/f2cPZkB/6c96Uv2
 nBJv3HTsrQS3A5clfJz0VH3kdEo9nC2bj80KsPUbBMO1r+EUQMPEa/cyQ8bhFGOt
 SlhsP4Wj4wpmn9OEGVMMvxS1J8a86tQPLnATltp7+g2m87FNlzNulJau+6WsgnYh
 Y8nOo0vXdKEer0l6hS2C36oq4Chm1f7gWtmkhxUWseE9G8AfhdWl8XElIUPsPv4a
 sSCBAXytNUi3GRGD6CZBgb0C3PIBfS5EywjCoSHrp0rOpAQhg9oov11HtO1okaM3
 OLbSgIvdzZ4mXZZRuayYsUSydr35tctaPKY7tolE8AhOP2/n3wkCZ4lNNZCNnEoF
 yoJg8oLTe6K8eVdoEHH6HaBcheQj7l4yw6gX75Yqg9wRt+g9S9C36a2VHDSEsRIS
 1dnPbCBPEV/SdhlE0hFZ0FdWQFMLY1taOQhFOPJ8eRqjO2p1qunzUlQ9PMe+0goj
 B2Et56Cm3InDDD4cxcK+tnmAp+WALzSREWYX4dYZVy2y1rg0dzk51ms7aiJAUOwU
 CZQtWq4nchxTC6jGD4KZ7GAucO+SZqBKUeO+m2xQSGrFY2BFu3k4hSYe+F/zsPBG
 i7HQTjIZfb+AXHZh1lu5uW6qr9j7VMo1lemKEjda7c0rWac3tQdywbo77Uh4DbKr
 LrQQL30sb5kQQ+xcMiR4
 =toVu
 -----END PGP SIGNATURE-----

Merge tag 'for_3.7-rc3-fixes-pm' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into omap-for-v3.7-rc2/fixes

Misc. OMAP PM-related fixes for v3.7-rc
2012-10-23 18:31:32 -07:00
Kevin Hilman 65bf7ca000 ARM: OMAP3: Beagle: fix OPP customization and initcall ordering
After commit 24d7b40a60 (ARM: OMAP2+:
PM: MPU DVFS: use generic CPU device for MPU-SS), OPPs are registered
using an existing CPU device, not the omap_device for MPU-SS.

First, fix the board file to use get_cpu_device() as required by the
above commit, otherwise custom OPPs will be added to the wrong device.

Second, the board files OPP init is called from the its init_machine
method, and the generic CPU devices are not yet created when
init_machine is run.  Therefore OPP initialization will fail.  To fix,
use a device_initcall() for the board file's OPP customization, and
make the device_initcall board-specific by using a machine_is check.

Reported-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-10-22 16:01:42 -07:00
Tony Lindgren 1d8643dd05 ARM: OMAP3: Fix 3430 legacy mux names for ssi1 signals.
On n900 uart1 pins are not not used for uart, instead they are
used to connect to a cell modem over ssi. Looks like we're
currently missing these signal names for 3430 for some reason,
and only have some of them listed for 3630. Obviously the signals
are there for 3430 if n900 is using them and they are documented
in some TRMs.

Note that these will eventually be replaced by device tree
based pinctrl-single.c driver. But for now these are needed
to verify the SSI pins for devices like Nokia N900.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-10-22 13:37:37 -07:00
Tony Lindgren 24942e8af1 ARM: OMAP2+: Fix location of select PINCTRL
Commit 8f31cefe (ARM: OMAP2+: select PINCTRL in Kconfig)
added select PINCTRL, but accdentally added it to a wrong
location.

We want to select if for ARCH_OMAP2PLUS, not for
ARCH_OMAP2PLUS_TYPICAL.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-10-22 13:37:34 -07:00
Kevin Hilman 44b1d42a60 ARM: OMAP2: UART: fix console UART mismatched runtime PM status
The runtime PM framework assumes that the hardware state of devices
when initialized is disabled.  For all omap_devices, we idle/disable
device by default.  However, the console uart uses a "no idle" option
during omap_device init in order to allow earlyprintk usage to work
seamlessly during boot.

Because the hardware is left partially enabled after init (whatever
the bootloader settings were), the omap_device should later be fully
initialized (including mux) and the runtime PM framework should be
told that the device is active, and not disabled so that the hardware
state is in sync with runtime PM state.

To fix, after the device has been created/registered, call
omap_device_enable() to finialize init and use pm_runtime_set_active()
to tell the runtime PM core the device is enabled.

Tested on 2420/n810, 3530/Overo, 3530/Beagle, 3730/OveroSTORM,
3730/Beagle-xM, 4460/PandaES.

Suggested-by: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Sourav Poddar <sourav.poddar@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-10-22 13:35:17 -07:00
Paul Walmsley 856c3c5b28 ARM: OMAP3: PM: apply part of the erratum i582 workaround
On OMAP34xx/35xx, and OMAP36xx chips with ES < 1.2, if the PER
powerdomain goes to OSWR or OFF while CORE stays at CSWR or ON, or if,
upon chip wakeup from OSWR or OFF, the CORE powerdomain goes ON before
PER, the UART3/4 FIFOs and McBSP2/3 SIDETONE memories will be
unusable.  This is erratum i582 in the OMAP36xx Silicon Errata
document.

This patch implements one of several parts of the workaround: the
addition of the wakeup dependency between the PER and WKUP
clockdomains, such that PER will wake up at the same time CORE_L3
does.

This is not a complete workaround.  For it to be complete:

1. the PER powerdomain's next power state must not be set to OSWR or
   OFF if the CORE powerdomain's next power state is set to CSWR or
   ON;

2. the UART3/4 FIFO and McBSP2/3 SIDETONE loopback tests should be run
   if the LASTPOWERSTATEENTERED bits for PER and CORE indicate that
   PER went OFF while CORE stayed on.  If loopback tests fail, then
   those devices will be unusable until PER and CORE can undergo a
   transition from ON to OSWR/OFF and back ON.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Tero Kristo <t-kristo@ti.com>
Cc: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-10-22 13:35:17 -07:00
Paul Walmsley 2bb2a5d30a ARM: OMAP2+: PRM: create PRM reset source API for the watchdog timer driver
The OMAP watchdog timer driver needs to determine what caused the SoC
to reset for its GETBOOTSTATUS ioctl.  So, define a set of standard
reset sources across OMAP SoCs.  For OMAP2xxx, 3xxx, and 4xxx SoCs,
define mappings from the SoC-specific reset source register bits to
the standardized reset source IDs.  Create SoC-specific PRM functions
that read the appropriate per-SoC register and use the mapping to
return the standardized reset bits.  Register the SoC-specific PRM
functions with the common PRM code via prm_register().  Create a
function in the common PRM code, prm_read_reset_sources(), that
calls the SoC-specific function, registered during boot.

This patch does not yet handle some SoCs, such as AM33xx.  Those SoCs
were not handled by the code this will replace.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
2012-10-21 01:01:13 -06:00
Paul Walmsley 21325b25f4 ARM: OMAP2+: CM: prepare for use of cm_ll_data function pointers
There are several CM operations which behave similarly across OMAP2+
SoCs, but which have slight differences in their underlying
implementations.

This patch creates the support code for this function pointer
registration process.  No function pointers are included yet, but a
subsequent patch will create these for the module IDLEST registers.

This patch allows other code to use CM-provided data and operations
without needing to know which SoC is currently in use.  A further
description of the concept is provided in the patch entitled
"ARM: OMAP2+: PRM: prepare for use of prm_ll_data function pointers".

Signed-off-by: Paul Walmsley <paul@pwsan.com>
2012-10-21 01:01:12 -06:00