]> git.karo-electronics.de Git - linux-beck.git/log
linux-beck.git
14 years agoOMAP4: clock: Rename leaf clock nodes to end with a _ick or _fck
Rajendra Nayak [Tue, 23 Feb 2010 05:09:39 +0000 (22:09 -0700)]
OMAP4: clock: Rename leaf clock nodes to end with a _ick or _fck

All leaf clock nodes are renamed for OMAP4 to have a clk name which
end with a _ick or a _fck. This is done so that the naming convention
is same as that followed on older OMAPs.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
14 years agoOMAP2+ clock: revise omap2_clk_{disable,enable}()
Paul Walmsley [Tue, 23 Feb 2010 05:09:38 +0000 (22:09 -0700)]
OMAP2+ clock: revise omap2_clk_{disable,enable}()

Simplify the code in the omap2_clk_disable() and omap2_clk_enable()
functions, reducing levels of indentation.  This makes the code easier
to read.  Add some additional debugging pr_debug()s here also to help
others understand what is going on.

Revise the omap2_clk_disable() logic so that it now attempts to
disable the clock's clockdomain before recursing up the clock tree.
Simultaneously, ensure that omap2_clk_enable() is called on parent
clocks first, before enabling the clockdomain.  This ensures that a
parent clock's clockdomain is enabled before the child clock's
clockdomain.  These sequences should be the inverse of each other.

Revise the omap2_clk_enable() logic so that it now cleans up after
itself upon encountering an error.  Previously, an error enabling a
parent clock could have resulted in inconsistent usecounts on the
enclosing clockdomain.

Remove the trivial _omap2_clk_disable() and _omap2_clk_enable() static
functions, and replace it with the clkops calls that they were
executing.

For all this to work, the clockdomain omap2_clkdm_clk_enable() and
omap2_clkdm_clk_disable() code must not return an error on clockdomains
without CLKSTCTRL registers; so modify those functions to simply return 0
in that case.

While here, add some basic kerneldoc documentation on both functions,
and get rid of some old non-CodingStyle-compliant comments that have
existed since the dawn of time (at least, the OMAP clock framework's
time).

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Richard Woodruff <r-woodruff2@ti.com>
Cc: Rajendra Nayak <rnayak@ti.com>
14 years agoOMAP2/3 clock: combine OMAP2 & 3 boot-time MPU rate change code
Paul Walmsley [Tue, 23 Feb 2010 05:09:36 +0000 (22:09 -0700)]
OMAP2/3 clock: combine OMAP2 & 3 boot-time MPU rate change code

The OMAP2 and OMAP3 boot-time MPU rate change code is almost
identical.  Merge them into mach-omap2/clock.c, and add kerneldoc
documentation.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
14 years agoOMAP clockdomain: if no autodeps exist, don't try to add or remove them
Paul Walmsley [Tue, 23 Feb 2010 05:09:35 +0000 (22:09 -0700)]
OMAP clockdomain: if no autodeps exist, don't try to add or remove them

_clkdm_add_autodeps() and _clkdm_del_autodeps() will attempt to dereference
a NULL pointer if no autodeps were supplied to clkdm_init().

Based on a patch from Roel Kluin <roel.kluin@gmail.com> - thanks Roel.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Roel Kluin <roel.kluin@gmail.com>
14 years agoOMAP hwmod: add hwmod class support
Paul Walmsley [Tue, 23 Feb 2010 05:09:34 +0000 (22:09 -0700)]
OMAP hwmod: add hwmod class support

Add support for categorizing and iterating over hardware IP blocks by
the "class" of the IP block.  The class is the type of the IP block:
e.g., "timer", "timer1ms", etc.  Move the OCP_SYSCONFIG/SYSSTATUS data
from the struct omap_hwmod into the struct omap_hwmod_class, since
it's expected to stay consistent for each class.  While here, fix some
comments.

The hwmod_class structures in this patch were designed and proposed by
Benoît Cousson <b-cousson@ti.com> and were refined in a discussion
between Thara Gopinath <thara@ti.com>, Kevin Hilman
<khilman@deeprootsystems.com>, and myself.

This patch uses WARN() lines that are longer than 80 characters, as
Kevin noted a broader lkml consensus to increase greppability by
keeping the messages all on one line.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Benoît Cousson <b-cousson@ti.com>
Cc: Thara Gopinath <thara@ti.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
14 years agoOMAP hwmod: convert header files with static allocations into C files
Paul Walmsley [Tue, 23 Feb 2010 05:09:32 +0000 (22:09 -0700)]
OMAP hwmod: convert header files with static allocations into C files

Code should be able to #include any header file without the fear that
the header file will go allocating memory.  This is a coding style
issue, similar to commit 82e9bd588563c4e22ebb55b684ebec7e310cc715.
Move the existing hwmod data from .h files to .c files.

While here, convert "omap34xx" to "omap3xxx" in the hwmod files, since
most of these structures should be reusable across all OMAP3 chips.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Benoît Cousson <b-cousson@ti.com>
Cc: Rajendra Nayak <rnayak@ti.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
14 years agoOMAP hwmod: convert hwmod to use hardware clock names rather than clkdev dev+con
Paul Walmsley [Tue, 23 Feb 2010 05:09:31 +0000 (22:09 -0700)]
OMAP hwmod: convert hwmod to use hardware clock names rather than clkdev dev+con

The OMAP hwmod core code is intended to use SoC IP block description
structures that are autogenerated from TI's OMAP hardware database.
Currently the hwmod code uses clkdev device + connection addressing to
identify clocks.  This causes problems in the hwmod autogeneration
process, since the TI hardware database doesn't use platform_device or
clkdev addressing; it uses a single clock signal name string, which
tends to bear some resemblance to what is used in the OMAP TRMs.  This
patch converts the hwmod code and existing data to use omap_clk_get_by_name(),
introduced in the previous patch.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Benoît Cousson <b-cousson@ti.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
14 years agoOMAP clock: add omap_clk_get_by_name() for use by OMAP hwmod core code
Paul Walmsley [Tue, 23 Feb 2010 05:09:29 +0000 (22:09 -0700)]
OMAP clock: add omap_clk_get_by_name() for use by OMAP hwmod core code

The OMAP hwmod core code is intended to use SoC IP block description
structures that are autogenerated from TI's OMAP hardware database.
Currently the hwmod code uses clkdev device + connection addressing to
identify clocks.  This causes problems in the hwmod autogeneration
process, since the TI hardware database doesn't use platform_device or
clkdev addressing; it uses a single clock signal name string, which
tends to bear some resemblance to what is used in the OMAP TRMs.  This
patch adds a non-exported function to the OMAP clock code,
omap_clk_get_by_name().  A subsequent patch will convert the hwmod
code to use this function.

This function is for use only by core code, and practically, no other
code outside the hwmod code should need it.  Device driver code in the
kernel must not use this function, which is why it is not exported.
Drivers should use the appropriate clock alias provided by the clkdev
data structures, so driver code can be completely SoC-independent.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Benoît Cousson <b-cousson@ti.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
14 years agoOMAP3: clock: add capability to change rate of dpll4_m5_ck_3630
Vimarsh Zutshi [Tue, 23 Feb 2010 05:09:28 +0000 (22:09 -0700)]
OMAP3: clock: add capability to change rate of dpll4_m5_ck_3630

Add necessary clk_sel definitions to clock framework to allow changing
dpll4_m5_ck_3630 rate. This is used by the ISP driver.

