omap: common: add kernel API to query RAM size

Add kernel api omap_total_ram_size() to query the
exact size of physical ram available in system.
Its derived from mem arguments passed to kernel via
bootargs and is expected to be used by board files and drivers.
Note: omap_init_ram_size() has to be invoked at the earliest
during board init to update memory size.

Change-Id: I8511fd66ba51343bc64a58db04994af930cbe709
Signed-off-by: Devaraj Rangasamy <dev@ti.com>

Conflicts:
	arch/arm/mach-omap2/board-4430sdp.c
	arch/arm/mach-omap2/board-44xx-tablet.c
	arch/arm/mach-omap2/board-omap4panda.c
fix last commit plus zimage
OMAP4: DVFS: Fix scaling dependent frequencies.

When scaling dependent frequencies down it is observed that the order
in which frequencies are changed is incorrect.  For example, when core
domain changes OPP down from OPP119 to OPP50 the order is:
a) scale L3 freq down to OPP50
b) scale SGX freq down to OPP50
which is wrong.

Frequencies are scaled in order devices are registered in omap dvfs
framework in device list. Devices are inserted to the list in order,
such as dependences are satisfied if scaling frequencies up.

When scaling frequencies down traverse list backwards.

Change-Id: I752bcb264cac12514f358986a906f29ee81ba75e
Signed-off-by: Oleksandr Kozaruk <oleksandr.kozaruk@ti.com>
build fix
TILER: Add tiler_backpages method

tiler_backpages method can be used to get the number of pages
required for a tiler allocation.  This method is called before
the memory is partitioned, therefore, we cannot rely on tiler
being initialized.  Separated geometry initialization for this
purpose.

Change-Id: Ia68cbd81c31a357fdc51036753db222d21994996
Signed-off-by: Lajos Molnar <lajos@ti.com>
Signed-off-by: Dima Svetlov <svetlov@ti.com>
OMAP2PLUS:fix for TF doesn't work when CPU1 on/off

TI thermal framework: rework initialization sequence

The initialization of max_thermal was placed in function
which is executed for each CPU1 start. The old value of
max_thermal is lost in this case and is set to max_freq.
As result, the omap_thermal_step_freq_down() can't
reduce the frequency if CPU1 is  switched on/off often.

Signed-off-by: Eugen Mandrenko <ievgen.mandrenko@ti.com>
Change-Id: Idcbc6a56407595b8f71743b91d994990a279593b

Conflicts:
	arch/arm/mach-omap2/omap2plus-cpufreq.c
 OMAP2PLUS:fix for TF doesn't work when CPU1 on/off

TI thermal framework: rework initialization sequence

The initialization of max_thermal was placed in function
which is executed for each CPU1 start. The old value of
max_thermal is lost in this case and is set to max_freq.
As result, the omap_thermal_step_freq_down() can't
reduce the frequency if CPU1 is  switched on/off often.
zimage