ARM: OMAP4: cpuidle: Configure MPU C4 state to OSWR

Due to MPU_EMIF_NO_DYNDEP_IDLE_iXXX, MPU->EMIF dynamic dependency
is disabled when going to LP mode. This allows us to enable deeper
power state for MPU as MPU can transition to lower power state
independent of core power domain. We have observed 1.5mA saving in
OS Idle Screen on use case.

Change-Id: If4ec4426626dabf810b1f21ed33cdabafa386d5f
Signed-off-by: Madhusudan Chittim <c-madhu@ti.com>
OMAP4: ID: Allow omap443x to enable high performance features dynamically

As the prod id offset is same for 443x and 446x, allow 443x to dynamically
enable high performance features based on si type.
Enable 1.2G/1.5G only if it's high performance device, else fall back to 1G.

Change-Id: I11e3eb7dad54169c9e7d4a88396492c3ec1a2010
Signed-off-by: Girish S G <girishsg@ti.com>
Acked-by: Nishanth M <nm@ti.com>
Signed-off-by: Andrii Tseglytskyi <andrii.tseglytskyi@ti.com>
OMAP4: Add 1.2G OPP for 443x OPP table

1.2G OPP can be dynamically enabled for 443x now based
on si type. Adding it in OPP table.

Change-Id: Id1e32a86b0afaa83c7863afdeaa902cd73a9a89c
Signed-off-by: Girish S G <girishsg@ti.com>
Signed-off-by: Andrii Tseglytskyi <andrii.tseglytskyi@ti.com>
OMAP4+: Add ability to store reboot reason

Bootloaders need to know when their platforms do a reboot.
The only memory that is retained is SAR ram accross reboots,
provide ability to store the reboot reason in a standard location
in the SAR memory (using the last 0xf bytes in SAR BANK1 ram).

This is now populated with the string "normal" if the reboot
is due to ordinary reboot commands, if the reboot reason is
for other reasons, such as bootloader or recovery as is the
case with Android systems, this stores the same.

NOTE: bootloader should be updated accordingly.

Change-Id: I32d05ef023682a1530b34315dac90fd97bed3265
Signed-off-by: Nishanth Menon <nm@ti.com>

Conflicts:
	arch/arm/mach-omap2/Kconfig
OMAP: Support for Android RAM console

Android's RAMCONSOLE framework is handy framework which allows
saving the kernel printk messages to a buffer in RAM, so that
after a kernel panic they can be viewed in the next kernel
invocation, by accessing /proc/last_kmsg.

This obviously needs DDR to be in selfrefresh mode. Board files
which have relevant support need to enable CONFIG_OMAP_RAM_CONSOLE
and call omap_ram_console_init with relevant parameters for this
to function.

Change-Id: I2dd5ad55a0a3af5a5dcb9a9b8a797e1371af39bc
Signed-off-by: Huzefa Kankroliwala <huzefank@ti.com>
Signed-off-by: Akash Choudhari <akashc@ti.com>
Signed-off-by: Ameya Palande <ameya.palande@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
ARM: OMAP: Fix ramconsole init.

Fix the issue when trying to register a platform device
before the platform device was initialized.

Postpone the device registration until the board file init.

Change-Id: I3920f9236fec957e4f63f39ff9aa3bae530af014
Signed-off-by: Dan Murphy <dmurphy@ti.com>
OMAP: ramconsole: fix offset by 1 error in recovery path

memblock_add in recovery path of omap_ram_console_register takes
size parameter which is end - start + 1 instead of just end - start.

Change-Id: Iceb88c41538e497611d94dc49e2fc2fff8ee4d30
Signed-off-by: Nishanth Menon <nm@ti.com>
OMAP: ramconsole: make omap_ram_console_register device_initcall

Commit: 65b0b50251c8aa66d5e1da712e3183c74b08c615
(ARM: OMAP: Fix ramconsole init) fixes the symptom of not having
platform_device root device available at reserve. However,
there is no need for omap_ram_console_register to be invoked
by board files as we can do the registration internal to ram_console
logic itself as part of device_initcall.

We use a flag to ensure that we register the device only if the board
file has updated relevant parameters.