Signed-off-by: Vimarsh Zutshi <vimarsh.zutshi@nokia.com>
[paul@pwsan.com: updated to apply]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
14 years agoOMAP4 clock: drop the ALWAYS_ENABLED clock flag
Paul Walmsley [Tue, 23 Feb 2010 05:09:27 +0000 (22:09 -0700)]
OMAP4 clock: drop the ALWAYS_ENABLED clock flag

Get rid of the ALWAYS_ENABLED clock flag - it doesn't actually do anything.
(The OMAP4 clock autogeneration scripts have been updated accordingly.)

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Rajendra Nayak <rnayak@ti.com>
Cc: Benoît Cousson <b-cousson@ti.com>
14 years agoOMAP clock: drop RATE_FIXED clock flag
Paul Walmsley [Tue, 23 Feb 2010 05:09:26 +0000 (22:09 -0700)]
OMAP clock: drop RATE_FIXED clock flag

The RATE_FIXED clock flag is pointless.  In the OMAP1 clock code, it
simply causes the omap1_clk_round_rate() function to return the
current rate of the clock.  omap1_clk_round_rate(), however, should
never be called for a fixed-rate clock, since none of these clocks
have a .round_rate function pointer set in their struct clk records.
Similarly, in the OMAP2+ clock code, the RATE_FIXED flag just causes
the clock code to emit a warning if the OMAP clock maintainer was
foolish enough to add a .round_rate function pointer to a fixed-rate
clock.  "Doctor, it hurts when I pretend that a fixed-rate clock is
rate-changeable."  "Then don't pretend that a fixed-rate clock is
rate-changeable."  It has no functional value.  This patch drops the
RATE_FIXED clock flag, removing it from all clocks that are so marked.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Richard Woodruff <r-woodruff2@ti.com>
14 years agoOMAP2 clock: drop DELAYED_APP clock flag
Paul Walmsley [Tue, 23 Feb 2010 05:09:24 +0000 (22:09 -0700)]
OMAP2 clock: drop DELAYED_APP clock flag

All of the clocks that are marked with DELAYED_APP are changed as part
of the virt_prcm_set OPP virtual clock.  On 24xx, these clocks all
need to be changed as part of a group to keep the clock tree
functional - hence the need for the VALID_CONFIG bit, which is not
present on later OMAPs.  These clocks should not be rate-changed
independently.  So prevent these clocks from being changed
independently by dropping their .round_rate and .set_rate function
pointers.  It then turns out that the DELAYED_APP clock flag is no
longer useful, so drop it and the associated code and renumber the
clock flags.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Richard Woodruff <r-woodruff2@ti.com>
14 years agoOMAP2430 clock: make func_96m_ck parent-selectable
Paul Walmsley [Tue, 23 Feb 2010 05:09:23 +0000 (22:09 -0700)]
OMAP2430 clock: make func_96m_ck parent-selectable

func_96m_ck was incorrectly marked as being rate-selectable, when in
fact it is only parent-selectable.  Remove the .set_rate and .round_rate
function pointers for this clk.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
14 years agoOMAP2 clock: split OMAP2420, OMAP2430 clock data into their own files
Paul Walmsley [Tue, 23 Feb 2010 05:09:22 +0000 (22:09 -0700)]
OMAP2 clock: split OMAP2420, OMAP2430 clock data into their own files

In preparation for multi-OMAP2 kernels, split
mach-omap2/clock2xxx_data.c into mach-omap2/clock2420_data.c and
mach-omap2/clock2430_data.c.  2430 uses a different device space
physical memory layout than past or future OMAPs, and we use a
different virtual memory layout as well, which causes trouble for
architecture-level code/data that tries to support both.  We tried
using offsets from the virtual base last year, but those patches never
made it upstream; so after some discussion with Tony about the best
all-around approach, we'll just grit our teeth and duplicate the
structures.  The maintenance advantages of a single kernel config that
can compile and boot on OMAP2, 3, and 4 platforms are simply too
compelling.

This approach does have some nice benefits beyond multi-OMAP 2 kernel
support.  The runtime size of OMAP2420-specific and OMAP2430-specific
kernels is smaller, since unused clocks for the other OMAP2 chip will
no longer be compiled in.  (At some point we will mark the clock data
__initdata and allocate it during registration, which will eliminate
the runtime memory advantage.)  It also makes the clock trees slightly
easier to read, since 2420-specific and 2430-specific clocks are no
longer mixed together.

This patch also splits 2430-specific clock code into its own file,
mach-omap2/clock2430.c, which is only compiled in for 2430 builds -
mostly for organizational clarity.

While here, fix a bug in the OMAP2430 clock tree: "emul_ck" was
incorrectly marked as being 2420-only, when actually it is present on
both OMAP2420 and OMAP2430.

Thanks to Tony for some good discussions about how to approach this
problem.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Richard Woodruff <r-woodruff2@ti.com>
14 years agoOMAP3/4 clock: split into per-chip family files
Paul Walmsley [Tue, 23 Feb 2010 05:09:20 +0000 (22:09 -0700)]
OMAP3/4 clock: split into per-chip family files

clock34xx_data.c now contains data for the OMAP34xx family, the
OMAP36xx family, and the OMAP3517 family, so rename it to
clock3xxx_data.c.  Rename clock34xx.c to clock3xxx.c, and move the
chip family-specific clock functions to clock34xx.c, clock36xx.c, or
clock3517.c, as appropriate.  So now "clock3xxx.*" refers to the OMAP3
superset.

The main goal here is to prepare to compile chip family-specific clock
functions only for kernel builds that target that chip family.  To get to
that point, we also need to add CONFIG_SOC_* options for those other
chip families; that will be done in future patches, planned for 2.6.35.

OMAP4 is also affected by this.  It duplicated the OMAP3 non-CORE DPLL
clkops structure.  The OMAP4 variant of this clkops structure has been
removed, and since there was nothing else currently in clock44xx.c, it
too has been removed -- it can always be added back later when there
is some content for it.  (The OMAP4 clock autogeneration scripts have been
updated accordingly.)

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Benoît Cousson <b-cousson@ti.com>
Cc: Rajendra Nayak <rnayak@ti.com>
Cc: Ranjith Lohithakshan <ranjithl@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
14 years agoOMAP clock: drop .id field; ensure each clock has a unique name
Paul Walmsley [Tue, 23 Feb 2010 05:09:19 +0000 (22:09 -0700)]
OMAP clock: drop .id field; ensure each clock has a unique name

After the clkdev conversion, the struct clk.id field became
superfluous, so, drop it.  Bring the clock names closer to the TRMs
and ensure they are unique for debugfs.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
14 years agoOMAP clock: compress clock flags down to a u8
Paul Walmsley [Tue, 23 Feb 2010 05:09:18 +0000 (22:09 -0700)]
OMAP clock: compress clock flags down to a u8

There are now only eight OMAP clock flags, so renumber the flags to
fit in a u8 and shrink the size of struct clk.flags from a u32 to a
u8.  The intention is to save memory.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
14 years agoOMAP2 clock: drop CONFIG_PARTICIPANT clock flag
Paul Walmsley [Tue, 23 Feb 2010 05:09:16 +0000 (22:09 -0700)]
OMAP2 clock: drop CONFIG_PARTICIPANT clock flag

