ARM: OMAP4+: clock: Add omap4_clks_register API

Now the cpu_mask is used to differentiate clocks per each OMAP
platform, SoC version or revision. Such approach has few disadvantages:
- the specific CK_XXX flag need to be added and maintained for each OMAP
SoC;
- it's difficult to update clock tree data in case of differences
between OMAP SoC revisions.
In addition, there are duplicated code in each clockXXX_data.c
files, so it seems, reasonable to remove it:
 - call clk_preinit() for each clock;
 - call clkdev_add(); clk_register(); omap2_init_clk_clkdm();  for each
clock;

Hence, add omap4_clks_register() API which would allow to register
and init few set of clocks and to organize clocks data in the following
way (for example for OMAP4):
- struct omap_clk omap44xx_clks[]; - common clocks set for all OMAP4
SoCs
- struct omap_clk omap443x_clks[]; - specific clocks set for all
OMAP443x SoCs
- struct omap_clk omap446x_clks[]; - specific clocks set for all
OMAP446x SoCs

Change-Id: I370d27f1ce74b95b0b46f6b4e2843416b9b21073
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
[nm@ti.com: 0 contributions, gerrit rebase]
Signed-off-by: Nishanth Menon <nm@ti.com>
ARM: OMAP4: clock: use omap4_clks_register API

Remove OMAP443x and OMAP446x specific clocks from omap44xx_clks
array and add corresponding set of clocks per each SoC:
 - struct omap_clk omap44xx_clks[]; - common clocks set for all OMAP4
 - struct omap_clk omap443x_clks[]; - specific clocks set for OMAP443x
 - struct omap_clk omap446x_clks[]; - specific clocks set for OMAP446x
and don't rely on platform specific flags any more.

Use omap4_clks_register() API to register and init OMAP4 set of
clocks.

With this change, we can now safely remove CK_443X/CK_446X etc macro
usage. It has not been done in this patch, but if the approach is OK,
then, it is possible to do the same.

One additional benefit seen is that the match logic can entirely be
skipped.

Change-Id: I001965e71a0bc60721f2a1b133d9eaad5ae79f35
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
[nm@ti.com: 0 contributions, gerrit rebase]
Signed-off-by: Nishanth Menon <nm@ti.com>
ARM: OMAP4: OPP/Clock: Add virtual clocks for high IVA OPPs support

To get correct frequencies for IVA OPP higher than OPP100 IVA DPLL
should be reconfigured. Tesla is also supplied from the same IVA
DPLL, so frequency on DSP should be reconfigured together with IVAHD
frequency.

This is achieved by adding virtual clocks for IVA and DSP. Main
logic is implemented in IVA virtual clock which sets frequency for
both IVAHD and DSP. DSP virtual clock is just a dummy clock and it
do nothing.

Necessary DSP OPP is set via IVA virtual clock by using DVFS
framework feature:
  - if device on which OPP is set is not the primary device in voltage
domain, then constraint to the same OPP is set for primary device.
  - In case of DSP the primary device is IVAHD.
  - If switching to the lower OPP will cause IVA DPLL scaling up, then
frequency of IVA and DSP should be scaled down before DPLL.

Change-Id: If970fbbf1748cd6de1267d5a1b33090982baa290
[jagadeeshwar.reddy@ti.com: original patch author for 4430]
Signed-off-by: Jagadeeshwar Reddy <jagadeeshwar.reddy@ti.com>
[taras@ti.com: modified and extended for all OMAP44xx]
Signed-off-by: Taras Kondratiuk <taras@ti.com>
[grygorii.strashko@ti.com - forward port from kernel 3.0]
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
[nm@ti.com: 0 contributions, gerrit rebase]
Signed-off-by: Nishanth Menon <nm@ti.com>
ARM: OMAP4460: clock: provide separate smp_twd clocks for 4430 and 4460

For 4460, the smp_twd is derived from the virt_dpll_mpu_ck, instead
of the raw dpll_mpu_ck.

Change-Id: I7c1a503eaccfd74baebf054b8c461a51288333ff
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Dima Zavin <dima@android.com>
[grygorii.strashko@ti.com: forward port from K3.0]
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
[nm@ti.com: 0 contributions, gerrit rebase]
Signed-off-by: Nishanth Menon <nm@ti.com>
ARM: OMAP4470: clock: add specific clock tree data

This patch adds specific clock tree data for OMAP4470:
 - reuse 4460 TS "div_ts_ck" and "bandgap_ts_fclk" clocks for 4470.
 - reuse 4460 "virt_dpll_mpu_ck" clock for 4470.
 - add "iss_fck" clock implementation specific for 4470
   iss_fck clock changed in non backward compatible way: in 4470 parent
clock changed from ducati_clk_mux_ck to div_core_ck.
 - add "ipu_fck" clock implementation specific for 4470
   ipu_fck clock changed in non backward compatible way: in 4470 parent
for this clock changed from ducati_clk_mux_ck to div_core_ck.
 - add "bb2d_fck" clock implementation - it is a new module. As part
of this change missed bb2d module's definitions have been added.