Change-Id: I1a0c622612007b0a0ce3249cf71a1dfed9401e24
Signed-off-by: Nishanth Menon <nm@ti.com>
OMAP: dmtimer: Fix memory leak on dmtimer error

Change-Id: I858c24a21410f2c1c85b1b8b2c1fc4dc5d3c1e6d
Signed-off-by: Jared Suttles <jsuttles@motorola.com>
OMAP: dmtimer: Fix timer handling logic for non loses_context timers

The use of the enabled flag is currently tightly coupled with the
loses_context flag on the timer struct. This change makes the enabled
flag behave more sanely without consideration of the loses_context flag.

Change-Id: I9d33bb4cc3fd7917ad493adde75cf57cb240b106
Signed-off-by: Jared Suttles <jsuttles@motorola.com>
OMAP4: DSS2: HDMI: HDMI driver header file addition

Adding the hdmi interface driver header file (hdmi.h) to the dss driver.
Register and structure declaration done here.

Signed-off-by: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
OMAP4: DSS2: HDMI: Add enums and structures for audio

Add enurations and structures for audio configuration. This includes
enumerations for the Audio InfoFrame, I2S, audio FIFO and audio core.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
OMAP4: ID: Chip detection for OMAP4470

Add support for detection of the next chip in the OMAP4 family: OMAP4470 ES1.0

Change-Id: I931d3df6e69fdc3ee4a307c204a68fc9b3ff519b
Signed-off-by: Leonid Iziumtsev <x0153368@ti.com>
ARM: OMAP4: clock: Define 4470 flag in cpu masks

Define OMAP4470 flag in clock cpu masks.
Reuse CK_44XX clocks for 4470.

Increased 'flags' field size to fit additional CPU type.

Change-Id: I546d69495152567b2248b457172c0ab7b2782ce3
Signed-off-by: Taras Kondratiuk <taras@ti.com>
OMAP4: voltage: Add 4470 voltage definitions

Add structures containing OMAP4470 voltage supported and various
voltage dependent data for each VDD.

Data is based on Data Manual Operating Condition Addendum v0.2 for 4470.

Change-Id: I8baa6ccf26786b4ee1764fe96f312ae7fb65ccbf
Signed-off-by: Taras Kondratiuk <taras@ti.com>
OMAP4: DPLL: override for untrimmed unit

Read the value of DPLL TRIM register to check if unit is trimmed.
If it is not trimmed override OMAP4_DPLL_NWELL_TRIM_0 register
with value 0x29.

Change-Id: I5a1678860a9b663b4ce9f1f53694de9930593147
Signed-off-by: Oleksandr Kozaruk <oleksandr.kozaruk@ti.com>
OMAP4: OPP: Add 4470 OPP definitions

Add initial OPP definitions for OMAP4470.
Based on Data Manual Operating Condition Addendum v0.2 for 4470.

Change-Id: Ib3c1b3f4b69560e501b97a18cb72bd0aa0e4292f
Signed-off-by: Taras Kondratiuk <taras@ti.com>
ARM: OMAP4470: PM: Runtime checking for 4470

Add runtime checking for 4470 in those places, where
it behavior is similar to 4460.

This change will:
- allow SRAM LDO to attain retention during low power mode
- remove the static dependency between mpuss and emif

Change-Id: Ifd99fe224412259abf1288240e0846d4dc1c2ae0
Signed-off-by: Leonid Iziumtsev <x0153368@ti.com>
OMAP4: clock: Reuse 4460 TS clocks for 4470

Bandgap thermal sensor in OMAP4470 has the same clock scheme as in OMAP4460.
Reuse div_ts_ck and omap_temp_sensor.0 clocks for 4470.

Change-Id: Idee2cf773b4e5d4c4ce4e8b15ddc6d1e1f82ee40
Signed-off-by: Taras Kondratiuk <taras@ti.com>
OMAP4: clock: Reuse 4460 MPU clock for 4470

OMAP4470 has the same MPU clock scheme as OMAP4460.
Reuse virt_dpll_mpu_ck clock for 4470.

Change-Id: Id3f992d1595c5cc02d316199ad999a084f623b1f
Signed-off-by: Taras Kondratiuk <taras@ti.com>