It turns out that the only purpose of the CONFIG_PARTICIPANT clock
flag is to prevent omap2_clk_set_rate() and omap2_clk_set_parent()
from being executed on clocks with that flag set.  The rate-changing
component can be more directly accomplished by dropping the .set_rate
and .round_rate function pointers from those CONFIG_PARTICIPANT struct
clks.  As far as the parent-changing component is concerned, it turns
out that none of the CONFIG_PARTICIPANT clocks have multiple parent
choices, so all that is necessary is for omap2_clk_set_parent() to
bail out early if the new parent is equal to the old parent.
Implement this change and get rid of the flag, which has always had a
confusing name (it appears to be a Kconfig option, falsely).

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Richard Woodruff <r-woodruff2@ti.com>
14 years agoOMAP2xxx clock: drop DELAYED_APP flag from non-clksel clocks
Paul Walmsley [Tue, 23 Feb 2010 05:09:15 +0000 (22:09 -0700)]
OMAP2xxx clock: drop DELAYED_APP flag from non-clksel clocks

The DELAYED_APP flag is effective only with clksel clocks, so drop it from
clocks that are not rate-changeable or that use non-clksel rate changing code
(e.g., virt_prcm_set).

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Richard Woodruff <r-woodruff2@ti.com>
14 years agoOMAP2xxx clock: GFX functional clock rates are not independently changeable
Paul Walmsley [Tue, 23 Feb 2010 05:09:14 +0000 (22:09 -0700)]
OMAP2xxx clock: GFX functional clock rates are not independently changeable

According to the OMAP242x TRM Rev X Figure 5-15 "Clock Output Control
- Functional Clocks 2", the GFX functional clocks should be marked
both DELAYED_APP and CONFIG_PARTICIPANT, meaning that their rates must
be reprogrammed as part of a larger OPP set change.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Richard Woodruff <r-woodruff2@ti.com>
14 years agoOMAP4 clock: drop the CLOCK_IN_OMAP4430 clock flag
Paul Walmsley [Tue, 23 Feb 2010 05:09:13 +0000 (22:09 -0700)]
OMAP4 clock: drop the CLOCK_IN_OMAP4430 clock flag

The CLOCK_IN_OMAP4430 clock flag is not currently needed in the OMAP4
ES1 clock tree, and platform discrimination via clock flags is
deprecated in favor of the clkdev mechanism, so, drop it.  (The OMAP4
clock tree autogeneration script has been updated accordingly.)

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Benoît Cousson <b-cousson@ti.com>
Cc: Rajendra Nayak <rnayak@ti.com>
14 years agoOMAP2/3/4 clock: fix DPLL multiplier value errors; also copyrights, includes, documen...
Paul Walmsley [Tue, 23 Feb 2010 05:09:12 +0000 (22:09 -0700)]
OMAP2/3/4 clock: fix DPLL multiplier value errors; also copyrights, includes, documentation

The maximum DPLL multiplier (M) values for OMAP2xxx and OMAP3xxx are
one increment higher than they should be.  See for example the
OMAP242x TRM Rev X Section 5.10.6 "Clock Generator Registers" and the
OMAP36xx TRM Rev C Table 3-202 "CM_CLKSEL1_PLL".  Programming a 0 into
the DPLL's M register bitfield is valid for OMAP2/3 and indicates that
the DPLL should enter MN-bypass mode.  Also, increase the minimum
multiplier (M) value for the DPLL rate rounding code from 1 to 2, to
ensure that it does not inadvertently put the DPLL into bypass.

Note that the register documentation in the OMAP2xxx and OMAP3xxx TRMs
does not make clear that the actual DPLL divider value (the "N") is
the content of the appropriate register bitfield for the N value,
_plus one_.  (In other words, an N register bitfield of 0 indicates a
DPLL divider value of 1.)  This is only clearly documented in the
OMAP4430 TRM, in, for example, OMAP4430 TRM Rev A Table 3-1167
"CM_CLKSEL_DPLL_USB".

While here, update copyrights, add kerneldoc for struct dpll_data,
drop the unused struct dpll_data.max_tolerance field, remove some
unnecessary #includes in DPLL-related code, and replace the #include
of <linux/module.h> with <linux/list.h>, which is what was really
needed.  The OMAP4 clock autogenerator script has been updated
accordingly.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Benoît Cousson <b-cousson@ti.com>
Cc: Rajendra Nayak <rnayak@ti.com>
14 years agoOMAP3 clock: add support for 192Mhz DPLL4M2 output
Vishwanath BS [Tue, 23 Feb 2010 05:09:10 +0000 (22:09 -0700)]
OMAP3 clock: add support for 192Mhz DPLL4M2 output

In 3630, DPLL4M2 output can be 96MHz or 192MHz (for SGX to run at
192). This patch has changes to support this feature. 96MHz clock is
generated by dividing 192Mhz clock by 2 using CM_CLKSEL_CORE register.
SGX can select Core Clock, 192MHz clock or CM_96M_FCLK as it's
functional clock. In summary changes done are:
1. Added a feature called omap3_has_192mhz_clk and enabled for 3630
2. Added a new clock node called omap_192m_alwon_ck
3. Made omap_96m_alwon_fck to derive its clock from omap_192m_alwon_ck

Signed-off-by: Vishwanath BS <Vishwanath.bs@ti.com>
[paul@pwsan.com: fixed whitespace]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
14 years agoOMAP3 clock: Introduce 3630 DPLL4 HSDivider changes
Vishwanath BS [Tue, 23 Feb 2010 05:09:09 +0000 (22:09 -0700)]
OMAP3 clock: Introduce 3630 DPLL4 HSDivider changes

Divider (M2, M3, M4, M5 and M6) field width has been increased by 1 bit
in 3630. This patch has changes to accommodate this in CM dynamically
based on chip version.
Basically new clock nodes have been added for 3630 DPLL4 M2,M3,M4,M5 and
M6 and value of these nodes are used if cpu type is 3630.

Signed-off-by: Vishwanath BS <vishwanath.bs@ti.com>
[paul@pwsan.com: updated to apply on 2.6.34 queue; comments added]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
14 years agoOMAP3 clock: introduce DPLL4 Jtype
Richard Woodruff [Tue, 23 Feb 2010 05:09:08 +0000 (22:09 -0700)]
OMAP3 clock: introduce DPLL4 Jtype

DPLL4 for 3630 introduces a changed block called j type dpll, requiring
special divisor bits and additional reg fields. To allow for silicons to
use this, this is introduced as a flag and is enabled for 3630 silicon.
OMAP4 also has j type dpll for usb.

Tested with 3630 ZOOM3 and OMAP3430 ZOOM2

Signed-off-by: Richard Woodruff <r-woodruff2@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Vishwanath BS <Vishwanath.bs@ti.com>
[paul@pwsan.com: added some comments; updated copyrights and credits; fixed
 some style issues]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
14 years agoARM: OMAP4 clock domain: Add check for avoiding dependency related update.
Abhijit Pagare [Tue, 23 Feb 2010 05:09:07 +0000 (22:09 -0700)]
ARM: OMAP4 clock domain: Add check for avoiding dependency related update.

A check is added for avoiding the sleep/wakeup dependency updates
for OMAP4 as the structures for the dependencies are currently absent.

Signed-off-by: Abhijit Pagare <abhijitpagare@ti.com>
[paul@pwsan.com: added warnings, explanatory comment, copyright update]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
14 years agoOMAP3630: Clock: Workaround for DPLL HS divider limitation
Mike Turquette [Wed, 24 Feb 2010 19:06:00 +0000 (12:06 -0700)]
OMAP3630: Clock: Workaround for DPLL HS divider limitation

This patch implements a workaround for the DPLL HS divider limitation
in OMAP3630 as given by Errata ID: i556.