Change-Id: Iba02be34dbecd3d90610cf9a1390199c44b8fa08
Signed-off-by: Taras Kondratiuk <taras@ti.com>
Signed-off-by: Vitaly Chernooky <vitaly.chernooky@ti.com>
Signed-off-by: Andrii Tseglytskyi <andrii.tseglytskyi@ti.com>
[grygorii.strashko@ti.com - Forward port from K3.0]
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
[nm@ti.com: 0 contributions, gerrit rebase]
Signed-off-by: Nishanth Menon <nm@ti.com>
ARM: OMAP4470: clock: Extend L3 clock dependencies to cover 4470

Currently:
- L3 OPP50 frequency is hard coded to 100MHz. But OMAP4470 has
High Performance CORE OPP set where L3 OPP50 is 116MHz.
- CLKOUTX2_M7_DPLL_CORE, CLKOUTX2_M6_DPLL_PER might be used for
PER_BB2D_FCLK source on OMAP4470.

This patch:
- extends L3 clock dependencies tables to cover 4470 HP CORE OPP set.
- removes "dpll_core_m7x2_ck" and "dpll_per_m6x2_ck" clocks from L3
clock dependencies tables for OMAP4470 - those clocks must be controlled
by BB2D driver, not omap4_virt_l3_set_rate().

Change-Id: Id3b036677e0e865f62a3a420ba19de2202bf5415
Signed-off-by: Taras Kondratiuk <taras@ti.com>
Signed-off-by: Oleg Matcovschi <oleg.matcovschi@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
[nm@ti.com: 0 contributions, gerrit rebase]
Signed-off-by: Nishanth Menon <nm@ti.com>
ARM: OMAP4470: hwmod: Add HWMODs data

A set of OMAP4470 hardware modules is mostly the same as
for OMAP4430/60 but it has additional module - bb2d.

So, reuse existed hwmods for 4470 and add additional HWMOD
data structure for bb2d

Change-Id: I504e214c6c048c15a567e05bf984ac5b4a4162ab
Signed-off-by: Taras Kondratiuk <taras@ti.com>
[andrii.tseglytskyi@ti.com> - define bb2d hwmod data]
Signed-off-by: Andrii Tseglytskyi <andrii.tseglytskyi@ti.com>
[grygorii.strashko@ti.com - forward port from K3.0]
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
[nm@ti.com: 0 contributions, gerrit rebase]
Signed-off-by: Nishanth Menon <nm@ti.com>
ARM: OMAP4: hwmod data: remove bandgap hwmod

