SIO scheduler
omap: remoteproc: handle latency constraints for non-ipu rprocs

The omap remoteproc code is incorrectly applying the latency
constraint on the CORE domain for all remote processors. This
would apply only for ipu, and the others need them to be applied
on their respective domains. This patch fixes the same.

Change-Id: I1768d78b7029366d05cb5df16a032de597e1e5f3
Signed-off-by: Suman Anna <s-anna@ti.com>
omap: remoteproc: add support for a boot register

Some remote processors (like DSP) need to explicitly configure
a boot address in a special register or memory location, and
this is the address from which they start executing code when
taken out of reset.

Support for this infrastructure has been added to remoteproc
code. The memory or register address where the boot address
is to be stored is supplied through the boot_reg field of the
platform data in the remoteproc. The omap_rproc_start function
will fetch the boot address from the image, and write this
address into the boot register, if provided, before taking the
processor out of reset.

Change-Id: I4efc5824791eda6e23e5d568f4568a3fe3d0014b
Signed-off-by: Juan Gutierrez <jgutierrez@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
omap: remoteproc: add watchdog timer support for dsp

Use GPTimer 6 as the watchdog timer for dsp. This is used
specifically instead of the WDT3, as the latter is not
capable of generating an interrupt to the DSP core. The
former is used to generate an interrupt and thereby
gather some watchdog context data.

Change-Id: I7f8d6e7070cc14f4339e79e42a6affe169270bb2
Signed-off-by: Juan Gutierrez <jgutierrez@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>

Conflicts:

	arch/arm/mach-omap2/remoteproc.c
omap: remoteproc: set the load boot address in activate function

This is needed because the register holding the boot address may
lose context if a deep c-state is reached (either during Device
OFF or during suspend) by the power domain where the register
resides.

Save the extracted bootaddr and then populate the boot address
register before taking the remoteproc out of reset in the activate
function to cover both rproc_start and resume paths.

Change-Id: I0ab3a70268877bcf55d053c9144e3fb834b58939
Signed-off-by: Miguel Vadillo <vadillo@ti.com>
[CPUFREQ] CPUfreq ondemand: update sampling rate without waiting for next sampling

When a new sampling rate is shorter than the current one, (e.g., 1 sec
--> 10 ms) regardless how short the new one is, the current ondemand
mechanism wait for the previously set timer to be expired.

For example, if the user has just expressed that the sampling rate
should be 10 ms from now and the previous was 1000 ms, the new rate may
become effective 999 ms later, which could be not acceptable for the
user if the user has intended to speed up sampling because the system is
expected to react to CPU load fluctuation quickly from __now__.

In order to address this issue, we need to cancel the previously set
timer (schedule_delayed_work) and reset the timer if resetting timer is
expected to trigger the delayed_work ealier.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Jones <davej@redhat.com>
i2c: use usleep_range to wait instead of msleep

according to the docs msleep(1) means wait up 20ms. i2c bus probably
doesn't need to wait that long. Potential performance boost.
OMAP3+: DVFS: ensure proper volt config if curr_volt==new_volt

At times when current_volt is same as new voltage, voltdm_scale is not
invoked. Since, vp_err_gain update and voltdm->curr_volt update is done
as part of vc_prescale and post_scale invoked as part of scale call,
these are left configured to old OPP values even if we are moving
to a new OPP.

Update these when we detect voltdm_scale is not being invoked, but
new OPP Vnom is detected.

Change-Id: Ic45d5a51edb4e5fe526529c6040cd014907b560e
Reported-by: Honda Kenji <x0092217@ti.com>
Reported-by: Maki Tanaka <m-tanaka1@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Revert "cpuidle: ok ease up a little on aggressive multiplier calc"

This reverts commit f2e8c05cbc1f053635686c184d0bf045e7cf339e.
Revert "cpuidle: screw the exit cost, allow deeper C state to be reached"

This reverts commit 7281d44652f4e19fa7db240ffc42387e95666be3.

I suspect this is the cause of the media scanner wakelocks.
checkt: tweak cpu stat and add minfree stuff
I2C: OMAP: NACK without STP

On OMAP4 OMAP_I2C_STAT_NACK is causing a timeout on the next access.
The isr cleans all flags in OMAP_I2C_CON_REG by setting OMAP_I2C_CON_STP
OMAP_I2C_CON_STP is also set in omap_i2c_xfer_msg on the last message.

According to the TI TSR the sequence for OMAP_I2C_STAT_NACK and
OMAP_I2C_STAT_AL are nearly the same.
Removing the OMAP_I2C_CON_STP part in the isr fix the problem.
Tested on OMAP4430 and OMAP3530 (here NACK was not a problem)
Fixes also booting on 2430sdp.

[Picked from http://patches.linaro.org/1899/]

Change-Id: I9bdeba8853ced27659770ad9390bd1b4be573155
Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
ARM: OMAP2+: hwmod: Restore sysc after a reset

After a softreset, make sure the sysc settings are correctly
restored.

Reported-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
checkt: more formatting change
ARM: OMAP2+: powerdomain: Wait for powerdomain transition in pwrdm_state_switch()

Commit b1cbdb00d ("OMAP: clockdomain: Wait for powerdomain to be ON
when using clockdomain force wakeup") was assuming that
pwrdm_state_switch() does wait for the powerdomain transition which is
not the case.  The missing wait for the powerdomain transition
violates the sequence which the hardware expects, which causes power
management failures on some devices.

Fix this API by adding the pwrdm_wait_transition().

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Rajendra Nayak <rnayak@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
[paul@pwsan.com: added some more details in the commit log]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
ARM: OMAP4: clock data: fix mult and div mask for USB_DPLL

According to OMAP4 TRM Table 3-1183, CM_CLKSEL_DPLL_USB register defines
following fields for multiplication and division factors:

DPLL_MULT (bits 19:8) DPLL multiplier factor (2 to 4095)
DPLL_DIV (bits 7:0) DPLL divider factor (0 to 255)

Acked-by: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Ameya Palande <ameya.palande@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
OMAP2+: DVFS: optimize DVFS scale

Currently, the s/w model assumes that when _dvfs_scale is called
we definitely need to do a scale. However when IVA/MPU scales, due to
dependency, _dvfs_scale is invoked for core domain. This unfortunately
does result in SR being disabled, re-enabled, an attempt of voltagescale
and a scan of frequency changes to take place, when there is NO need
for any of these to take place.

we can optimize by doing a pre-scan of the data structures prior to
doing the timeconsuming transition operations

Change-Id: I76e1989acc077092bd7af3027c6fe05adaaffca1
Signed-off-by: Nishanth Menon <nm@ti.com>
defconfig: Disable NOOP i/o scheduler and mm compaction/migration.
leanKernel v3.1.0

1) i2c bus sleep tweak for performance boost
2) SIO i/o scheduler replaced NOOP (Deadline still default)
3) my previous c-state patch reverted completely to fix mediascanner
wakelock issues.
4) tons of updates and fixes from OMAP
5) small ondemand patch to bring cpufreq code up to mainline linux 3.4rc1
6) memory compaction/migration disabled