Errata:
When PWRDN bit is set, it resets the internal HSDIVIDER divide-by value (Mx).
The reset value gets loaded instead of the previous value.
The following HSDIVIDERs exhibit above behavior:
. DPLL4 : M6 / M5 / M4 / M3 / M2 (CM_CLKEN_PLL[31:26] register bits)
. DPLL3 : M3 (CM_CLKEN_PLL[12] register bit).

Work Around:
It is mandatory to apply the following sequence to ensure the write
value will
be loaded in DPLL HSDIVIDER FSM:
The global sequence when using PWRDN bit is the following:
. Disable Mx HSDIVIDER clock output related functional clock enable bits
        (in CM_FCLKEN_xxx / CM_ICLKEN_xxx)
. Enable PWRDN bit of HSDIVIDER
. Disable PWRDN bit of HSDIVIDER
. Read current HSDIVIDER register value
. Write different value in HSDIVIDER register
. Write expected value in HSDIVIDER register
. Enable Mx HSDIVIDER clock output related functional clocks
        (CM_FCLKEN_xxx / CM_ICLKEN_xxx)

Signed-off-by: Mike Turquette <mturquette@ti.com>
Signed-off-by: Vishwanath BS <vishwanath.bs@ti.com>
Signed-off-by: Vijaykumar GN <vijaykumar.gn@ti.com>
[paul@pwsan.com: updated patch to apply; made workaround function static;
 marked as being 36xx-specific]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
14 years agoOMAP: HWMOD: Add support for early device register into omap device layer
Thara Gopinath [Wed, 24 Feb 2010 19:05:58 +0000 (12:05 -0700)]
OMAP: HWMOD: Add support for early device register into omap device layer

This patch adds support in omap device layer to register devices
as early platform devices. Certain devices needed during system boot up
like timers, gpio etc can be registered as early devices. This will
allow for them to be probed very early on during system boot up.
This patch adds a parameter is_early_device in omap_device_build.
Depending on this parameter a call to early_platform_add_devices
or platform_register_device is made.

Signed-off-by: Thara Gopinath <thara@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
14 years agoOMAP3: hwmod: support to specify the offset position of various SYSCONFIG register...
Thara Gopinath [Wed, 24 Feb 2010 19:05:58 +0000 (12:05 -0700)]
OMAP3: hwmod: support to specify the offset position of various SYSCONFIG register bits.

In OMAP3 Some modules like Smartreflex do not have the regular sysconfig
register.Instead clockactivity bits are part of another register at a
different bit position than the usual bit positions 8 and 9.

In OMAP4, a new scheme is available  due to the new protocol
between the PRCM and the IPs. Depending of the scheme, the SYSCONFIG
bitfields position will be different.
The IP_REVISION register should be at offset 0x00.
It should contain a SCHEME field. From this we can determine whether
the IP follows legacy scheme or the new scheme.

31:30 SCHEME  Used to distinguish between old scheme and current.
 Read 0x0:  Legacy protocol.
 Read 0x1:  New PRCM protocol defined for new OMAP4 IPs

For legacy IP
 13:12 MIDLEMODE
 11:8  CLOCKACTIVITY
 6     EMUSOFT
 5     EMUFREE
 4:3   SIDLEMODE
 2     ENAWAKEUP
 1     SOFTRESET
 0     AUTOIDLE

For new OMAP4 IP's, the bit position in SYSCONFIG is (for simple target):
 5:4   STANDBYMODE (Ex MIDLEMODE)
 3:2   IDLEMODE (Ex SIDLEMODE)
 1     FREEEMU (Ex EMUFREE)
 0     SOFTRESET

Unfortunately In OMAP4 also some IPs will not follow any of these
two schemes. This is the case at least for McASP, SmartReflex
and some security IPs.

This patch introduces a new field sysc_fields in omap_hwmod_sysconfig which
can be used by the hwmod structures to specify the offsets for the
sysconfig register of the IP.Also two static structures
omap_hwmod_sysc_type1 and omap_hwmod_sysc_type2 are defined
which can be used directly to populate the sysc_fields if the IP follows
legacy or new OMAP4 scheme. If the IP follows none of these two schemes
a new omap_hwmod_sysc_fields structure has to be defined and
passed as part of omap_hwmod_sysconfig.

Signed-off-by: Thara Gopinath <thara@ti.com>
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
14 years agoOMAP3 clock: Remove FreqSel for 3630
Vishwanath BS [Wed, 24 Feb 2010 19:05:57 +0000 (12:05 -0700)]
OMAP3 clock: Remove FreqSel for 3630

DPLL_FREQSEL field in CLKEN_PLL register is no longer valid for
OMAP3630. So remove references to that.

Signed-off-by: Vishwanath BS <vishwanath.bs@ti.com>
Cc: Sergei Shtylyov <sshtylyov@mvista.com>
[paul@pwsan.com: added comment fix from Sergei Shtylyov]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
14 years agoOMAP2/3: PRCM: fix misc. compiler warnings
Kevin Hilman [Wed, 24 Feb 2010 19:05:56 +0000 (12:05 -0700)]
OMAP2/3: PRCM: fix misc. compiler warnings

- missing return in omap_prcm_get_reset_sources()
- potential use of uninitialized variable in omap_prcm_arch_reset()

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
14 years agoOMAP3 clock: Check return values for clk_get()
Sanjeev Premi [Wed, 24 Feb 2010 19:05:56 +0000 (12:05 -0700)]
OMAP3 clock: Check return values for clk_get()

This patch checks if clk_get() returned success for
the clocks used in function omap2_clk_arch_init().

This version incorporates review comments from
Kevin Hilman and Paul Walmsley.

Signed-off-by: Sanjeev Premi <premi@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
14 years agoAM35xx: Add clock support for new modules on AM35xx
Ranjith Lohithakshan [Wed, 24 Feb 2010 19:05:55 +0000 (12:05 -0700)]
AM35xx: Add clock support for new modules on AM35xx

This patch adds clock support for the following AM35xx modules
- Ethernet MAC
- CAN Controller (HECC)
- New MUSB OTG Controller with integrated Phy
- Video Processing Front End (VPFE)
- Additional UART (UART4)

Signed-off-by: Ranjith Lohithakshan <ranjithl@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
14 years agoOMAP2/3 clock: Extend find_idlest() to pass back idle state value
Ranjith Lohithakshan [Wed, 24 Feb 2010 19:05:54 +0000 (12:05 -0700)]
OMAP2/3 clock: Extend find_idlest() to pass back idle state value

Current implementation defines clock idle state indicators based on the
cpu information (cpu_is_omap24xx() or cpu_is_omap34xx()) in a system wide
manner. This patch extends the find_idlest() function in clkops to pass
back the idle state indicator for that clock, thus allowing idle state
indicators to be defined on a per clock basis if required.

This is specifically needed on AM35xx devices as the new IPSS clocks
indicates the idle status (0 is idle, 1 is ready) in a way just
opposite to how its handled in OMAP3 (0 is ready, 1 is idle).

Signed-off-by: Ranjith Lohithakshan <ranjithl@ti.com>
[paul@pwsan.com: updated to apply after commit 98c45457 et seq.]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
14 years agoOMAP3 PM: Adding counters for power domain logic off and mem off during retention.
Thara Gopinath [Wed, 24 Feb 2010 19:05:50 +0000 (12:05 -0700)]
OMAP3 PM: Adding counters for power domain logic off and mem off during retention.

This patch adds counters to keep track of whether the powerdomain
logic or software controllable memory banks are turned off when
the power domain enters retention. During power domain retention
if logic gets turned off, the scenario is known as Open Switch Retention.
Also during retention s/w controllable memory banks of a power
domain can be chosen to be kept in retention or off.