Commit 407a6888f7362cb3dabe69ea6d9dcf3c750dc56a ("OMAP4: hwmod data:
Add AESS, McPDM, bandgap, counter_32k, MMC, KBD, ISS & IPU") adds a
hwmod for the bandgap die temperature sensor IP block.  This IP block
has no interconnect port or firewall region, nor does it have an
independent register space or OCP control registers. Its registers are
embedded in the System Control Module (SCM) IP block. So it appears
that the bandgap device should be created by the SCM driver.

Change-Id: If73c7ec2d14058c45dbaf54f9a1a7da4d5194963
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Benoit Cousson <b-cousson@ti.com>
[grygorii.strashko@ti.com - back port from k3.7]
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
[nm@ti.com: 0 contributions, gerrit rebase]
Signed-off-by: Nishanth Menon <nm@ti.com>
ARM: OMAP4: hwmod data: fix McASP hwmod definition

Arrays of structures omap_hwmod_irq_info, omap_hwmod_dma_info and
omap_hwmod_addr_space should be filled with "Terminator" elements for
hwmod initialization, but such "Terminator" elements are missed in McASP
hwmod definition.

Hence, fix McASP hwmod definition and add corresponding "Terminator"
elements.

Change-Id: I8ea52ccfcae4dbcdff5a02368e396fbb36586f16
Reported-by: Andrii Tseglytskyi <andrii.tseglytskyi@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
[nm@ti.com: 0 contributions, gerrit rebase]
Signed-off-by: Nishanth Menon <nm@ti.com>
HACK: OMAP4: hwmod: Use config flag PM_STANDALONE

Use PM_STANDALONE flag to disable hwmod initializtion of few drivers
to allow idling of power domains in the absence of drivers.

REVISIT: This flag will be removed when all the driver-pm adapation
is completed.

Change-Id: If951d63b997cbb4610c38ae5db47be9172dd1336
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
[nm@ti.com: 0 contributions, gerrit rebase]
Signed-off-by: Nishanth Menon <nm@ti.com>
ARM: OMAP4470: DPLL: Support MPU frequencies > 1 GHz

The OMAP4470 platform needs DCC (Duty cycle correction)
enabled for frequencies above 1GHz from the MPU DPLL.

Also on 4470, the MPU clk for frequencies higher than 1Ghz
is sourced from CLKOUTX2_M3, instead of CLKOUT_M2, while
value of M3 is fixed to 1. Hence for frequencies higher
than 1 Ghz, the dpll should be locked at half the rate
so the CLKOUTX2_M3 out then matches the requested rate.

Change-Id: Ic5ae0a5ce33a1c908ea891765661b9bffcc2eb44
[rnayak@ti.com: original patch for OMAP4460 in k3.0]
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Vishwanath BS <vishwanath.bs@ti.com>
[taras@ti.com: forward-port to k3.4 for OMAP4470]
Signed-off-by: Taras Kondratiuk <taras@ti.com>
[nm@ti.com: 0 contributions, gerrit rebase]
Signed-off-by: Nishanth Menon <nm@ti.com>
ARM: OMAP4470: OPP: Add support for OMAP4470 DVFS

Add support for OMAP4470 DVFS. Added relevant OPPs, voltages data.

The values are added according to the following documents:
- OMAP4470_ES1.0_Public_TRM_vN
- OMAP4470_ES1.0_DM_Operating_Condition_Addendum_v0.6

The hight MPU OPPs are off till ABB will be supported.
TODO: add DSP

Change-Id: Ia6f897cd3b9643bfea9201757e1f399c2b7a9c25
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
[nm@ti.com: 0 contributions, gerrit rebase]
Signed-off-by: Nishanth Menon <nm@ti.com>
Merge branch 'p-linux-omap-3.4' into p-android-omap-3.4

* p-linux-omap-3.4:
  ARM: OMAP4470: OPP: Add support for OMAP4470 DVFS
  ARM: OMAP4470: DPLL: Support MPU frequencies > 1 GHz
  HACK: OMAP4: hwmod: Use config flag PM_STANDALONE
  ARM: OMAP4: hwmod data: fix McASP hwmod definition
  ARM: OMAP4: hwmod data: remove bandgap hwmod
  ARM: OMAP4470: hwmod: Add HWMODs data
  ARM: OMAP4470: clock: Extend L3 clock dependencies to cover 4470
  ARM: OMAP4470: clock: add specific clock tree data
  ARM: OMAP4460: clock: provide separate smp_twd clocks for 4430 and 4460
  ARM: OMAP4: OPP/Clock: Add virtual clocks for high IVA OPPs support
  ARM: OMAP4: clock: use omap4_clks_register API
  ARM: OMAP4+: clock: Add omap4_clks_register API

Change-Id: Icbe30d97ebc52805c0f96c1ac12723977a507728
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
OMAP4: Blaze: Adds touchscreen board file

Adding separate board file for Blaze touchscreen.

Added arch/arm/mach-omap2/board-44xx-blaze-touch.c:

Based on commits:
p-android-omap-3.0: 6f4b043a82 [Dan Murphy <dmurphy@ti.com>]

Change-Id: I674e96209427c0fb1b5ec7d99007df99ef2bdd6e
Signed-off-by: Alexander Savchenko <oleksandr.savchenko@ti.com>
OMAP4: Blaze: Add sensors board file

Added arch/arm/mach-omap2/board-44xx-blaze-sensors.c

Combined commits:
p-android-omap-3.0: 2169394eab [Arthur Philpott <arthur.philpott@ti.com>]
p-android-omap-3.0: 00f1cf6b22 [Dan Murphy <dmurphy@ti.com>]
p-android-omap-3.4: 83078f9bdc [Shubhrajyoti Datta <shubhrajyoti@ti.com>]

Change-Id: Ic1ce26113b5a9d7b8e439233fca8955ad853348a
Signed-off-by: Alexander Savchenko <oleksandr.savchenko@ti.com>
OMAP4: 4430SDP: Added board blaze keypad

Added blaze keypad init to board-4430sdp.c
Added board-blaze-keypad.c for Display LED driver
Added blaze keypad init to board-blaze.h

Based on commit:
p-android-omap-3.0: 5479520318 [Arthur Philpott <arthur.philpott@ti.com>]

Change-Id: I36612e2a6bdf30f11a314553db290bd9d8cf09ba
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
Signed-off-by: Alexander Savchenko <oleksandr.savchenko@ti.com>
OMAP4: 4430SDP: usb: ehci-ohci functional support

This patch adds the missing ehci-ohci port information and
configures the right MUX mode for USBB2_ULPITLL_CLK

Combined patches:
p-android-omap-3.0: 32f2731485 [Moiz Sonasath <m-sonasath@ti.com>]
p-android-omap-3.0: 066b823c62 [Patrick Combes <p-combes@ti.com>]

Change-Id: I2e77f2514af6281e5deef897e1938c2a86fd37c9
Signed-off-by: Alexander Savchenko <oleksandr.savchenko@ti.com>
syntm12xx: Port synaptics touch screen

Port K35 synaptics touch screen driver from OMAP k35 kernel.

Ported from k3.0:
p-android-omap-3.0: 6f4b043a82 [Dan Murphy <dmurphy@ti.com>]

Change-Id: I0a8eeb9cee83e650cf6fad53e61bef65c706f65e
Signed-off-by: Alexander Savchenko <oleksandr.savchenko@ti.com>
Merge "OMAP4: 4430SDP: usb: ehci-ohci functional support" into p-android-omap-3.4