This patch adds one counter per powerdomain to track the power domain
logic state during retention. Number of memory bank state counters
added depends on the number of software controllable memory banks
of the powerdomain. To view these counters do
cat ../debug/pm_debug/count

Signed-off-by: Thara Gopinath <thara@ti.com>
[paul@pwsan.com: conditional expressions simplified; counter increment
 code moved to its own function]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
14 years agoOMAP3 PM: Defining .pwrsts_logic_ret field for core power domain structure
Thara Gopinath [Wed, 24 Feb 2010 19:05:50 +0000 (12:05 -0700)]
OMAP3 PM: Defining .pwrsts_logic_ret field for core power domain structure

This patch adds the flag .pwrsts_logic_ret info for the core power domain
in the associated powerdomain structure. This flag specifies the states
core domain logic can hit in event of the domain entering retention.

Signed-off-by: Thara Gopinath <thara@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
14 years agoOMAP2/3 PM: Adding powerdomain APIs for reading the next logic and mem state
Thara Gopinath [Wed, 24 Feb 2010 19:05:49 +0000 (12:05 -0700)]
OMAP2/3 PM: Adding powerdomain APIs for reading the next logic and mem state

This patch adds APIs pwrdm_read_logic_retst and
pwrdm_read_mem_retst for reading the next programmed
logic and memory state a powerdomain is to hit in event
of the next power domain state being retention.
These are needed for OSWR support.

Signed-off-by: Thara Gopinath <thara@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
14 years agoOMAP3: Clock: Added IDLEST definitions for SGX
Tero Kristo [Wed, 24 Feb 2010 19:05:48 +0000 (12:05 -0700)]
OMAP3: Clock: Added IDLEST definitions for SGX

Added definitions for OMAP3430ES2_ST_SGX_SHIFT and OMAP3430ES2_ST_SGX_MASK
as these were missing.

Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
14 years agoOMAP3: clock: use std _MASK suffix for CM_FCLKEN_IVA2 defines
Kevin Hilman [Wed, 24 Feb 2010 19:05:48 +0000 (12:05 -0700)]
OMAP3: clock: use std _MASK suffix for CM_FCLKEN_IVA2 defines

Add _MASK suffix to CM_FCLKEN_IVA2 bitfieds to conform with the rest
of the usage in cm-regbits-34xx.h of using _SHIFT and _MASK suffixes.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
14 years agoOMAP: omap_device: when 'called from invalid state', print state
Kevin Hilman [Wed, 24 Feb 2010 19:05:45 +0000 (12:05 -0700)]
OMAP: omap_device: when 'called from invalid state', print state

The omap_device_[enable|idle|shutdown] functions print a warning
when called from an invalid state.  Print the invalid state in
the warning messages.  This also uses __func__ to get the function
name.

Also, move the entire print string onto a single line to facilitate
grepping or error messages.  Recent discussions on LKML show
strong preference for grep-able code vs. strict 80 column limit.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
14 years agoOMAP: omap_device: add omap_device_is_valid()
Kevin Hilman [Wed, 24 Feb 2010 19:05:45 +0000 (12:05 -0700)]
OMAP: omap_device: add omap_device_is_valid()

The omap_device struct contains a 'struct platform_device'.  Normally,
converting a platform_device pointer to an omap_device pointer
consists of simply doing a container_of(), as is done currently by the
to_omap_device() macro.

However, if this is attempted when using platform_device that has not
been created as part of the omap_device creation, the container_of()
will point to a memory location before the platform_device pointer
which will contain random data.

Therefore, we need a way to detect valid omap_device pointers.  This
patch solves this by using the simple magic number approach.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
14 years agoMerge branch 'omap-fixes-for-linus' into omap-for-linus
Tony Lindgren [Wed, 17 Feb 2010 22:08:58 +0000 (14:08 -0800)]
Merge branch 'omap-fixes-for-linus' into omap-for-linus

14 years agoomap: Remove DEBUG_FS dependency for mux name checking
Ranjith Lohithakshan [Wed, 17 Feb 2010 17:17:01 +0000 (17:17 +0000)]
omap: Remove DEBUG_FS dependency for mux name checking

The check for a valid mux name should be performed regardless of whether
DEBUG_FS is enabled or not. Otherwise without DEBUG_FS, we get:

Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = c0004000
[00000000] *pgd=00000000
Internal error: Oops: 5 [#1]
last sysfs file:
Modules linked in:
CPU: 0    Not tainted  (2.6.33-rc8 #10)
PC is at strcmp+0x18/0x40
LR is at omap_mux_init_signal+0x68/0x14c
...

This fixes the issue currently seen with boards not booting up
if DEBUG_FS is not enabled in defconfig.

Note that the earlier ifndef + ifdef now becomes simpler ifdef else:
If CONFIG_OMAP_MUX is selected, we use pin names. If it's not selected,
we only want the GPIO to mux register mapping.

Signed-off-by: Ranjith Lohithakshan <ranjithl@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoOMAP4: MCPDM: Register McPDM platform device
Jorge Eduardo Candelaria [Mon, 15 Feb 2010 18:03:35 +0000 (10:03 -0800)]
OMAP4: MCPDM: Register McPDM platform device

Add platform device for McPDM interface in OMAP4 and register
its memory and irq resources.

Signed-off-by: Jorge Eduardo Candelaria <x0107209@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoARM: OMAP4: Add McPDM base address
Jorge Eduardo Candelaria [Mon, 15 Feb 2010 18:03:35 +0000 (10:03 -0800)]
ARM: OMAP4: Add McPDM base address

Define McPDM physical and L3 base address for OMAP4

Signed-off-by: Jorge Eduardo Candelaria <x0107209@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoOMAP4: IRQ: Add McPDM IRQ definition
Jorge Eduardo Candelaria [Mon, 15 Feb 2010 18:03:35 +0000 (10:03 -0800)]
OMAP4: IRQ: Add McPDM IRQ definition

Support for McPDM IRQs in OMAP4

Signed-off-by: Jorge Eduardo Candelaria <x0107209@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoarm: omap: kill compile warning on board-4430-sdp.c
Felipe Balbi [Mon, 15 Feb 2010 18:03:35 +0000 (10:03 -0800)]
arm: omap: kill compile warning on board-4430-sdp.c

sdp4430_uart_config isn't used anywhere, so remove it.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoAM35xx: Update irq.h for AM35xx IPSS module interrupts
Vaibhav Hiremath [Mon, 15 Feb 2010 18:03:35 +0000 (10:03 -0800)]
AM35xx: Update irq.h for AM35xx IPSS module interrupts

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoAM35xx: Add AM35xx intr_clr & sw_rst cntrl reg bit definition
Vaibhav Hiremath [Mon, 15 Feb 2010 18:03:35 +0000 (10:03 -0800)]
AM35xx: Add AM35xx intr_clr & sw_rst cntrl reg bit definition

AM3517/05 has few additional control module registers to control
the new IP's, like VPFE, USBOTG, CPGMAC.

This patch adds the bit defination for INTR_CLR and SW_RST control
register.

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoAM35xx: Introduce am35xx.h file
Vaibhav Hiremath [Mon, 15 Feb 2010 18:03:35 +0000 (10:03 -0800)]
AM35xx: Introduce am35xx.h file

Add base address definations for new AM35xx IPSS modules, like
VPFE, USBOTG, CPGMAC.

Please note that the OMAP34xx IVA2 memory space is being used for
AM35xx IPSS modules.

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Sriramakrishnan <srk@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap3: pm: Add T2 Keypad as a wakeup source
Lesly A M [Mon, 15 Feb 2010 18:03:35 +0000 (10:03 -0800)]
omap3: pm: Add T2 Keypad as a wakeup source

Changes for setting the padconf value for sys_nirq line which is
connected to T2 INTR1. This will fix the T2 keypad wakeup.

Signed-off-by: Lesly A M <x0080970@ti.com>
Signed-off-by: Teerth Reddy <teerth@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap3: Clean-up for omap_mux_init
Tony Lindgren [Mon, 15 Feb 2010 18:03:35 +0000 (10:03 -0800)]
omap3: Clean-up for omap_mux_init

Get rid of the ifdeffery in omap_mux_init by creating
omap_mux_init_package and omap_mux_init_signals functions.

Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap_hsmmc: allow compile without regulator framework
Adrian Hunter [Mon, 15 Feb 2010 18:03:35 +0000 (10:03 -0800)]
omap_hsmmc: allow compile without regulator framework

It is still possible to use the omap_hsmmc module
without the regulator framework.  Accordingly, ifdef
out regulator-specific functions.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap_hsmmc: Allow for a shared VccQ
Adrian Hunter [Mon, 15 Feb 2010 18:03:34 +0000 (10:03 -0800)]
omap_hsmmc: Allow for a shared VccQ

EMMC can have two voltage supplies, Vcc and VccQ
which are implemented in the code as consumer
supplies vmmc and vmmc_aux.

If the regulator that supplies vmmc_aux is shared
with other consumers, then sending it to sleep
will disrupt those consumers.  However, the
TWL4030-family regulators may have OFF remapped
to SLEEP, in which case 'regulator_disable()'
will put the regulator to sleep only when all
consumers are disabled - which is the desired
behaviour.

This patch adds a platform data field to allow
that option.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap_hsmmc: Ensure regulator enable / disable are paired
Adrian Hunter [Mon, 15 Feb 2010 18:03:34 +0000 (10:03 -0800)]
omap_hsmmc: Ensure regulator enable / disable are paired

Stop using 'regulator_is_enabled()' and just pair enables
with disables so that the regulator reference counts can
work correctly.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap_hsmmc: Fix disable timeouts
Adrian Hunter [Mon, 15 Feb 2010 18:03:34 +0000 (10:03 -0800)]
omap_hsmmc: Fix disable timeouts

Disable timeouts are in msecs not jiffies.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap_hsmmc: Allow for power saving without going off
Adrian Hunter [Mon, 15 Feb 2010 18:03:34 +0000 (10:03 -0800)]
omap_hsmmc: Allow for power saving without going off

An eMMC may be always powered on, so that the lowest
power saving state possible is sleeping. Add a field
to the platform data to indicate that.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap: RX51: Remux to pull eMMC lines down when powering off
Adrian Hunter [Mon, 15 Feb 2010 18:03:34 +0000 (10:03 -0800)]
omap: RX51: Remux to pull eMMC lines down when powering off

It has been discovered that, when eMMC is powered off, current
will flow from OMAP eMMC data pull-ups to the eMMC voltage supply.
Configuring pads for OMAP off-mode does not help because eMMC is
powered off independently of OMAP off-mode.  Hence the pads are
now re-configured when eMMC is powered on or off.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap: Reconnect hsmmc context loss count
Adrian Hunter [Mon, 15 Feb 2010 18:03:34 +0000 (10:03 -0800)]
omap: Reconnect hsmmc context loss count

Call the PM context-loss count function, now that there
is a prototype for it.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap: Rename hsmmc symbols to reflect independence from twl4030
Adrian Hunter [Mon, 15 Feb 2010 18:03:34 +0000 (10:03 -0800)]
omap: Rename hsmmc symbols to reflect independence from twl4030

hsmmc.[ch] no longer has any dependency on twl4030
and variable names should be renamed to reflect that.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap: Rename mmc-twl4030 files to hsmmc
Adrian Hunter [Mon, 15 Feb 2010 18:03:34 +0000 (10:03 -0800)]
omap: Rename mmc-twl4030 files to hsmmc

mmc-twl4030.[ch] no longer has any dependency on twl4030
and should be renamed to reflect that.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap_hsmmc: Move gpio and regulator control from board file
Adrian Hunter [Mon, 15 Feb 2010 18:03:34 +0000 (10:03 -0800)]
omap_hsmmc: Move gpio and regulator control from board file

This patch moves the setup code for GPIO's and Voltage
Regulators from the board file mmc-twl4030.c to the
driver omap_hsmmc.c.  PBIAS and other system control
configuration remains in the board file.

Moving GPIO code to the driver makes the board initialisation
code independent of when GPIO's are defined.  That makes the
board initialisation now entirely independent of its original
twl4030 roots.

Moving Voltage Regulator code to the driver allows for further
development of regulator support in the core MMC code.  It also
permits the MMC core to be compiled as a module, because the
board code no longer calls MMC core functions.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap3: Add support for flash on 3430SDP board
Vimal Singh [Mon, 15 Feb 2010 18:03:34 +0000 (10:03 -0800)]
omap3: Add support for flash on 3430SDP board

This patch adds support for flashes on 3430SDP boards. All three
NAND, NOR and OneNAND are supported. I have tested it on
3430SDP (ES2 and ES3.1).

This patch can be treated as an example to "how to utilize":
'gpmc-nand.c' and 'board-sdp-flash.c'.

Similar patches can be created for 2430sdp and 3630sdp or any other
similar board.

Signed-off-by: Vimal Singh <vimalsingh@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap3: SDP: Introducing 'board-sdp-flash.c' for flash init
Vimal Singh [Mon, 15 Feb 2010 18:03:33 +0000 (10:03 -0800)]
omap3: SDP: Introducing 'board-sdp-flash.c' for flash init

This patch adds 'board-sdp-flash.c', which could be utilized
by boards similar to 3430SDP. (For ex: 2430sdp, 36030sdp).

This file does initialization for all three flash devices present
in SDP boards (NOR, NAND, OneNAND), by finding there 'cs' number
dynamically using switch setting information (S8: 1-4).
This also expects partition information from core board files (for
ex: board-3430sdp.c). Which allows to choose different default
partitions for different boards.

A new structure is created for this purpose: 'flash_partitions'
in 'mach/board-sdp.h'. This has two members:
1. struct mtd_partition *parts
2. int nr_parts

A board file is expected to fill this structure and pass it to
'sdp-flsash-init'. Partition information should be passed in
structure array of 'flash_partitions'. Partition information should
be passed in below sequence in array:
NOR
OneNAND
NAND

Signed-off-by: Vimal Singh <vimalsingh@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap2/3/4: Introducing 'gpmc-nand.c' for GPMC specific NAND init
Vimal Singh [Mon, 15 Feb 2010 18:03:33 +0000 (10:03 -0800)]
omap2/3/4: Introducing 'gpmc-nand.c' for GPMC specific NAND init

Introducing 'gpmc-nand.c' for GPMC specific NAND init.
For example: GPMC timing parameters and all.
This patch also migrates gpmc related calls from 'nand/omap2.c'
to 'gpmc-nand.c'.

Signed-off-by: Vimal Singh <vimalsingh@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap2/3/4: serial: fix coding style indentaion
vikram pandita [Mon, 15 Feb 2010 18:03:33 +0000 (10:03 -0800)]
omap2/3/4: serial: fix coding style indentaion

No logical code change

Fix coding style indentaion as per checkpatch.pl
Fix multi-line comment style reported by Nishanth Menon

Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Cc: Nishanth Menon <nm@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap2/3/4: gpmc: avoid section definitions on headers
Felipe Balbi [Mon, 15 Feb 2010 18:03:33 +0000 (10:03 -0800)]
omap2/3/4: gpmc: avoid section definitions on headers

trivial patch, no functional changes.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap2/3/4: gpmc: kill compile warning
Felipe Balbi [Mon, 15 Feb 2010 18:03:33 +0000 (10:03 -0800)]
omap2/3/4: gpmc: kill compile warning

Get rid of the following warnings:

arch/arm/mach-omap2/gpmc.c:550:30: warning: non-ANSI
function declaration of function 'omap3_gpmc_save_context'

arch/arm/mach-omap2/gpmc.c:581:33: warning: non-ANSI
function declaration of function 'omap3_gpmc_restore_context'

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap2/3/4: mailbox: kill compile warning in mailbox.c
Felipe Balbi [Mon, 15 Feb 2010 18:03:33 +0000 (10:03 -0800)]
omap2/3/4: mailbox: kill compile warning in mailbox.c

Change %d to %ld to avoid the compile warning.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap1: mailbox: kill compile warning
Felipe Balbi [Mon, 15 Feb 2010 18:03:33 +0000 (10:03 -0800)]
omap1: mailbox: kill compile warning

use ioremap and remove unused variable to get rid
of compile warnings.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap: McBSP: Use cache when modifying individual register bits
Janusz Krzysztofik [Mon, 15 Feb 2010 18:03:33 +0000 (10:03 -0800)]
omap: McBSP: Use cache when modifying individual register bits

Change the way McBSP registers are updated: use cached values instead of
relying upon those read back from the device.

With this patch, I have finally managed to get rid of all random
playback/recording hangups on my OMAP1510 based Amstrad Delta hardware. Before
that, values read back from McBSP registers to be used for updating them
happened to be errornous.

From the hardware side, the issue appeared to be caused by a relatively high
power requirements of an external USB adapter connected to the board's printer
dedicated USB port.

I think there is one important point that makes this patch worth of applying,
apart from my hardware quality. With the current code, if it ever happens to
any machine, no matter if OMAP1510 or newer, to read incorrect value from a
McBSP register, this wrong value will get written back without any checking.
That can lead to hardware damage if, for example, an input pin is turned into
output as a result.

Applies on top of patch 3 from this series:
[PATCH v9 3/4] OMAP: McBSP: Introduce caching in register write operations

Tested on OMAP1510 based Amstrad Delta using linux-omap for-next, commit
fb7380d70e041e4b3892f6b19dff7efb609d15a4 (2.6.33-rc3+ dated 2010-01-11).
Compile-tested with omap_3430sdp_defconfig.

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Jarkko Nikula <jhnikula@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap: McBSP: Introduce caching in register write operations
Janusz Krzysztofik [Mon, 15 Feb 2010 18:03:33 +0000 (10:03 -0800)]
omap: McBSP: Introduce caching in register write operations

Determine cache size required per McBSP port at init time, based on
processor type running on.

Allocate space for storing cached copies of McBSP register values at
port request.

Modify omap_msbcp_write() function to update the cache with every
register write operation.

Modify omap_mcbsp_read() to support reading from cache or hardware.

Update MCBSP_READ() macro for modified omap_mcbsp_read() function API.

Introduce a new macro that reads from the cache.

Tested on OMAP1510 based Amstrad Delta using linux-omap for-next, commit
fb7380d70e041e4b3892f6b19dff7efb609d15a4 (2.6.33-rc3+ dated 2010-01-11).
Compile-tested with: omap_perseus2_730_defconfig, omap_generic_1610_defconfig,
omap_generic_2420_defconfig, omap_2430sdp_defconfig, omap_3430sdp_defconfig,
omap_4430sdp_defconfig with CONFIG_OMAP_MCBSP=y selected.

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Jarkko Nikula <jhnikula@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap: McBSP: Modify macros/functions API for easy cache access
Janusz Krzysztofik [Mon, 15 Feb 2010 18:03:32 +0000 (10:03 -0800)]
omap: McBSP: Modify macros/functions API for easy cache access

OMAP_MCBSP_READ()/_WRITE() macros and omap_mcbsp_read()/_write() functions
accept McBSP register base address as an argument. In order to support
caching, that must be replaced with an address of the omap_mcbsp structure
that would provide addresses for both register AND cache access.

Since OMAP_ prefix seems obvious in macro names, drop it off in order to
minimize line wrapping throughout the file.

Tested on OMAP1510 based Amstrad Delta using linux-omap for-next, commit
fb7380d70e041e4b3892f6b19dff7efb609d15a4 (2.6.33-rc3+ dated 2010-01-11).
Compile-tested with omap_3430sdp_defconfig.

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Jarkko Nikula <jhnikula@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap: McBSP: Use macros for all register read/write operations
Janusz Krzysztofik [Mon, 15 Feb 2010 18:03:32 +0000 (10:03 -0800)]
omap: McBSP: Use macros for all register read/write operations

There are several places where readw()/writew() functions are used instead of
OMAP_MCBSP_READ()/WRITE() macros for manipulating McBSP registers. Replace
them with macros to ensure consistent behaviour after caching is introduced.

Tested on OMAP1510 based Amstrad Delta.
Compile-tested with omap_3430sdp_defconfig.

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Jarkko Nikula <jhnikula@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap iommu: fix incorrect address for largepage 1st entry
Hiroshi DOYU [Mon, 15 Feb 2010 18:03:32 +0000 (10:03 -0800)]
omap iommu: fix incorrect address for largepage 1st entry

There was a potential risk that the following "memset" could override
its range if a given address was not the 1st entry of a
largepage. This is not the case for "iovmm".

Reported-by: Hari Nagalla <hnagalla@ti.com>
Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Signed-off-by: Hari Nagalla <hnagalla@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap: iommu: fix incorrect address for supersection 1st entry
Hiroshi DOYU [Mon, 15 Feb 2010 18:03:32 +0000 (10:03 -0800)]
omap: iommu: fix incorrect address for supersection 1st entry

There was a potential risk that the following "memset" could override
its range if a given address was not the 1st entry of a
supersection. This is not the case for "iovmm".

Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Signed-off-by: Hari Nagalla <hnagalla@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap iommu: cleanup iommu page address mask and definitions
Hiroshi DOYU [Mon, 15 Feb 2010 18:03:32 +0000 (10:03 -0800)]
omap iommu: cleanup iommu page address mask and definitions

This is just a cleanup, but adds a few macros here, which can be used
in the proceeding patches.

Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoMTD: remove no longer used OMAP flash map
Ladislav Michl [Mon, 15 Feb 2010 18:03:32 +0000 (10:03 -0800)]
MTD: remove no longer used OMAP flash map

All OMAP boards are now using physmap-flash.

Cc: linux-mtd@lists.infradead.org
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap: convert boards to use physmap-flash
Ladislav Michl [Mon, 15 Feb 2010 18:03:32 +0000 (10:03 -0800)]
omap: convert boards to use physmap-flash

Convert OMAP based boards to use physmap-flash. Refreshed against today's
Linux omap kernel tree

Cc: linux-mtd@lists.infradead.org
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap2/3/4: Add omap4 into omap3_defconfig
Tony Lindgren [Mon, 15 Feb 2010 17:27:25 +0000 (09:27 -0800)]
omap2/3/4: Add omap4 into omap3_defconfig

Add omap4 into omap3_defconfig. Note that this does not
yet boot on omap4, but boots on omap2 and omap3.

Also note that CONFIG_SMP does not currently work on
uniprocessor ARMs.

Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap2/3/4: Fix mach-omap2/serial.c for multiboot
Tony Lindgren [Mon, 15 Feb 2010 17:27:25 +0000 (09:27 -0800)]
omap2/3/4: Fix mach-omap2/serial.c for multiboot

Initialize UART4 only for 3630 and 44xx.

Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap: Fix gpio.c for multi-omap for omap4
Tony Lindgren [Mon, 15 Feb 2010 17:27:25 +0000 (09:27 -0800)]
omap: Fix gpio.c for multi-omap for omap4

Set up METHOD_GPIO_44XX instead of trying to use the METHOD_GPIO_24XX.

Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap3/4: Fix compile for multi-omap for clkops_noncore_dpll_ops
Tony Lindgren [Mon, 15 Feb 2010 17:27:25 +0000 (09:27 -0800)]
omap3/4: Fix compile for multi-omap for clkops_noncore_dpll_ops

Rename clkops_noncore_dpll_ops for omap3 and omap4.

Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap2/3/4: Allow booting omap4 with multi-omap configuration
Tony Lindgren [Mon, 15 Feb 2010 17:27:25 +0000 (09:27 -0800)]
omap2/3/4: Allow booting omap4 with multi-omap configuration

Allow booting omap4 with multi-omap configuration.

Tested only on omap2 and omap3, please somebody test
on omap4 and ack.

Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap2/3/4: Clean up entry-macro.s for adding support for omap4 multiboot
Tony Lindgren [Mon, 15 Feb 2010 17:27:25 +0000 (09:27 -0800)]
omap2/3/4: Clean up entry-macro.s for adding support for omap4 multiboot

Move defines around and set up handlers based on MULTI_OMAP2.

Note that this will only allow compiling in omap4 with omap2 and
omap3. It will not yet make omap4 boot with multi-omap.

Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap4: Use get_irqnr_preamble
Tony Lindgren [Mon, 15 Feb 2010 17:27:25 +0000 (09:27 -0800)]
omap4: Use get_irqnr_preamble

Use get_irqnr_preamble

Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap2/3/4: Clean up defines for entry-macro.S
Tony Lindgren [Mon, 15 Feb 2010 17:27:24 +0000 (09:27 -0800)]
omap2/3/4: Clean up defines for entry-macro.S

Define the irq base the same way as for omap2 and omap3,
and start using get_irqnr_preamble.

Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap: Move multi-omap ifdeffery into it's own header file
Tony Lindgren [Mon, 15 Feb 2010 17:27:24 +0000 (09:27 -0800)]
omap: Move multi-omap ifdeffery into it's own header file

This way we can include it easily as needed also for .S files.

Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap2/3: Update omap3_defconfig to build in all the 2420 based boards
Tony Lindgren [Fri, 12 Feb 2010 20:26:49 +0000 (12:26 -0800)]
omap2/3: Update omap3_defconfig to build in all the 2420 based boards

Note that booting 2420 depends on another patch posted earlier to not
select CONFIG_CPU_32v6K if CONFIG_ARCH_OMAP2 is selected.

Also note that we cannot add omap2430 in yet because of the different
clock addresses compared to 2420. Also note that we cannot have
CONFIG_CPU_32v6K=y in order to boot on 24xx.

Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap2/3: Fix initcalls for multi-omap
Tony Lindgren [Fri, 12 Feb 2010 20:26:48 +0000 (12:26 -0800)]
omap2/3: Fix initcalls for multi-omap

Otherwise the wrong initcalls can run.

Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap2/3/4: Replace orred CONFIG_ARCH_OMAP2/3/4 with CONFIG_ARCH_OMAP2PLUS
Tony Lindgren [Fri, 12 Feb 2010 20:26:48 +0000 (12:26 -0800)]
omap2/3/4: Replace orred CONFIG_ARCH_OMAP2/3/4 with CONFIG_ARCH_OMAP2PLUS

omap: Replace orred CONFIG_ARCH_OMAP2/3/4 with CONFIG_ARCH_OMAP2PLUS

Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap3: Replace ARCH_OMAP34XX with ARCH_OMAP3
Tony Lindgren [Fri, 12 Feb 2010 20:26:48 +0000 (12:26 -0800)]
omap3: Replace ARCH_OMAP34XX with ARCH_OMAP3

Replace ARCH_OMAP34XX with ARCH_OMAP3

Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap2: Convert ARCH_OMAP24XX to ARCH_OMAP2
Tony Lindgren [Fri, 12 Feb 2010 20:26:47 +0000 (12:26 -0800)]
omap2: Convert ARCH_OMAP24XX to ARCH_OMAP2

Convert ARCH_OMAP24XX to ARCH_OMAP2

Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap2/3/4: Fix mbox init for multi-omap
Tony Lindgren [Fri, 12 Feb 2010 20:26:47 +0000 (12:26 -0800)]
omap2/3/4: Fix mbox init for multi-omap

Fix mbox init for multi-omap

Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap2/3/4: Fix omap2_map_common_io for multi-omap
Tony Lindgren [Fri, 12 Feb 2010 20:26:47 +0000 (12:26 -0800)]
omap2/3/4: Fix omap2_map_common_io for multi-omap

Fix omap2_map_common_io for multi-omap

Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap: Fix dmtimer.c for multi-omap boot
Tony Lindgren [Fri, 12 Feb 2010 20:26:46 +0000 (12:26 -0800)]
omap: Fix dmtimer.c for multi-omap boot

Fix dmtimer.c for multi-omap boot. Also remove legacy
clk_enable/disable wrappers that are no longer needed.

Note that the clock handling should be further improved
to make use of the clock aliases.

Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap2/3: Multiboot compile fixes to compile in omap2 and omap3
Tony Lindgren [Fri, 12 Feb 2010 20:26:46 +0000 (12:26 -0800)]
omap2/3: Multiboot compile fixes to compile in omap2 and omap3

Allows compiling in omap2 and omap3.

Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap2/3: Make get_irqnr_and_base common for mach-omap2 multiboot
Tony Lindgren [Mon, 15 Feb 2010 17:26:51 +0000 (09:26 -0800)]
omap2/3: Make get_irqnr_and_base common for mach-omap2 multiboot

Make get_irqnr_and_base common for mach-omap2 multiboot

Thanks to a tip from Russell King <rmk+kernel@arm.linux.org.uk>,
this also optimizes the code for non-multiboot configurations by
using get_irqnr_preamble.

Note that this will only work currently for 24xx and 34xx.
Support for 44xx can be added later on for basic multiboot,
and similar patch should be done for mach-omap1/entry-macro.S.

Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoMerge branch 'debug-ll' into omap-for-linus
Tony Lindgren [Mon, 15 Feb 2010 17:26:07 +0000 (09:26 -0800)]
Merge branch 'debug-ll' into omap-for-linus

14 years agoomap: Remove old DEBUG_LL serial port options
Tony Lindgren [Mon, 15 Feb 2010 16:49:14 +0000 (08:49 -0800)]
omap: Remove old DEBUG_LL serial port options

These are no longer needed. Note that zoom boards
should now set their own function in uncompress.h
and debug-macro.S for the external UART.

Signed-off-by: Tony Lindgren <tony@atomide.com>